#ScreamZ-Q
1 messages ยท Page 1 of 1 (latest)
hello
I share you some code
initPaymentSheet({
setupIntentClientSecret: client_secret,
merchantDisplayName: t("app"),
// @ts-ignore // !!! See https://github.com/stripe/stripe-react-native/issues/945
merchantIdentifier: Config.STRIPE.MERCHANT_IDENTIFIER,
applePay: Config.STRIPE.ENABLE_APPLE_PAY
? {
merchantCountryCode: "FR",
paymentSummaryItems: [
{
label: "Caution Stride",
paymentType: "Immediate",
amount: "35",
isPending: false,
},
],
}
: undefined,
googlePay: { merchantCountryCode: "FR", currencyCode: "EUR" },
merchantCountryCode: "FR",
testEnv: Config.STRIPE.TEST_ENVIRONMENT,
})
is it
We are collecting the card detail to put a hold later when the user book a power bank
Then we remove the hold once the user is bringing back the power bank to the station
I used to play with isPending before, but could be nice to display what is the amount that will be taken in case
We already have it on the interface, but even, could be nice
In fact it works, it's just that it shows $
I wouldn't use SetupIntents to be honest
Tell me
It's currently working, we just updated the code.
I would use a Payment Intent with a capture: manual
The thing is we want to reuse the same card
That's what is done on the backend
The user do a setup intent, for future
you could save the card at the same time as doing a Payment Intent
Each time he take a power bank, the backend use the setup intent data to create a capture manual hold
you don't have to do it in 2 steps
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Alright, sounds nice
I'll take a look at it, because it would need some change on the code
What if I want to change my card ? without triggering a new "transaction"
and putting a hold
Imagine i just received my new card from mailer and i want to update my account without taking a new power bank
you can always use the same PaymentIntent and change the payment method up until you confirm/capture it
Imagine i just received my new card from mailer and i want to update my account without taking a new power bank
Yeah I agree that in that case you would use SetupIntents
but even then the amount should be 0
User create an account
User fill a setup intent
Then he scan a QR code on the nearest station
The backend generate a new payment intent with capture later for the hold
Battery ejected
Once the battery is brought back, the payment intent is canceled
When the user scan a new QR code, a new intent is created, and so on
Alright, so is there any way to display 0โฌ instead of 0$
๐
I'm not sure tbh
could you try without the extra params?
amount: "35",
isPending: false,
I think this
applePay: Config.STRIPE.ENABLE_APPLE_PAY
? {
merchantCountryCode: "FR",
paymentSummaryItems: [
{
label: "Caution Stride",
paymentType: "Immediate",
amount: "35",
isPending: false,
},
],
}
: undefined,
``` is what's affecting the default behavior
I'm a bit curious why it exist in the Google Pay but not in the Apple Pay Params to be honest
I will try to dig deeper on this with the appropriate team
i'll try
I tried to ping Charlie Cruzan which looks very active on the SDK on your side : https://github.com/stripe/stripe-react-native/pull/1020#issuecomment-1208686329
So just to be clear you want me to try like this ?
paymentSummaryItems: [
{
paymentType: "Immediate",
amount: "35โฌ",
isPending: false,
},
],