10 posts / 0 new
Last post
eddielascu16254
Voiding Token-based purchases

Can Token-based captures be voided? The "Void" tab on the https://developer.payeezy.com/payeezy-api/apis/post/transactions/%7Bid%7D-0 page does not describe the POST's payload for a Token-based transaction. I tried it, nonetheless, and I got a valid "Approved" response. I just want to make sure that this will work in the production environment as well.

After someone answers this question, I have a subsequent question regarding the Transaction Tag field.

Thanks,
Eddie


christopherlord730
Re: Voiding Token-based purchases

You can simply follow the same transaction payload structure for a method 'credit_card' void type transaction. All you need to reference is the transaction_tag, transaction_id (in the URL), amount and currency code. There is no need to include the token information to process a void type transaction.


eddielascu16254
Re: Voiding Token-based purchases

Hi Christopher, thanks for your reply. Actually, I had to include the token information. Without it, I got an error informing me that the token information was missing.
Now over to my second question. Where do I get the "transaction_tag" from? The response for an approved, token-based purchase does not have a "transaction_tag" field? In my test, where I got a successful "approve" for a void request, I put the correlation_id inside the transaction_tag. It worked in your test environment, but I am not sure that is the correct way of handling these fields. Could you clarify?

Thanks,
Eddie


christopherlord730
Re: Voiding Token-based purchases

The transaction_tag is definitely in the response of a Transarmor Token transaction.

{
"correlation_id": "228.0949034111729",
"transaction_status": "approved",
"validation_status": "success",
"transaction_type": "authorize",
"transaction_id": "ET183029",
"transaction_tag": "2226672245",
"method": "token",
"amount": "200",
"currency": "USD",
"cvv2": "I",
"token": {
"token_type": "FDToken",
"token_data": {
"type": "visa",
"cardholder_name": "JohnSmith",
"exp_date": "1030",
"value": "2537446225198291"
}
},
"bank_resp_code": "100",
"bank_message": "Approved",
"gateway_resp_code": "00",
"gateway_message": "Transaction Normal"
}

Just to clarify; best practice is to use the 'credit_card' method to process a void. The transaction_tag is in the response of every successful transaction. This way you have no need to pass any token information and only the required properties to void the transaction. The same is true for refunds.

Request JSON Payload :{"transaction_type":"void","transaction_tag":"2226672245","amount":"200","method":"credit_card","currency_code":"USD"}

The transaction_id (aka authorization number) is submitted in the URL you call and not in the request payload

https://api-cert.payeezy.com/v1/transactions/ET183029


eddielascu16254
Re: Voiding Token-based purchases

Hi Christofer,
Your website has incomplete information and that led to my confusion. If you go to the Token Based Payments page (https://developer.payeezy.com/payeezy-api/apis/post/transactions-4) and you click on the "Response" tab in the right-hand panel called "Resource Summary", the structure of the response does not list the "transaction_tag" as one of the fields returned in the response. However, in all fairness, the field is listed below, where each field is described. I missed that part. Anyway, I added the "transaction_tag" to my Response class and sure enough, I got it back. Now I have it and can use it when I try to void a transaction.

Over to the second part, just so that I get this part straight, what you are suggesting is that the method indicated in the refund and void payload is "credit_card" even when the original purchase transaction was a token-based payment. Is this correct?

Thanks for your excellent explanations and payload example.

Eddie


eddielascu16254
Re: Voiding Token-based purchases

One other thing, Christofer. You are talking about best practices. Is there a document somewhere, on your website, where these best practices are described? If there is, I missed and I would love to read it as it may contain a big deal of useful information for us developers that try to integrate with the Payeezy API.

Thanks,
Eddie


christopherlord730
Re: Voiding Token-based purchases

Unfortunately there isn't any comprehensive resource about how best to handle certain transaction types other than the Docs & Sandbox outlining how payloads can be constructed and tested.

I do see in the Docs & Sandbox that the response payload container/JSON properties do not show transaction_tag but I do see it under the property names just below the JSON example when the response tab is selected. I'll have that reported to our development team about the sample JSON being displayed.


eddielascu16254
Re: Voiding Token-based purchases

Thank you, Chrstopher. Could you just please address my last question in my previous post? Here it is again:

Over to the second part, just so that I get this part straight, what you are suggesting is that the method indicated in the refund and void payload is "credit_card" even when the original purchase transaction was a token-based payment. Is this correct?

TIA,
Eddie


christopherlord730
Re: Voiding Token-based purchases

Hi Eddie,

You are correct; just make sure not to include anything with the token data. Just set the method for credit_card and provide the minimum required properties to void or refund the transaction in question.


eddielascu16254
Re: Voiding Token-based purchases

Hi Christopher,

For the record (and all the other developers that may read this thread), I can confirm that both refunds and voids of token-based purchases work when the request is sent with a method of "credit_card" and no token provided. I have tried that in your Sandbox environment. I hope the Production environment will have the same behavior.

I just want to point out that on your website, the "Capture or Reverse a Payment" page (https://developer.payeezy.com/payeezy-api/apis/post/transactions/%7Bid%7D-0) shows in the Refund tab for FDToken transactions the following example:

{
"merchant_ref": "Astonishing-Sale",
"transaction_type": "refund",
"method": "token",
"amount": "200",
"currency_code": "USD",
"token": {
"token_type": "FDToken",
"token_data": {
"type": "visa",
"value": "2537446225198291",
"cardholder_name": "JohnSmith",
"exp_date": "1030"
}
}

As you can see, the method is indicated as "token" and the "token" field is present. At least on your Sandbox environment, both approaches (with "token" and "credit_card" as the method) work.

Thanks again for taking the time to answer my questions and the excellent clarifications you have made.

Cheers,
Eddie