stripe-react-native icon indicating copy to clipboard operation
stripe-react-native copied to clipboard

confirmPlatformPayPayment returns "Canceled" error even when payment is not canceled

Open minikdev opened this issue 5 months ago • 1 comments
trafficstars

Hi,

I'm occasionally seeing an issue with the confirmPlatformPayPayment function where it returns the following error, even though the user has not canceled the payment:

{
  "code": "Canceled",
  "message": "The payment has been canceled",
  "localizedMessage": "The payment has been canceled",
  "declineCode": null,
  "type": null,
  "stripeErrorCode": null
}

Here's how I'm using the function:

await confirmPlatformPayPayment(clientSecret, {
  googlePay: {
    testEnv: ENVIRONMENT !== 'PRODUCTION',
    merchantName: 'XXXXX',
    merchantCountryCode: 'ES',
    currencyCode: 'EUR',
    billingAddressConfig: {
      format: PlatformPay.BillingAddressFormat.Full,
      isPhoneNumberRequired: true,
      isRequired: true,
    },
  },
  applePay: {
    cartItems: [
      {
        label: 'XXXXX',
        amount: `${pending.toFixed(2)}`,
        paymentType: PlatformPay.PaymentType.Immediate,
      },
    ],
    merchantCountryCode: 'ES',
    currencyCode: 'EUR',
  },
});

Package versions:

  • @stripe/stripe-react-native: 0.43.0
  • react-native: 0.76.9

Affected device:

  • iOS 18.5 (latest known occurrence)

Any help or insight into what might be causing this would be greatly appreciated. Thanks!

minikdev avatar Jun 13 '25 10:06 minikdev

CFBR

minikdev avatar Jun 17 '25 06:06 minikdev

Hi @minikdev, I'm sorry to hear that you're encountering issues. Could you provide more steps to reproduce the issue? I was unable to with the information given. I'd also love to point you to our support channel on our Discord, where we have engineers ready to help you 24/5. Thank you!

joyceqin-stripe avatar Jul 02 '25 22:07 joyceqin-stripe

I am getting this also on iOS both simulator and physical devices.

@stripe/stripe-react-native: 0.49.0 react-native: 0.79.5 + New Arch Enabled

enchorb avatar Jul 11 '25 16:07 enchorb

Hi all! I'm able to reproduce this in our example app, but only when double-clicking the Apple Pay button: This causes const { paymentIntent, error } = await confirmPlatformPayPayment() to be called twice, which then causes the second attempt to fail as a cancellation. We may adjust the example code and error messages to make this a little clearer, but calling the API twice in quick succession will generally fail.

If anyone has noticed this happening without double-calling confirmPlatformPayPayment please let me know, and we'll investigate more!

davidme-stripe avatar Jul 24 '25 00:07 davidme-stripe