#hungleviet_react-native-digital-wallets
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/1354802803381506060
📝 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.
- hungleviet_api, 4 hours ago, 41 messages
hi @red delta can you take a look at my previous thread and help me out #dev-help message
hey there, i was helping bismarck look at this yesterday. Are you having a new problem with this?
Also, is there a reason you're using a very old version of this SDK instead of upgrading?
my project can not use the lastest version of this SDK, it was incomparable
what does that mean?@red delta why does Bismarck have anything to do here? I dont get it
Whoops sorry, i though that was who you were talking to about this previously
Disregard that, my mistake
Ok so you're using the react native SDK 0.20.0 -- what's the issue you're having with that, specifically?
At lastest sdk version it throw err
react-native/src/node_modules/@stripe/stripe-react-native/android/src/main/java/com/reactnativestripesdk/utils/Mappers.kt: (1037, 32): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.1.0, expected version is 1.6.0.
any idea to resolve it? @red delta
with my current version 0.2.0 I dont know how how process the payment with apple pay and google pay.
What should I do after I createGooglePayPaymentMethod ?
0.2.0 or 0.20.0?
sorry it was @stripe/stripe-react-native": "0.20.0",
hi @fallen silo
What problem are you having with this specifically?
You should take a look at the example Google Pay screen in the repository for that version, since our docs are targetting the latest version only: https://github.com/stripe/stripe-react-native/blob/v0.20.0/example/src/screens/GooglePayScreen.tsx
presentApplePay show
const createPaymentMethodApplePay = async () => {
const { error, paymentMethod } = await presentApplePay(
{
cartItems: [
{ label: 'Subtotal', amount: '12.75', paymentType: 'Immediate' },
{ label: 'Shipping', amount: '0.00', paymentType: 'Immediate'},
{ label: 'Total', amount: '12.75', paymentType: 'Immediate'},
],
country: 'US',
currency: 'USD',
requiredShippingAddressFields: [
'emailAddress',
'phoneNumber',
'postalAddress',
'name',
],
requiredBillingContactFields: ['phoneNumber', 'name'],
jcbEnabled: true,
}
)
console.log(error, paymentMethod)
}
Can i ask what is the use of createPaymentMethod? I dont know how the payment flow of stripe work. I asked that at the previous thread.
You'd use the payment method create variants if you wanted to collect the payment details to charge later, for example, or confirm on your server, instead of confirming a payment right away
how that process would happend @red delta . I want how the how the case confirm at the server and how they notify the client, can I apply this use case when user click purchase?
👋
Yes if you want to confirm server-side then you create the PaymentMethod client side and pass that to your server to confirm.
so where is the part that show google pay UI or apple pay UI ?
You need to give me more info for me to help. I can't really help you if you just drop a bunch of code. What are you asking here?
I just want to know how I intergrate the sdk with google pay and apply that's it. What I was trying to understand is the payment flow
That's why I asked about the usage of createPaymentMethod. even with synthrider explaination I still couldn't understand how the user actualy buy something when createGooglePayPaymentMethod just doesnt show up the amount that user need to pay,...
I don't recall if you can pass amount to your GooglePayButton as a prop or not... typically the amount is dictated by the PaymentIntent as you pass the clientSecret to presentGooglePay()
But the two options are to either use presentGooglePay() or createGooglePayPaymentMethod() on click of the GooglePayButton
That is what actually presents the modal to collect the PaymentMethod
If you use presentGooglePay() then the PaymentIntent is confirmed upon the modal being completed
If you use createGooglePayPaymentMethod() then a PaymentMehtod ID is returned to you which you can pass to your backend to confirm a PaymentIntent there.
All of this should also hold true for Apple Pay.
in which cases I should confirm payment at server over the client?
Up to you really
The recommendation is just to confirm on the client.
But some use-cases want more control and thus they confirm on the server.
So basicallyI need to send the amount and items user want to buy to server so they can create a payment intent they return the clientSecret which will pass over the presentGooglePay. It automatically shows the amount right
Yep
@fallen silo do you have any idea why this happended?
No can't say, sorry.
You would need to add logs throughout to figure out where the crash is occurring.
That seems to be some sort of local environment issue in that case.
I can't tell you what would be causing that from a generic crash message.
What about the payment sheet, this also contains google pay and apple pay right?
Can I show only google pay or apple pay option with the payment sheet
Yes
cool then when I need to use payment sheet over present native methods ?
Mostly just depends on whether you want to have one pay button or have Google Pay and Apple Pay as separate pay buttons from your Payment Sheet pay button.