Skip to content

iOS "Link" payment method not working #2137

Open
@Albertbol

Description

@Albertbol

Describe the bug
When you choose Link payment method in mobile payment sheet, link in app browser requests information you write it there than it automatically closes, but now payment sheet does nothing you can again choose payment type it does not do anything. When i work locally in test mode it works, on android it started to work in prod when i removed android:taskAffinity="" in AndroidManifest.xml.
When i check transaction in Stripe Dashboard it says:
A request to create a PaymentIntent completed ->The PaymentIntent requires a payment method (requires_payment_method)

So what does it mean is it a bug on your side that payment method is not sent or what is happening and why only prod ios not working.

I have followed schemas docs, added return URL custom flow is set to false. Payment methods are set to automatic. Worth to mention that in my payments i use onBehalfOf to pay to connected accounts. Every other method works apple and cards.

Info.plist

<dict>
	<key>CFBundleTypeRole</key>
	<string>Editor</string>
	<key>CFBundleURLName</key>
	<string>safepay</string>
	<key>CFBundleURLSchemes</key>
	<array>
		<string>myappname</string>
	</array>
</dict>

init payment dart file:

await Stripe.instance.initPaymentSheet(
      paymentSheetParameters: SetupPaymentSheetParameters(
        customFlow: false,
        merchantDisplayName: 'myappname',
        paymentIntentClientSecret: paymentIntentClientSecret,
        returnURL: 'myappname://stripe-redirect',
        customerId: customer, (customer id)
        applePay: const PaymentSheetApplePay(
          merchantCountryCode: 'LV',
        ),
        googlePay: const PaymentSheetGooglePay(
          merchantCountryCode: 'LV',
          testEnv: true,
        ),
        style: ThemeMode.dark,
      ),
    );

server ts:

const paymentIntentCreateParams: Stripe.PaymentIntentCreateParams = {
          amount,
          currency,
          customer: customer.id,
          metadata,
          automatic_payment_methods: {
            enabled: true,
          },
          on_behalf_of: onBehalfOf,
          transfer_data: {
            destination: onBehalfOf,
          },
          application_fee_amount: fixedFeeInCents,
          capture_method: 'manual',
        };
        const paymentIntent = await this.stripe.paymentIntents.create(
          paymentIntentCreateParams
        );
        paymentIntentClientSecret = paymentIntent.client_secret;
        ephemeralKey = await this.stripe.ephemeralKeys.create(
          { customer: customer.id },
          { apiVersion: '2025-03-31.basil' }
        );
        paymentIntentId = paymentIntent.id;

Any ideas whats wrong?

To Reproduce
Not sure how to reproduce as it does not work in production only, and yes i have enabled Link in dashboard everything is on there in settings for all components, i have verified domain.
Expected behavior
Mobile payment sheet should procceed with payment.

Smartphone / tablet

  • Device: [e.g. iPhone X] any iphone
  • OS: [e.g. iOS 13, Android 10]
  • Package version: [e.g. 1.0.0]
  • Flutter version [e.g. 2.0.0.] 3.29.3

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions