Skip to content

Commit

Permalink
Bugfixes december (#1543)
Browse files Browse the repository at this point in the history
* doc: fix #1532 broken link in readme

* chore(release): publish packages

 - [email protected]

* fix: #1512 add latest charge field to payment intent (Web only)

* doc: fix #1488 add nscamerausagedescription to readme

* BREAKING: rename ApplePayShippingContact to Platformpayshipping contact

* doc: #1546 add proguard rules for push provisioning

* fix: #1465 unknow result

* doc: add  klarna as return url for paymentsheet

* fix #1560

* adjust github android workflow

* chore(release): publish packages

 - [email protected]

* chore(release): publish packages

 - [email protected]

* chore(release): publish packages

 - [email protected]

* chore(release): publish packages

 - [email protected]

* chore(release): publish packages

 - [email protected]

* chore: update changelogs

---------

Co-authored-by: Remon <[email protected]>
Co-authored-by: Jonas Bark <[email protected]>
  • Loading branch information
3 people authored Dec 19, 2023
1 parent ab3c0fd commit e80a2e0
Show file tree
Hide file tree
Showing 41 changed files with 934 additions and 349 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/all_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
- name: Set up Java version
uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

Expand Down Expand Up @@ -176,9 +176,9 @@ jobs:
- name: "Run integration test Android"
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
api-level: 34
working-directory: example
script: |
sleep 15;
flutter drive --driver test_driver/integration_test.dart --target=integration_test/run_all_tests.dart;
cd android && ./gradlew :app:connectedDebugAndroidTest;
cd android && ./gradlew :app:connectedDebugAndroidTest;
159 changes: 159 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,165 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## 2023-12-19

### Changes

---

Packages with breaking changes:

- [`flutter_stripe` - `v10.0.0`](#flutter_stripe---v1000)

Packages with other changes:

- There are no other changes in this release.

---

#### `flutter_stripe` - `v10.0.0`

- **BREAKING** **BREAKING**: rename ApplePayShippingContact to Platformpayshipping contact.

Check warning on line 24 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

Platformpayshipping

"Platformpayshipping" is a typo. Did you mean "Weatherstripping"?


## 2023-12-19

### Changes

---

Packages with breaking changes:

- [`flutter_stripe_web` - `v5.0.0`](#flutter_stripe_web---v500)

Packages with other changes:

- There are no other changes in this release.

---

#### `flutter_stripe_web` - `v5.0.0`

- **FIX**: #1512 add latest charge field to payment intent (Web only).
- **BREAKING** **BREAKING**: rename ApplePayShippingContact to Platformpayshipping contact.

Check warning on line 46 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

Platformpayshipping

"Platformpayshipping" is a typo. Did you mean "Weatherstripping"?


## 2023-12-19

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`stripe_ios` - `v10.0.0`](#stripe_ios---v1000)
- [`flutter_stripe` - `v9.6.1`](#flutter_stripe---v961)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `flutter_stripe` - `v9.6.1`

---

#### `stripe_ios` - `v10.0.0`


## 2023-12-19

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`stripe_android` - `v10.0.0`](#stripe_android---v1000)
- [`flutter_stripe` - `v9.6.1`](#flutter_stripe---v961)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `flutter_stripe` - `v9.6.1`

---

#### `stripe_android` - `v10.0.0`

- **FIX**: add bankidentifiercode to ideal paymentdata (#1522).

Check warning on line 100 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

bankidentifiercode

"bankidentifiercode" is a typo. Did you mean "identification"?


## 2023-12-19

### Changes

---

Packages with breaking changes:

- [`stripe_platform_interface` - `v10.0.0`](#stripe_platform_interface---v1000)

Packages with other changes:

- [`flutter_stripe_web` - `v4.6.1`](#flutter_stripe_web---v461)
- [`flutter_stripe` - `v9.6.1`](#flutter_stripe---v961)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `flutter_stripe_web` - `v4.6.1`
- `flutter_stripe` - `v9.6.1`

---

#### `stripe_platform_interface` - `v10.0.0`

- **FIX**: #1465 unknow result.

Check warning on line 129 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

unknow

"unknow" is a typo. Did you mean "unknown"?
- **FIX**: #1512 add latest charge field to payment intent (Web only).
- **FIX**: add bankidentifiercode to ideal paymentdata (#1522).

Check warning on line 131 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

bankidentifiercode

"bankidentifiercode" is a typo. Did you mean "identification"?
- **BREAKING** **BREAKING**: rename ApplePayShippingContact to Platformpayshipping contact.

Check warning on line 132 in CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

Platformpayshipping

"Platformpayshipping" is a typo. Did you mean "Weatherstripping"?


## 2023-12-11

### Changes

---

Packages with breaking changes:

- There are no breaking changes in this release.

Packages with other changes:

- [`stripe_js` - `v3.3.0`](#stripe_js---v330)
- [`flutter_stripe_web` - `v4.6.1`](#flutter_stripe_web---v461)

Packages with dependency updates only:

> Packages listed below depend on other packages in this workspace that have had changes. Their versions have been incremented to bump the minimum dependency versions of the packages they depend upon in this project.
- `flutter_stripe_web` - `v4.6.1`

---

#### `stripe_js` - `v3.3.0`

- aaa

- **FIX**: invalid argument `requires_capture` on web (#1431).


## 2023-11-29

### Changes
Expand Down
24 changes: 21 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,24 @@ dart pub add flutter_stripe
This plugin requires several changes to be able to work on Android devices. Please make sure you follow all these steps:

1. Use Android 5.0 (API level 21) and above
2. Use Kotlin version 1.5.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/.gradle#L2)
2. Use Kotlin version 1.5.0 and above: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/build.gradle)
3. Requires Android Gradle plugin 8 and higher
4. Using a descendant of `Theme.AppCompat` for your activity: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values/styles.xml#L15), [example night theme](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/app/src/main/res/values-night/styles.xml#L16)
5. Using an up-to-date Android gradle build tools version: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/build.gradle#L9) and an up-to-date gradle version accordingly: [example](https://github.com/flutter-stripe/flutter_stripe/blob/main/example/android/gradle/wrapper/gradle-wrapper.properties#L6)
6. Using `FlutterFragmentActivity` instead of `FlutterActivity` in `MainActivity.kt`: [example](https://github.com/flutter-stripe/flutter_stripe/blob/79b201a2e9b827196d6a97bb41e1d0e526632a5a/example/android/app/src/main/kotlin/com/flutter/stripe/example/MainActivity.kt#L6)
7. Rebuild the app, as the above changes don't update with hot reload
7. Add the following rules to your `proguard-rules.pro` file: [example](https://github.com/flutter-stripe/flutter_stripe/blob/master/example/android/app/proguard-rules.pro)
```proguard
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivity$g

Check warning on line 57 in README.md

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args

Check warning on line 58 in README.md

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error

Check warning on line 59 in README.md

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter

Check warning on line 60 in README.md

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider

Check warning on line 61 in README.md

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
```
8. Rebuild the app, as the above changes don't update with hot reload

These changes are needed because the Android Stripe SDK requires the use of the AppCompat theme for their UI components and the Support Fragment Manager for the Payment Sheets

If you are having troubles to make this package to work on Android, join [this discussion](https://github.com/flutter-stripe/flutter_stripe/discussions/538) to get some support
If you are having troubles to make this package to work on Android, join [this discussion](https://github.com/flutter-stripe/flutter_stripe/discussions/538) to get some support.

#### iOS

Expand All @@ -68,6 +76,16 @@ You will also need to update in your Podfile:

`platform :ios, '13.0'`

For card scanning add the following to your Info.plist:

```xml
<key>NSCameraUsageDescription</key>
<string>Scan your card to add it automatically</string>
<key>NSCameraUsageDescription
&lt;string&gt;To scan cards&lt;/string&gt;</key>
<string>To scan cards</string>
```

#### Web (Experimental)

Now you can use Stripe with Flutter web! Notice right now it is highly experimental and only a subset of features is implemented. Namely:
Expand Down
26 changes: 23 additions & 3 deletions docs/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ You can check if your backend is communicating with the live environment at the
"livemode": true,
"next_action": null,
"status": "succeeded",
...
}
```

#### Client side
Expand Down Expand Up @@ -157,16 +157,19 @@ The payment intent should be linked to a customer and for the customer an epheme


```json

{
"id": "pi_12345",
"object": "payment_intent",
....
"charges": {
"object": "list",
"data": [
{
"id": "ch_1234",
"customer": "cus_12345",
}
]
},
}
```

#### Client-side
Expand All @@ -184,4 +187,21 @@ The payment intent should be linked to a customer and for the customer an epheme
customerEphemeralKeySecret: data['ephemeralKey'],
// Extra params
```
#### Android compile issue app bundle
When you get this issue when building android app bundle.

```bash
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error (referenced from: void com.reactnativestripesdk.pushprovisioning.PushProvisioningProxy$createActivityEventListener$listener$1.onActivityResult(android.app.Activity, int, int, android.content.Intent))
Missing class com.stripe.android.pushProvisioning.PushProvisioningActivityStarter (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider))
Missing class com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider (referenced from: void com.reactnativestripesdk.pushprovisioning.DefaultPushProvisioningProxy.beginPushProvisioning(android.app.Activity, java.lang.String, com.reactnativestripesdk.pushprovisioning.EphemeralKeyProvider) and 1 other context)
```

Add the following rules to your `proguard-rules.pro` file: [example](https://github.com/flutter-stripe/flutter_stripe/blob/master/example/android/app/proguard-rules.pro)
```proguard
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivity$g

Check warning on line 202 in docs/troubleshooting.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args

Check warning on line 203 in docs/troubleshooting.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error

Check warning on line 204 in docs/troubleshooting.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter

Check warning on line 205 in docs/troubleshooting.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider

Check warning on line 206 in docs/troubleshooting.mdx

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
```
5 changes: 4 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace 'com.flutter.stripe.example'
compileSdk 33
compileSdk 34

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
Expand All @@ -53,6 +53,9 @@ android {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug

proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"

}
}
}
Expand Down
5 changes: 5 additions & 0 deletions example/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivity$g

Check warning on line 1 in example/android/app/proguard-rules.pro

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Args

Check warning on line 2 in example/android/app/proguard-rules.pro

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter$Error

Check warning on line 3 in example/android/app/proguard-rules.pro

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningActivityStarter

Check warning on line 4 in example/android/app/proguard-rules.pro

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
-dontwarn com.stripe.android.pushProvisioning.PushProvisioningEphemeralKeyProvider

Check warning on line 5 in example/android/app/proguard-rules.pro

View workflow job for this annotation

GitHub Actions / Typo CI

dontwarn

"dontwarn" is a typo. Did you mean "frontward"?
1 change: 1 addition & 0 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,6 @@ final exampleAppTheme = ThemeData(
secondary: Color(0xff6058F7),
),
primaryColor: Colors.white,
useMaterial3: false,
appBarTheme: AppBarTheme(elevation: 1),
);
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ class _PaymentSheetScreenState extends State<PaymentSheetScreen> {
// Customer params
customerId: data['customer'],
customerEphemeralKeySecret: data['ephemeralKey'],
returnURL: 'flutterstripe://redirect',

// Extra params
primaryButtonLabel: 'Pay now',
Expand Down
12 changes: 11 additions & 1 deletion example/lib/screens/wallets/apple_pay_create_payment_method.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import 'package:flutter/material.dart';
import 'package:flutter_stripe/flutter_stripe.dart';
import 'package:stripe_example/widgets/example_scaffold.dart';
import 'package:stripe_example/widgets/response_card.dart';

class ApplePayCreatePaymentMethodScreen extends StatefulWidget {
@override
_ApplePayScreenState createState() => _ApplePayScreenState();
}

class _ApplePayScreenState extends State<ApplePayCreatePaymentMethodScreen> {
PlatformPayPaymentMethod? response;
@override
void initState() {
Stripe.instance.isPlatformPaySupportedListenable.addListener(update);
Expand Down Expand Up @@ -37,6 +39,10 @@ class _ApplePayScreenState extends State<ApplePayCreatePaymentMethodScreen> {
)
else
Text('Apple Pay is not available in this device'),
SizedBox(
height: 50,
),
ResponseCard(response: response?.toString() ?? ''),
],
);
}
Expand Down Expand Up @@ -76,8 +82,12 @@ class _ApplePayScreenState extends State<ApplePayCreatePaymentMethodScreen> {
),
);

setState(() {
response = paymentMethod;
});

ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(
'Success!: The payment method with id: ${paymentMethod.id} was created successfully,')));
'Success!: The payment method with id: ${paymentMethod.paymentMethod.id} was created successfully,')));
}
}
3 changes: 2 additions & 1 deletion example/server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,7 @@ app.post('/payment-sheet', async (_, res) => {
// Edit the following to support different payment methods in your PaymentSheet
// Note: some payment methods have different requirements: https://stripe.com/docs/payments/payment-methods/integration-options
payment_method_types: [
'card',
// 'ideal',
// 'sepa_debit',
// 'sofort',
Expand All @@ -562,7 +563,7 @@ app.post('/payment-sheet', async (_, res) => {
// 'giropay',
// 'eps',
// 'afterpay_clearpay',
'klarna',
// 'klarna',

Check warning on line 566 in example/server/src/index.ts

View workflow job for this annotation

GitHub Actions / Typo CI

klarna

"klarna" is a typo. Did you mean "carnal"?
// 'us_bank_account',
],
});
Expand Down
11 changes: 11 additions & 0 deletions packages/stripe/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 10.0.0

**Breaking changes**
Rename `ApplePayShippingContact` to `PlatformpayshippingContact`.

Check warning on line 4 in packages/stripe/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

PlatformpayshippingContact

"PlatformpayshippingContact" is a typo. Did you mean "WeatherstrippingContact"?

**Fixes**
- #1465 Handle nullable result coming from Stripe sdk.
- #1512 add latest charge field to payment intent (Web only).
- #1522 add bankidentifiercode to ideal paymentdata.

Check warning on line 9 in packages/stripe/CHANGELOG.md

View workflow job for this annotation

GitHub Actions / Typo CI

bankidentifiercode

"bankidentifiercode" is a typo. Did you mean "identification"?
- #1560 fix payment sheet crash when pressing back button.

## 9.6.0+1
- add requirement for Android gradle plugin to readme

Expand Down
Loading

0 comments on commit e80a2e0

Please sign in to comment.