#ian_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1415784112303898735
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
Hello ๐
We don't provide support for Flutter packages here, I'm sorry to say
same question for Reactive Native, which Flutter is based on.
If you are using Flutter, it means there's a layer between the code you are writing and the code we control
I can see on the Apple Pay Platform Payment Dialog
[Card]
[Change Payment Method]
[Contact]
[Ship To]
[Method
Delivery - XX.XX]
items
Sub Total (without delivery)
What Stripe element are you using?
Documentation for @stripe/stripe-react-native
Documentation for @stripe/stripe-react-native
we are supplying cartItems, and shippingMethods
we have the cartItems for the product, and Standard Shipping with a cost.
But unclear if expected the price at the bottom of the Apple Pay Platform Payment Sheet is expected to be the sub total without the shipping costs?
What doc are you following?
I thought the user would see the total amount.
just trying to follow these docs
https://stripe.dev/stripe-react-native/api-reference/types/PlatformPay.ApplePayBaseParams.html
https://stripe.dev/stripe-react-native/api-reference/types/PlatformPay.GooglePayBaseParams.html
Google Pay just takes an amount,
but Apple Pay takes cartItems and shippingMethods
Documentation for @stripe/stripe-react-native
Documentation for @stripe/stripe-react-native
want to make sure the Apple Pay user, is seeing the correct price, authorising for the correct total amount.
not sure if this is by design on apple, or an issue how we are populating the total price.
๐ the amount shown and authorized is based on the PaymentIntent's amount that you provided from your backend.
we use this https://stripe.dev/stripe-react-native/api-reference/functions/createPlatformPayPaymentMethod.html
which is created separately from a payment intent, which returns a payment method, which we attach to a payment intent later.
Documentation for @stripe/stripe-react-native
Gotcha
there isn't an amount, but is these cartItems and shippingMethod.
Would be interested if was just a way to show an amount
I believe an amount should show based on the amount in the cartItems? Are you not seeing that? I haven't tested this flow in a while so I don't recall exactly.
What does the Apple Pay modal look like exactly here?
that is what we are seeing, but there is also a Standard Delivery fee selected, and not included in the total at the bottom?
based on the shippingMethods entered, which has the default shipping option selected. (only 1)
You are saying that by setting a ShippingMethod with an amount but that isn't added to the total of the cartItems?
Do you have a screenshot so I can see exactly what you mean here?
And if you open up the part with the cart items what do you see
we are only adding the products to the cart, is a screenshot from a colleague, so can't click through.
so would just be the one product in the cart.
not sure if expected to be automatic, that the chosen delivery cost would be added to the total.
Or on apple pay only the sub total is shown.
Or if we need to do something to get the delivery cost added to the line items/total shown.
I also don't recall exactly... I think the shipping amount isn't dynamically added here even though intuitively it seems like it should be. If you give me a few mins to build my sample I can test as well. But you may have to add the shipping amount as a cartItem amount and I can put in a feature request to see if we can have it correctly sum in the future if this is the case (also not sure if this is a limitation on Apple's end).
given there is only the 1 delivery option,
we could add the delivery cost as a separate line item.
yeah, be good to know what is the expected way
I've seen for https://github.com/stripe/stripe-react-native/issues/2001
if was multiple options, price doesn't get refreshed anyway, if were to change.
So getting delivery country before showing this dialog.
I guess throught to add delivery costs under shippingMethods, but good to know if we should just ignore that, and add as a cartItems
Yeah I know there is an internal ticket open for that issue
Let me double check on this
Hmm okay I think there is a bug actually ๐
I'm seeing that when I add multiple cartItems it is only showing in the UI the amount of the last cartItem.
And ignoring the ShippingMethod as well
apart from the display issue, is the payment method collected for the right amount, with shipping?
(obvs dispaly is important too)
Well if you are using collectPaymentMethod() then the amount is solely dependent on your backend.
The UI has no affect on the actual amount charged.
So what I'd recommend here is to bundle the full amount into one cartItem for now.
yeah, but that doesn't allow collecting delivery address/allow delivery address selection if I recall correctly.
yeah, 1 line item would wokr
And then keep an eye on https://github.com/stripe/stripe-react-native and the changelog (https://github.com/stripe/stripe-react-native/blob/master/CHANGELOG.md) for when a new version is released with a fix for this UI issue.
I'll file a ticket to get the UI issue fixed
Overall it will never have an affect on the amount charged as that is always solely dependent on the PaymentIntent amount which can only be set on your backend.
yeah, just the user should see the same price on the dialog.
I was asking this on earlier thread, what would happen if amount on Payment Method collected from this dialog, was less than the amount on the payment intent. Conclusion was to ensure the same.
Has no affect
Feel free to test it if you like, but when using createPlatformPayPaymentMethod() all it is doing is creating a PaymentMethod and then closing the sheet.
It has no knowledge of a PaymentIntent or any difference in the intended value to charge.
but the user is seeing that price,
I wondered if would be an issue if the price charged was higher, if the payment request would fail.
was trying to ask this in previous thread.
suggested adding another dialog after, to show final price.
after shipping selection
Nope it has no influence
but told to get shipping country first, to ensure price shown in dialog is correct.
I also just tested with confirmPlatformPayPayment() and it doesn't care about the value difference either.
Now this is different from our Web flow (Express Checkout Element / Payment Element)
That does have amount validation.
So maybe that is where the confusion is here?
But in this mobile flow it doesn't matter if the amount in the UI differs.
hmm ok, so it could work then, to not have to have a fake address set, to set a delivery method, before delivery collected from Google Pay/Apple Pay.
Then show an extra final confirmation, if there is an extra delivery charge.
Good to know, just still see what's cleaner.
could there be a way to just set an amount as well?
rather than having to add the cart items?
I don't think so
seems one flow allows it, if creating from payment intent, but this other way, where we want to collect shipping address doesn't
I'm seeing errors requiring cartItems...
You could use the pending label on cartItems though
what does Stripe do for the other route, where create the Apple Pay Platform Payment dialog from a Payment Intent, or from a Payment Sheet?
doesn't have knowledge of the cart items then
yeah, either the other constructor, which didn't allow requesting shipping address, or just PaymentSheet which get created from a payment intent client secret.
PaymentSheet uses either the amount from the client secret or you specify the amount via your intentConfiguration: https://docs.stripe.com/payments/mobile/accept-payment?platform=react-native&type=payment#initialize-paymentsheet
yeah, so how does that get around not supplying the cartItems?
Yeah because it is a different flow with different params: https://stripe.dev/stripe-react-native/api-reference/types/PaymentSheet.ApplePayParams.html
You can see cartItems are optional there
I don't know why PlatformPay was built to require cartItems... can't speak to that.
yeah, think that's my query, if that is something in the Stripe React SDK - if that could support just an amount
I'll got with the one line item for now, but that would be good one to know, then would be aligned to Google Pay, and the other constructor.
Yeah fair feedback
I'll put in a feature request for that as well.
Though no guarantee on that getting actioned in the near term
yeah, thanks for that, understood, hopefully save some future person asking the same thing.
Yep appreciate your feedback