googlesamples / google-services

A collection of quickstart samples demonstrating the Google APIs for Android and iOS
https://developers.google.com
Apache License 2.0
3.05k stars 2.53k forks source link

GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION #571

Open abhinax4991 opened 1 year ago

abhinax4991 commented 1 year ago

Step 1: Are you in the right place?

Step 2: Describe your environment

Step 3: Describe the problem:

I am using an sdk that initiates a google pay payment sdk : "com.judopay:judokit-android:4.0.0". I am trying to open the activity for google pay payments however on the ui i see , Developer Error Exception , and in my logcat i see . [GoogleAccountDataServiceImpl] getToken() -> BAD_AUTHENTICATION. App: com.google.android.gms, Service: oauth2:https://www.googleapis.com/auth/cclog zpc: Long live credential not available.

Steps to reproduce:

  1. follow the setps in https://docs.judopay.com/Content/Mobile/Android.htm , create a google pay widget
  2. try to run the app

Observed Results:

Relevant Code:

val message: String = args.getString(0) val amount = Amount.Builder() .setAmount("150.50") .setCurrency(Currency.GBP) .build()

  val reference = Reference.Builder()
      .setConsumerReference("test-123")
      .build()

  val authorization = PaymentSessionAuthorization.Builder()
      .setPaymentSession("teset123")
      .setApiToken("123")
      .build()

    var billingAddressParams = GooglePayBillingAddressParameters(
        format = GooglePayAddressFormat.MIN,
        phoneNumberRequired = true
    )

    var shippingAddressParams = GooglePayShippingAddressParameters(
        phoneNumberRequired = true
    )

    var googlePayConfiguration = GooglePayConfiguration.Builder()
        .setTransactionCountryCode("IND")
        .setEnvironment(GooglePayEnvironment.TEST)
        .setIsEmailRequired(true)
        .setIsBillingAddressRequired(true)
        .setBillingAddressParameters(billingAddressParams)
        .setIsShippingAddressRequired(true)
        .setShippingAddressParameters(shippingAddressParams)
        .build()

  val builder = Judo.Builder(PaymentWidgetType.PRE_AUTH_GOOGLE_PAY)
      .setAuthorization(authorization)
      .setJudoId("100444405")
      .setAmount(amount)
      .setReference(reference)
      .setIsSandboxed(true)
      .setGooglePayConfiguration(googlePayConfiguration)
      .build()

    val intent = Intent(cordova.context, JudoActivity::class.java);
    intent.putExtra(JUDO_OPTIONS, builder);
    cordova.activity.startActivity(intent)
  // TODO(you): code here to reproduce the problem