#Žiga

1 messages · Page 1 of 1 (latest)

iron fulcrumBOT
crystal rivet
#

👋 happy to help

thorny blade
mighty iron
#

how do I create the clientSecret?

thorny blade
mighty iron
#

so my setup right now is like this

const items = [
        {
          label: 'Laundryheap Limited',
          amount: '0',
          paymentType: 'Deferred',
          isPending: true,
        },
      ];

      const { setupIntent, error } = await confirmPlatformPaySetupIntent(
        'seti_1MeeCfBaqoRVG089gsrC3M6W_secret_NPT8st7x4bgINIoAhujtXoJA8lCf72v',
        {
          applePay: {
            merchantCountryCode: 'GB',
            currencyCode: 'gbp',
            cartItems: items,
            shippingType: 'servicePickup',
          },
        },
      );

      console.log('setupIntent', setupIntent);
      console.log('error', error);

all I get after this is a popup saying Apple pay not completed
and once I dismiss this popup I get
this back from the confirmPlatformPaySetupIntent

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

I also created the client secret like it's shown on the link you sent me

thorny blade
#

Let's use this thread to chat

hi is is possible to disable an option to remove cards when using presentPaymentSheet?

mighty iron
#

ok

gilded matrix
#

Hi, I'm taking over my colleague 👋
I remember you asked a question about clientSecret yesterday, did the answer not work for you?

#dev-help message

mighty iron
#

so i did try the confirmPlatformPaySetupIntent createPlatformPayPaymentMethod but I would like to just authorize the card without charging it. But there when I try to create intent it requires an amount which can't be 0

#

in the documentation i found that since presentApplePay is deprecated, we can now use confirmPlatformPaySetupIntent

gilded matrix
#

"... it requires an amount ..." what requires it exactly?

mighty iron
#

first I need to pass items to that method
and also when creating sectet on the backend it requires amount which can't be 0

gilded matrix
#

If you create a SetupIntent on the backend it doesn't require the amount.

mighty iron
#

no sorry. my bad.
so when I use the createPlatformPayPaymentMethod it requires items to be passed, which needs amount

#

but when i use confirmPlatformPaySetupIntent it fails every time. so yesterday I said I'll try createPlatformPayPaymentMethod but here I'm not too sure it's the right one for me since it requires amount

#

I believe I should be using something similar to confirmSetupIntent which I use for authorizing and adding credit cards to users

#

and it does not need any amount

gilded matrix
#

Why did you decide to use createPlatformPayPaymentMethod?

mighty iron
#

/** @deprecated Use confirmPlatformPaySetupIntent, confirmPlatformPayPayment, or createPlatformPayPaymentMethod instead. */
export declare const presentApplePay: (params: ApplePay.PresentParams) => Promise<ApplePayResult>;

We were using presentApplePay and in your code you mention this three new methods

gilded matrix
#

My colleague suggested using PaymentSheet yesterday. Did it not work out for you?

mighty iron
#

yes and no. It could work.
But I have some issues there
One is there is no address to enter. Not a big deal but would be usefull
I can't disable the option to remove cards. We don't want that functionality
I also can't find a way to just add new cards and hide existing cards

gilded matrix
#

What's the issue with confirmPlatformPaySetupIntent then?

#

Other 2 methods are not fitting your purpose, and if you don't want to use PaymentSheet, you need to use the confirmPlatformPaySetupIntent.

mighty iron
#

I create a client secret, I pass it to confirmPlatformPaySetupIntent which then fails
it shows a popup saying Apple pay not completed
and after that returns

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

also I could use PaymentSheet but this two things prevent me from using it
I can't disable the option to remove cards. We don't want that functionality
I also can't find a way to just add new cards and hide existing cards

gilded matrix
#

You could potentially create a new Customer for each payment, so they don't have any saved cards.

#

But what's the problem with the saved cards? It allows your customers to checkout faster.

mighty iron
#

also not ideal 😄 we still want to show them their cards but in out own ui. where they cant' remove them

#

we save cards. but when it's time for payment our backend charges the card. we don't want to show this ui for user to select /add card. they do that before

gilded matrix
#

Hi, sorry for the wait. I am trying to reproduce this on my end.

slender lance
#

If not, I think the best thing to do here @mighty iron would be to strip down what you've got into a minimal reproduction of this issue with no other code specific you your application and share the repo in a new issue on our github repo for investigation:
https://github.com/stripe/stripe-react-native/issues

When this is distilled down, you'll either uncover the issue or precisely identify a related bug to be fixed

GitHub

React Native library for Stripe. Contribute to stripe/stripe-react-native development by creating an account on GitHub.