Before you start #
On the Plugin settings page, make sure you’ve entered your Merchant UUID and API Key – these can be found on the Settings page in Barracks. You’ll also need to enter your Endpoint – see the Setup page for information.
Collect Data #
You will need to collect:
- Transaction ID of the original transaction
- Transaction Reference ID – OPTIONAL
- Hash – we’ll cover how to generate this below
- Transaction Amount of the original transaction
- Transaction Currency of the original transaction
- Refund Amount
We recommend storing the expiry month and year in a Thing directly from the input fields when parsing the response, as they are not passed back by Merchant Warrior. This will help with managing expiring cards.
Create a Workflow #
Create a Workflow, and add the “MW – Token Payments: Process Card” action from the “Plugins” tab of the Actions list.
Each parameter in the action settings matches a parameter in the Merchant Warrior documentation.
transactionID #
The transactionID returned for the initial transaction.
Example: 1-a1c340c8-7c30-11de-8888-000c29753ad4
transactionReferenceID #
This is a merchant’s unique reference ID for a transaction sent to Merchant Warrior. The main purpose of this ID is to verify the transaction via the Query Card method in the event a valid response is not received.
Example: A257240023321
Valid length: Up to 40 characters
hash #
transactionAmount #
This amount must be the exact amount submitted with the initial transaction. This is used in the verification hash, and is not the amount that will be refunded.
Example: 10.00
transactionCurrency #
One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependent. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive.
Example: AUD
refundAmount #
The amount is in the same format as transactionAmount. It cannot be less than 0.01 or more than the initial transaction amount.
Example: 10.00
Parse Response #
The response will contain:
responseCode #
Code | Meaning |
---|---|
< 0 | MW validation error |
0 | Transaction/Operation was successful |
> 0 | Transaction/Operation was declined or delayed by the provider or service |
responseMessage #
If the responseCode is not 0, this will provide basic insight into the reason for failure.
transactionID #
Long-form string with the ID of the overall transaction.
authCode #
6-digit authorisation code
receiptNo #
Receipt number for the payment
authMessage #
Response to refund request, eg. “Approved”
authResponseCode #
Authorisation response code as per Merchant Warrior’s documentation. Anything other than 0 is a fail.
authSettledDate #
The date this refund will settle out of your bank account to Merchant Warrior.
transactionReferenceID #
As entered in this transaction.
custom1/2/3 #
As entered in the original transaction.
customHash #
Custom Hash as generated by Merchant Warrior.
paymentCardNumber #
Sanitised card number, eg. 411111XXXXXX1111 – useful for receipts.
refundAmount #
The same amount/format posted in this request.
feeAmount #
The applicable Merchant Warrior fee for this transaction.
cardType #
The type of card used, rendered in lowercase. eg. visa
cardExpiryMonth #
2-digit expiry month.
cardExpiryYear #
2-digit expiry year.
Next Actions #
We recommend adding a step with an “only when” of “…’s authResponseCode is not 0” that deals with the error. Otherwise, passing the variables you need to a Thing and/or to an Element, would be the logical next step.