#hungleviet_react-native-digital-wallets

1 messages · Page 1 of 1 (latest)

ivory summitBOT
#

👋 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.

elfin berry
#

hi @red delta can you take a look at my previous thread and help me out #dev-help message

red delta
#

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?

elfin berry
#

my project can not use the lastest version of this SDK, it was incomparable

elfin berry
red delta
#

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?

elfin berry
#

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 ?

red delta
#

0.2.0 or 0.20.0?

elfin berry
#

sorry it was @stripe/stripe-react-native": "0.20.0",

ivory summitBOT
elfin berry
#

hi @fallen silo

red delta
#

What problem are you having with this specifically?

elfin berry
#

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.

red delta
#

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

elfin berry
#

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?

fallen silo
#

👋

#

Yes if you want to confirm server-side then you create the PaymentMethod client side and pass that to your server to confirm.

elfin berry
#

so where is the part that show google pay UI or apple pay UI ?

fallen silo
#

What do you mean by that exactly?

#

Where is the part in the example code?

elfin berry
fallen silo
#

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?

elfin berry
#

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,...

fallen silo
#

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.

elfin berry
#

in which cases I should confirm payment at server over the client?

fallen silo
#

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.

elfin berry
fallen silo
#

Yep

elfin berry
fallen silo
#

No can't say, sorry.

#

You would need to add logs throughout to figure out where the crash is occurring.

elfin berry
#

I also get this error when run example project on the lastest SDK version

fallen silo
#

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.

elfin berry
#

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

fallen silo
#

Yes

ivory summitBOT
elfin berry
#

cool then when I need to use payment sheet over present native methods ?

fallen silo
#

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.