imad ahddad
imad ahddad

Reputation: 11

TapAndPay sdk shows error message "Something went wrong, invalid argument"

I am using Visa In-App Provisioning to obtain some test card info and OPC (Opaque Payment Card) for Google Pay (Sandbox data).

I then encode retrieved OPC to Base64 and pass it with card info in PushTokenizeRequest object to tapAndPayClient.pushTokenize().

However, when running the app on Android and after confirming the address in Google Pay, I encounter an error message: "Something went wrong. Invalid argument."

The OPC object I receive is as follows :

{
    "paymentAccountReference": "V1234567890124514231274459132",
    "last4": "9132",
    "expirationDate": {"month": "12", "year": "2030"},
    "encAddress": "eyJraWQiOiJiNTFkZmEyMyIsImVuYy.....",
    "opaquePaymentCard": "eyJhdWQiOiIxODk5NzZhNi0yZm......",
    "vCardID": "v-123-c1a347c1-bd85-43e3-88c2-a8070f4d1901"
}

I encode OPC to Base64 using the following code: String encodedResponseBody = Base64.getEncoder().encodeToString(responseBody.getBytes());

any help would be greatly appreciated.

Upvotes: 1

Views: 211

Answers (1)

t.jancic
t.jancic

Reputation: 190

According to Android Push Provisioning API docs you should send OPC like this:

Base64.encodeToString(responseBody.toByteArray(), Base64.NO_WRAP).toByteArray()

Upvotes: 0

Related Questions