Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/deferred payment methods #1839

Merged
merged 7 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class _PaymentSheetScreenState extends State<PaymentSheetDefferedScreen> {
await Stripe.instance.initPaymentSheet(
paymentSheetParameters: SetupPaymentSheetParameters(
// Main params
returnURL: 'flutterstripe://stripe-redirect"',
merchantDisplayName: 'Flutter Stripe Store Demo',
intentConfiguration: IntentConfiguration(
mode: IntentMode(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ public ReadableType getType(String key) {
return ReadableType.Boolean;
} else if (value instanceof Iterable) {
return ReadableType.Array;
} else if (value instanceof JSONArray) {
return ReadableType.Array;
} else if (value instanceof Number) {
return ReadableType.Number;
} else if (value instanceof Map || (value instanceof JSONObject)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,11 @@ extension StripeSdk {
mode = PaymentSheet.IntentConfiguration.Mode.payment(
amount: amount,
currency: modeParams["currencyCode"] as? String ?? "",
setupFutureUsage: modeParams["setupFutureUsage"] != nil
? (modeParams["setupFutureUsage"] as? String == "OffSession" ? .offSession : .onSession)
: nil,
setupFutureUsage: { return switch modeParams["setupFutureUsage"] as? String {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you remove this change and let's go for a fix in dart or we need to make a change to stripe ios

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought to have removed it in last commit, while fixing it in dart, let me check when I return home

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, check it now again, please

case "OffSession": .offSession
case "OnSession": .onSession
default: nil
} }(),
captureMethod: captureMethod
)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class IntentConfiguration with _$IntentConfiguration {

@freezed
class IntentMode with _$IntentMode {
@JsonSerializable(explicitToJson: true)
@JsonSerializable(explicitToJson: true,includeIfNull: false)
const factory IntentMode({
required String currencyCode,
required int amount,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading