Adyen / adyen-react-native

Adyen React Native
https://docs.adyen.com/checkout
MIT License
44 stars 32 forks source link

Google pay configuration questions #104

Closed arnaudschlupp closed 1 year ago

arnaudschlupp commented 1 year ago

Describe the bug I cannot use google pay after adding this minimal configuration:

const configuration = {
  environment: Configuration.ADYEN_ENVIRONMENT,
  clientKey: Configuration.ADYEN_CLIENT_KEY,
  countryCode: "BE",
  amount: { currency: "EUR", value: 0 },
  card: {
    holderNameRequired: true
  },
  returnUrl: APIPayment.returnUrl,
  googlepay: {
    allowPrepaidCards: false,
    googlePayEnvironment: 1
  }
};

To Reproduce Steps to reproduce the behavior:

  1. Open the drop-in
  2. Click on google pay

Expected behavior I expected to have a google pay specific modal and be able to choose my payment method

Screenshots

Screenshot_20221214-170348

arnaudschlupp commented 1 year ago

Maybe worth mentioning the drop-in works ideally for the other payment methods I have setup (cards, BanContact, and Payconiq)

Also, we wrote a similar bridge, and it looked like this for the Google Pay setup:

 val cardConfiguration: CardConfiguration = CardConfiguration.Builder(Locale.getDefault(), this.environment, this.clientKey)
                .setShowStorePaymentField(false)
                .setHolderNameRequired(true)
                .build()
        val bcmcConfiguration = BcmcConfiguration.Builder(Locale.getDefault(), environment, this.clientKey)
                .build()
        val googlePayConfiguration = GooglePayConfiguration.Builder(Locale.getDefault(), environment, this.clientKey)
                .build()
        val dropInConfiguration: DropInConfiguration = DropInConfiguration.Builder(this.currentActivity!!, RNAdyenService::class.java, this.clientKey)
                .setEnvironment(this.environment)
                .addCardConfiguration(cardConfiguration)
                .addBcmcConfiguration(bcmcConfiguration)
                .addGooglePayConfiguration(googlePayConfiguration)
                .build()

Let me know If you need more information :+1:

descorp commented 1 year ago

Hey @arnaudschlupp

OR_BIBED_07 is usually caused by issues with app signing. Are you testing LIVE transaction on emulator or debug build?

arnaudschlupp commented 1 year ago

Hi @descorp, I was indeed testing on the emulator LIVE transaction 😅! Once deployed on our beta lane, I got a Missing payment method details. though. Do you have a minimal configuration I need to use for google pay to work in production? Thanks a lot!

Screenshot_2022-12-15-09-59-06-92_f5fd52808aaa03cbe3e13b740f2c1b98

descorp commented 1 year ago

Hey @arnaudschlupp

minimal configuration

All necessary information expected to be configured on your Customer Area and as a result - passed to GooglePayComponent via /paymentMethods response. So unless you need any custom configuration - you can skip Google Pay config.

I got a Missing payment method details.

"Missing payment method details" occurs when expected field is missing inside paymentMethod on /payments request body. In case of GooglePay I can only think of googlePayToken..

Were you able to see GooglePay sheet, select payment method e.t.c ? Could you share the body of a request you made to /payments?


Side note: "Android Pay" is unsupported payment method, that cause similar error. Make sure you are selecting "Google Pay" :)


BTW, Not sure if zero amount is permitted for Google Pay. For a "penny test" I would sugets to use 100 minor units(1EUR), since amount should be higher than issuer's transaction fee.

arnaudschlupp commented 1 year ago

I will test that and return it to you; thanks for the help!

arnaudschlupp commented 1 year ago

And everything works well! I was sending a subset of the paymentMethod payload in the didSubmit callback, so I was missing the googlePayToken. So nothing to worry about here! Thanks a lot for the time and help!

Seamus1989 commented 4 months ago

I've just noticed that the amount is removed from the data: PaymentMethodData inside the onSubmit callback. I am re-setting this manually for all payments in the request body

descorp commented 4 months ago

Hey @Seamus1989

What version you are using?

Seamus1989 commented 4 months ago

currently - 1.2.0. We need to update to latest but isn't currently in scope. Has this been fixed in the latest versions?

descorp commented 3 months ago

@Seamus1989

It was never part of PaymentMethodData interface.

amount is passed thought on Android "as is", but requires countryCode on iOS.


This sounds like something we can improve, thanks for feedback ! 💚