#Žiga
1 messages · Page 1 of 1 (latest)
👋 happy to help
Hi! Here's the documentation about this: https://stripe.dev/stripe-react-native/api-reference/index.html#confirmPlatformPaySetupIntent
how do I create the clientSecret?
By creating a SetupIntent on the backend, and it will contain a client_secret https://stripe.com/docs/api/setup_intents/create
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
Let's use this thread to chat
hi is is possible to disable an option to remove cards when using presentPaymentSheet?
ok
Hi, I'm taking over my colleague 👋
I remember you asked a question about clientSecret yesterday, did the answer not work for you?
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
"... it requires an amount ..." what requires it exactly?
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
If you create a SetupIntent on the backend it doesn't require the amount.
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
Why did you decide to use createPlatformPayPaymentMethod?
/** @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
My colleague suggested using PaymentSheet yesterday. Did it not work out for you?
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
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.
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
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.
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
Hi, sorry for the wait. I am trying to reproduce this on my end.
@mighty iron is this the same issue as the one reported here?
https://github.com/stripe/stripe-react-native/issues/1261#issuecomment-1384372833
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