question

sykhira avatar image
sykhira asked thedangler commented

Payment response after card payment

When using a card to make payment with ACTION_SECURE_PAY intent, the payment object that is returned by data.getParcelableExtra(Intents.EXTRA_PAYMENT) does include a token field but it is always empty.

Is there a way to obtain the token to be used in subsequent payments for developer pay api after making a successful payment?

I also tried ACTION_SECURE_CARD_DATA intent and fetched the response after card swipe with data.getParcelableExtra(Intents.EXTRA_CARD_DATA). I saw uniqueToken field there but this cannot be used for developer pay.

What is the correct approach to obtain the token or cardEncrypted object that could be used for subsequent payments using the developer pay api that includes fetching this token after successful payment after card swipe?
Payments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sam avatar image
sam Deactivated answered sam Deactivated edited
The merchant will need to support vaulted cards. The tokenType must be non-0001, which can be found here: GET /v3/merchants/{mid}/gateway

Using ACTION_SECURE_PAY, you'll receive vaultedCard as part of the payload.
if (requestCode == REQUEST_PAY) {
   if (resultCode == RESULT_OK) {
        Payment pay = data.getExtras().getParcelable(Intents.EXTRA_PAYMENT);
        VaultedCard vc = pay.getCardTransaction().getVaultedCard();
which will return:

VaultedCard{json='{"cardholderName":"JOHN SMITH","first6":"551122","expirationDate":"1219","last4":"1111","token":"11111111111111"}', bundle=null, changeLog=null}

which can then be used for future payments using /pay api.

Your merchant processing gateway will need to be pointed to something other than "Blackhole"

At the moment, activating vaultedCard is done manually, merchant by merchant and will require an un-insignificant amount of additional work: please contact us at dev@clover.com if interested. Please expect an appropriate extended timeline for completion.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sykhira avatar image sykhira commented ·

@Sam thanks for the response! Our tokenType is 1174 and still the vaultedCard object is null in the payload. Tried with test card received with devkit. Any idea?

0 Likes 0 ·
sykhira avatar image
sykhira answered sykhira commented
@Sam for sake of completeness to this answer, I managed to receive the token now that gateway is not pointing to BLACKHOLE. However when using the token from
pay.getCardTransaction().getVaultedCard(),getToken()
for /pay api I'm getting:
`"7297162975886668 not found for merchant: 460"`
It is interesting that /pay api works if I use the token which can be obtained via web api (when encrypting the card and making the initial payment with `cardEncrypted`).
I also noticed that
`pay.getCardTransaction().getToken()`
and
pay.getCardTransaction().getVaultedCard().getToken()
give the same result...
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sam avatar image sam commented ·

Instead of just the token, you should be passing in the entire vaultedCard object as an argument using v2/pay.

vaultedCard = {"first6":"000000","last4":"0000","expirationDate":"1230","token":"00000000000000"}

post_data = { "vaultedCard": vaultedCard, "orderId": orderID, "streetAddress": streetAddress, "zip": zip, "currency": "usd", "amount": amount, "tipAmount": tipAmount, "taxAmount": taxAmount, "expMonth": expMonth, "cvv": CVV, "expYear": expYear, "last4": cardNumber[-4:], "first6": cardNumber[0:6] }

0 Likes 0 ·
sykhira avatar image sykhira sam commented ·

Yup, you are right again :) I must have misunderstood the docs there.

0 Likes 0 ·
sykhira avatar image
sykhira answered sam Deactivated commented
@Sam do you know what does "RE0244 - OrderNum is missing" error refer to? The v2/pay endpoint was working fine until recently and now we are getting this error when using vaultedCard.
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sam avatar image sam commented ·

@sykhira

Thanks for bringing this to our attention. This should only be affecting sandbox environment. I'll update you on our progress as we handle this issue.

0 Likes 0 ·
intooapps avatar image
intooapps answered thedangler commented
Can I use vaultedCard on sandBox environment?
2 comments
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

chanel avatar image chanel commented ·

Hi @intooapps, please either search these forums for a similar question or post a new question if none of the answers are what you're looking for.

0 Likes 0 ·
thedangler avatar image thedangler commented ·

@intooapps Did you find out an answer to this? I've been looking in the forum with no success.

0 Likes 0 ·

Welcome to the
Clover Developer Community