The following sub-sections will outline the various API methods present in the Merchant Warrior Direct API.
- Endpoints
-
getAccessToken
The getAccessToken method generates a one time access token that can be used with various API methods
-
processCard
The processCard method is the method used to perform a purchase request
-
processAuth
The processAuth method is used to perform a pre-authorization request
-
processCapture
The processCapture method is used to perform a capture request
-
processBatch
The processBatch method enables merchants to securely automate the processing of batch files containing credit card, token transaction data or bank accounts
-
retrieveBatch
The retrieveBatch method is the method used to retrieve the results of a batch file that has been processed via the processBatch method
-
refundCard
The refundCard method is used to perform a refund of an existing purchase or capture transaction
-
queryCard
The queryCard method is used to perform a query of an existing transaction to verify responses or handle timeout scenarios
-
processDDebit
The processDDebit method is used to perform a direct debit request to debit funds from an Australian or New Zealand bank account.
-
processVoid
The processVoid method is used to perform a void on a transaction
-
verifyCard
The verifyCard method is used to perform a zero dollar account verification on a cardholder
-
queryDD
The queryDD method is the method used to perform a query of an existing direct debit transaction
-
queryBIN
The queryBIN method is used to determine the banking information (Bank Name, Card Type, Card Country etc) related to a credit/debit card's Bank Identification Number
-
getSettlement
The getSettlement method will return a compressed Zip archive that contains a CSV file with a list of transactions that have settled between the dates specified in the request
-
checkEnrollment
The checkEnrollment method is the method used to initiate a 3DS authentication
-
checkPARes
The checkPARes method is the method used to verify a 3DS result
-
addBlacklistedCard
The addBlacklistedCard method is used to add a card into the merchant blacklist
-
removeBlacklistedCard
The removeBlacklistedCard method is used to remove a card out of the merchant blacklist
-
queryBlacklistedCard
The queryBlacklistedCard method is used to query a card info in the merchant black list
-
simulateNotify
Test your sandbox Notify URLs for Chargebacks, EFT, and BPay
Sandbox
POST
https://base.merchantwarrior.com/post/
Copy
Production
POST
https://api.merchantwarrior.com/post/
Copy
The getAccessToken method generates a one time access token that can be used with various API methods
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
Optional Parameters
Parameter | Description |
---|---|
transactionAmount | The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected. |
transactionCurrency | One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive. |
notifyURL | Asynchronous POST notifications will be sent to this URL. |
Conditional Parameters
Parameter | Description |
---|---|
urlHash | The urlHash field is a combination of your API Passphrase, Merchant UUID and notifyURL. See Web URL Hash for information on how to construct the hash correctly. |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly. |
curl --location --request POST 'https://api.merchantwarrior.com/post/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'method=getAccessToken' \
--data-urlencode 'merchantUUID=4fce073f145a7' \
--data-urlencode 'apiKey=ou8xigxw' \
--data-urlencode 'transactionAmount=1.00' \
--data-urlencode 'transactionCurrency=AUD' \
--data-urlencode 'notifyURL=https://yourdomain.com/notify' \
--data-urlencode 'urlHash=fd19f24f1ee2d2fdb6ee5c4e8668f659' \
--data-urlencode 'hash=8caaaf6691331f8637f1a24c1b720481'
curl --location --request POST 'https://api.merchantwarrior.com/post/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'method=getAccessToken' \
--data-urlencode 'merchantUUID=4fce073f145a7' \
--data-urlencode 'apiKey=ou8xigxw' \
--data-urlencode 'transactionAmount=1.00' \
--data-urlencode 'transactionCurrency=AUD' \
--data-urlencode 'notifyURL=https://yourdomain.com/notify' \
--data-urlencode 'urlHash=fd19f24f1ee2d2fdb6ee5c4e8668f659' \
--data-urlencode 'hash=8caaaf6691331f8637f1a24c1b720481'No sample available
No sample availableNo sample available
No sample availableNo sample available
No sample availableNo sample available
No sample availableNo sample available
No sample availableNo sample available
No sample available<?xml version="1.0"?>
<mwResponse>
<responseCode>0</responseCode>
<responseMessage>Operation successful</responseMessage>
<token>51acb2b7b7</token>
</mwResponse>
{
"responseCode": 0,
"responseMessage": "Operation successful",
"token": "51acb2b7b7"
}
{
"responseCode": 0,
"responseMessage": "Operation successful",
"token": "51acb2b7b7"
}
The processCard method is the method used to perform a purchase request
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionAmount | The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected. |
transactionCurrency | One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive. |
transactionProduct | A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes. |
customerName | This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters. |
customerCountry | Two letter ISO 3166-1 alpha-2 country code. |
customerState | Freeform field, keep consistent for your records and reporting. |
customerCity | Freeform field, keep consistent for your records and reporting. |
customerAddress | Freeform field. |
customerPostCode | This can also accomodate ZIP/Post codes for international transactions. |
paymentCardNumber | Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678). |
paymentCardExpiry | This must be MMYY format. The month must be zero padded if it is less than 10. |
paymentCardName | This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed. |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
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 queryCard method in the event a valid response is not received. |
threeDSToken | This parameter is used to indicate if a transaction has been authenticated. Its value is returned by checkPARes method. |
recurringFlag | This parameter is used to indicate if a transaction will be marked as recurring. Its value must be 0 or 1. |
mwApplePayToken | This parameter is used to process an Apple Pay transaction. Its value is returned by decryptApplePayToken method. |
customerPhone | Anything other than +,-, space and 0-9 will be stripped. |
customerEmail | Must be valid if present. Sending this optional parameter is highly recommended. |
customerIP | Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended. |
storeID | The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter. |
paymentCardCSC | This is also known as the CVN or CVV/2. This is required by some Acquirers if the transaction is initiated by the customer. Please contact Merchant Warrior for more information. |
custom1 | Freeform field. Returned as |
custom2 | Freeform field. Returned as |
custom3 | Freeform field. Returned as |
addCard | This parameter is used to indicate if you want a cardID (see Token Payments) returned after a successful transaction. Its value must be 0 or 1. |
surcharge | Calculate the surcharge for the transaction and add it to the total amount charged to the card. This feature allows the merchant to receive the full amount in their settlement. |
settlementDate | Specify when the settlement of the transaction should take place, by specifying the date settlement should take place.
Example: 2023-08-11 |
settlementPeriod | Specify when the settlement of the transaction should take place, by specifying how many days to wait until settlement.
Example: 15 |
curl -X POST \
-d method="processCard" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionAmount="1.00" \
-d transactionCurrency="AUD" \
-d transactionProduct="Test Product" \
-d customerName="Test Customer" \
-d customerCountry="AU" \
-d customerState="QLD" \
-d customerCity="Brisbane" \
-d customerAddress="123 Test Street" \
-d customerPostCode="4000" \
-d customerPhone="61731665489" \
-d customerEmail="[email protected]" \
-d customerIP="1.1.1.1" \
-d paymentCardName="Test Customer" \
-d paymentCardNumber="5123456789012346" \
-d paymentCardExpiry="0521" \
-d paymentCardCSC="123" \
-d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
curl -X POST -d method="processCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionAmount="1.00" -d transactionCurrency="AUD" -d transactionProduct="Test Product" -d customerName="Test Customer" -d customerCountry="AU" -d customerState="QLD" -d customerCity="Brisbane" -d customerAddress="123 Test Street" -d customerPostCode="4000" -d customerPhone="61731665489" -d customerEmail="[email protected]" -d customerIP="1.1.1.1" -d paymentCardName="Test Customer" -d paymentCardNumber="5123456789012346" -d paymentCardExpiry="0521" -d paymentCardCSC="123" -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method': 'processCard',
'merchantUUID': '5265f8eed6a19',
'apiKey': 'ksmnwxab',
'transactionAmount': '1.00',
'transactionCurrency': 'AUD',
'transactionProduct': 'Test Product',
'customerName': 'Test Customer',
'customerCountry': 'AU',
'customerState': 'QLD',
'customerCity': 'Brisbane',
'customerAddress': '123 Test Street',
'customerPostCode': '4000',
'customerPhone': '61731665489',
'customerEmail': '[email protected]',
'customerIP': '1.1.1.1',
'paymentCardName': 'Test Customer',
'paymentCardNumber': '5123456789012346',
'paymentCardExpiry': '0521',
'paymentCardCSC': '123',
'hash': 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method': 'processCard',
'merchantUUID': '5265f8eed6a19',
'apiKey': 'ksmnwxab',
'transactionAmount': '1.00',
'transactionCurrency': 'AUD',
'transactionProduct': 'Test Product',
'customerName': 'Test Customer',
'customerCountry': 'AU',
'customerState': 'QLD',
'customerCity': 'Brisbane',
'customerAddress': '123 Test Street',
'customerPostCode': '4000',
'customerPhone': '61731665489',
'customerEmail': '[email protected]',
'customerIP': '1.1.1.1',
'paymentCardName': 'Test Customer',
'paymentCardNumber': '5123456789012346',
'paymentCardExpiry': '0521',
'paymentCardCSC': '123',
'hash': 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'processCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'processCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerName", "Test Customer" },
{ "customerCountry", "AU" },
{ "customerState", "QLD" },
{ "customerCity", "Brisbane" },
{ "customerAddress", "123 Test Street" },
{ "customerPostCode", "4000" },
{ "customerPhone", "61731665489" },
{ "customerEmail", "[email protected]" },
{ "customerIP", "1.1.1.1" },
{ "paymentCardName", "Test Customer" },
{ "paymentCardNumber", "5123456789012346" },
{ "paymentCardExpiry", "0521" },
{ "paymentCardCSC", "123" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerName", "Test Customer" },
{ "customerCountry", "AU" },
{ "customerState", "QLD" },
{ "customerCity", "Brisbane" },
{ "customerAddress", "123 Test Street" },
{ "customerPostCode", "4000" },
{ "customerPhone", "61731665489" },
{ "customerEmail", "[email protected]" },
{ "customerIP", "1.1.1.1" },
{ "paymentCardName", "Test Customer" },
{ "paymentCardNumber", "5123456789012346" },
{ "paymentCardExpiry", "0521" },
{ "paymentCardCSC", "123" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerName", "Test Customer"}, _
{"customerCountry", "AU"}, _
{"customerState", "QLD"}, _
{"customerCity", "Brisbane"}, _
{"customerAddress", "123 Test Street"}, _
{"customerPostCode", "4000"}, _
{"customerPhone", "61731665489"}, _
{"customerEmail", "[email protected]"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentCardName", "Test Customer"}, _
{"paymentCardNumber", "5123456789012346"}, _
{"paymentCardExpiry", "0521"}, _
{"paymentCardCSC", "123"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerName", "Test Customer"}, _
{"customerCountry", "AU"}, _
{"customerState", "QLD"}, _
{"customerCity", "Brisbane"}, _
{"customerAddress", "123 Test Street"}, _
{"customerPostCode", "4000"}, _
{"customerPhone", "61731665489"}, _
{"customerEmail", "[email protected]"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentCardName", "Test Customer"}, _
{"paymentCardNumber", "5123456789012346"}, _
{"paymentCardExpiry", "0521"}, _
{"paymentCardCSC", "123"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "processCard");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionAmount", "1.00");
params.put("transactionCurrency", "AUD");
params.put("transactionProduct", "TestProduct");
params.put("customerName", "TestCustomer");
params.put("customerCountry", "AU");
params.put("customerState", "QLD");
params.put("customerCity", "Brisbane");
params.put("customerAddress", "TestStreet");
params.put("customerPostCode", "4000");
params.put("customerPhone", "61731665489");
params.put("customerEmail", "[email protected]");
params.put("customerIP", "1.1.1.1");
params.put("paymentCardName", "TestCard");
params.put("paymentCardNumber", "5123456789012346");
params.put("paymentCardExpiry", "0521");
params.put("paymentCardCSC", "123");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<custom1/>
<cardExpiryYear>21</cardExpiryYear>
<custom2/>
<custom3/>
<responseMessage>Transaction approved</responseMessage>
<transactionReferenceID>12345</transactionReferenceID>
<cardType>mc</cardType>
<responseCode>0</responseCode>
<authCode>731357421</authCode>
<transactionAmount>1.00</transactionAmount>
<authResponseCode>08</authResponseCode>
<transactionID>1336-20be3569-b600-11e6-b9c3-005056b209e0</transactionID>
<receiptNo>731357421</receiptNo>
<cardExpiryMonth>05</cardExpiryMonth>
<customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
<authSettledDate>2016-11-29</authSettledDate>
<paymentCardNumber>512345XXXXXX2346</paymentCardNumber>
<authMessage>Honour with identification</authMessage>
</mwResponse>
{
"custom1": [],
"cardExpiryYear": "21",
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"cardType": "mc",
"responseCode": "0",
"authCode": "731357421",
"transactionAmount": "1.00",
"authResponseCode": "08",
"transactionID": "1336-20be3569-b600-11e6-b9c3-005056b209e0",
"receiptNo": "731357421",
"cardExpiryMonth": "05",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"paymentCardNumber": "512345XXXXXX2346",
"authMessage": "Honour with identification"
}
{
"custom1": [],
"cardExpiryYear": "21",
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"cardType": "mc",
"responseCode": "0",
"authCode": "731357421",
"transactionAmount": "1.00",
"authResponseCode": "08",
"transactionID": "1336-20be3569-b600-11e6-b9c3-005056b209e0",
"receiptNo": "731357421",
"cardExpiryMonth": "05",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"paymentCardNumber": "512345XXXXXX2346",
"authMessage": "Honour with identification"
}<?xml version="1.0"?>
<mwResponse>
<custom1/>
<cardExpiryYear>25</cardExpiryYear>
<custom2/>
<custom3/>
<responseMessage>Do Not Honor</responseMessage>
<merchantAdviceMessage>Updated information needed. Check Account Updater if the decline code is 79 or 82. Retry using EMV 3DS if decline code is 83</merchantAdviceMessage>
<transactionReferenceID/>
<cardType>mc</cardType>
<merchantAdviceCode>1</merchantAdviceCode>
<binBankName>COMMONWEALTH BANK OF AUSTRALIA</binBankName>
<responseCode>2</responseCode>
<binCountry>AU</binCountry>
<authCode/>
<transactionAmount>10</transactionAmount>
<authResponseCode>5</authResponseCode>
<transactionID>20270-78f401f8-0a9d-11ee-b4ac-005056b226dc</transactionID>
<receiptNo>95750251</receiptNo>
<binLevel>DEBIT STANDARD</binLevel>
<cardExpiryMonth>2</cardExpiryMonth>
<feeAmount>0.01</feeAmount>
<customHash>7b4bc8803bcd3a082cb1ff98047a4a35</customHash>
<authSettledDate>2023-06-16</authSettledDate>
<paymentCardNumber>521729XXXXXX0968</paymentCardNumber>
<authMessage>Do Not Honor</authMessage>
</mwResponse>
{
"custom1": "",
"cardExpiryYear": 25,
"custom2": "",
"custom3": "",
"responseMessage": "Do Not Honor",
"merchantAdviceMessage": "Updated information needed. Check Account Updater if the decline code is 79 or 82. Retry using EMV 3DS if decline code is 83",
"transactionReferenceID": "",
"cardType": "mc",
"merchantAdviceCode": 1,
"binBankName": "COMMONWEALTH BANK OF AUSTRALIA",
"responseCode": 2,
"binCountry": "AU",
"authCode": "",
"transactionAmount": 10,
"authResponseCode": 5,
"transactionID": "20270-78f401f8-0a9d-11ee-b4ac-005056b226dc",
"receiptNo": 95750251,
"binLevel": "DEBIT STANDARD",
"cardExpiryMonth": 2,
"feeAmount": 0.01,
"customHash": "7b4bc8803bcd3a082cb1ff98047a4a35",
"authSettledDate": "2023-06-16",
"paymentCardNumber": "521729XXXXXX0968",
"authMessage": "Do Not Honor"
}
{
"custom1": "",
"cardExpiryYear": 25,
"custom2": "",
"custom3": "",
"responseMessage": "Do Not Honor",
"merchantAdviceMessage": "Updated information needed. Check Account Updater if the decline code is 79 or 82. Retry using EMV 3DS if decline code is 83",
"transactionReferenceID": "",
"cardType": "mc",
"merchantAdviceCode": 1,
"binBankName": "COMMONWEALTH BANK OF AUSTRALIA",
"responseCode": 2,
"binCountry": "AU",
"authCode": "",
"transactionAmount": 10,
"authResponseCode": 5,
"transactionID": "20270-78f401f8-0a9d-11ee-b4ac-005056b226dc",
"receiptNo": 95750251,
"binLevel": "DEBIT STANDARD",
"cardExpiryMonth": 2,
"feeAmount": 0.01,
"customHash": "7b4bc8803bcd3a082cb1ff98047a4a35",
"authSettledDate": "2023-06-16",
"paymentCardNumber": "521729XXXXXX0968",
"authMessage": "Do Not Honor"
}
The processAuth method is used to perform a pre-authorization request
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionAmount | The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected. |
transactionCurrency | One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive. |
transactionProduct | A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes. |
customerName | This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters. |
customerCountry | Two letter ISO 3166-1 alpha-2 country code. |
customerState | Freeform field, keep consistent for your records and reporting. |
customerCity | Freeform field, keep consistent for your records and reporting. |
customerAddress | Freeform field. |
customerPostCode | This can also accomodate ZIP/Post codes for international transactions. |
paymentCardNumber | Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678). |
paymentCardExpiry | This must be MMYY format. The month must be zero padded if it is less than 10. |
paymentCardName | This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed. |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
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 queryCard method in the event a valid response is not received. |
threeDSToken | This parameter is used to indicate if a transaction has been authenticated. Its value is returned by checkPARes method. |
customerPhone | Anything other than +,-, space and 0-9 will be stripped. |
customerEmail | Sending this optional parameter is highly recommended. |
customerIP | Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended. |
storeID | The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter. |
paymentCardCSC | This is also known as the CVN or CVV/2. This is required by some Acquirers if the transaction is initiated by the customer. Please contact Merchant Warrior for more information. |
custom1 | Freeform field. Returned as |
custom2 | Freeform field. Returned as |
custom3 | Freeform field. Returned as |
addCard | This parameter is used to indicate if you want a cardID (see Token Payments) returned after a successful transaction. Its value must be 0 or 1. |
curl -X POST \
-d method="processAuth" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionAmount="1.00" \
-d transactionCurrency="AUD" \
-d transactionProduct="Test Product" \
-d customerName="Test Customer" \
-d customerCountry="AU" \
-d customerState="QLD" \
-d customerCity="Brisbane" \
-d customerAddress="123 Test Street" \
-d customerPostCode="4000" \
-d customerPhone="61731665489" \
-d customerEmail="[email protected]" \
-d customerIP="1.1.1.1" \
-d paymentCardName="Test Customer" \
-d paymentCardNumber="5123456789012346" \
-d paymentCardExpiry="0521" \
-d paymentCardCSC="123" \
-d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
curl -X POST -d method="processAuth" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionAmount="1.00" -d transactionCurrency="AUD" -d transactionProduct="Test Product" -d customerName="Test Customer" -d customerCountry="AU" -d customerState="QLD" -d customerCity="Brisbane" -d customerAddress="123 Test Street" -d customerPostCode="4000" -d customerPhone="61731665489" -d customerEmail="[email protected]" -d customerIP="1.1.1.1" -d paymentCardName="Test Customer" -d paymentCardNumber="5123456789012346" -d paymentCardExpiry="0521" -d paymentCardCSC="123" -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processAuth',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e214885465d27ea006221'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processAuth',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e214885465d27ea006221'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'processAuth',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionProduct' : 'Test Product',
'customerName' : 'Test Customer',
'customerCountry' : 'AU',
'customerState' : 'QLD',
'customerCity' : 'Brisbane',
'customerAddress' : '123 Test Street',
'customerPostCode' : '4000',
'customerPhone' : '61731665489',
'customerEmail' : '[email protected]',
'customerIP' : '1.1.1.1',
'paymentCardName' : 'Test Customer',
'paymentCardNumber' : '5123456789012346',
'paymentCardExpiry' : '0521',
'paymentCardCSC' : '123',
'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'processAuth',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionProduct' : 'Test Product',
'customerName' : 'Test Customer',
'customerCountry' : 'AU',
'customerState' : 'QLD',
'customerCity' : 'Brisbane',
'customerAddress' : '123 Test Street',
'customerPostCode' : '4000',
'customerPhone' : '61731665489',
'customerEmail' : '[email protected]',
'customerIP' : '1.1.1.1',
'paymentCardName' : 'Test Customer',
'paymentCardNumber' : '5123456789012346',
'paymentCardExpiry' : '0521',
'paymentCardCSC' : '123',
'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'processAuth',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'processAuth',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'paymentCardCSC' => '123',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processAuth" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerName", "Test Customer" },
{ "customerCountry", "AU" },
{ "customerState", "QLD" },
{ "customerCity", "Brisbane" },
{ "customerAddress", "123 Test Street" },
{ "customerPostCode", "4000" },
{ "customerPhone", "61731665489" },
{ "customerEmail", "[email protected]" },
{ "customerIP", "1.1.1.1" },
{ "paymentCardName", "Test Customer" },
{ "paymentCardNumber", "5123456789012346" },
{ "paymentCardExpiry", "0521" },
{ "paymentCardCSC", "123" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processAuth" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerName", "Test Customer" },
{ "customerCountry", "AU" },
{ "customerState", "QLD" },
{ "customerCity", "Brisbane" },
{ "customerAddress", "123 Test Street" },
{ "customerPostCode", "4000" },
{ "customerPhone", "61731665489" },
{ "customerEmail", "[email protected]" },
{ "customerIP", "1.1.1.1" },
{ "paymentCardName", "Test Customer" },
{ "paymentCardNumber", "5123456789012346" },
{ "paymentCardExpiry", "0521" },
{ "paymentCardCSC", "123" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processAuth"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerName", "Test Customer"}, _
{"customerCountry", "AU"}, _
{"customerState", "QLD"}, _
{"customerCity", "Brisbane"}, _
{"customerAddress", "123 Test Street"}, _
{"customerPostCode", "4000"}, _
{"customerPhone", "61731665489"}, _
{"customerEmail", "[email protected]"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentCardName", "Test Customer"}, _
{"paymentCardNumber", "5123456789012346"}, _
{"paymentCardExpiry", "0521"}, _
{"paymentCardCSC", "123"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processAuth"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerName", "Test Customer"}, _
{"customerCountry", "AU"}, _
{"customerState", "QLD"}, _
{"customerCity", "Brisbane"}, _
{"customerAddress", "123 Test Street"}, _
{"customerPostCode", "4000"}, _
{"customerPhone", "61731665489"}, _
{"customerEmail", "[email protected]"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentCardName", "Test Customer"}, _
{"paymentCardNumber", "5123456789012346"}, _
{"paymentCardExpiry", "0521"}, _
{"paymentCardCSC", "123"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "processAuth");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionAmount", "1.00");
params.put("transactionCurrency", "AUD");
params.put("transactionProduct", "TestProduct");
params.put("customerName", "TestCustomer");
params.put("customerCountry", "AU");
params.put("customerState", "QLD");
params.put("customerCity", "Brisbane");
params.put("customerAddress", "TestStreet");
params.put("customerPostCode", "4000");
params.put("customerPhone", "61731665489");
params.put("customerEmail", "[email protected]");
params.put("customerIP", "1.1.1.1");
params.put("paymentCardName", "TestCard");
params.put("paymentCardNumber", "5123456789012346");
params.put("paymentCardExpiry", "0521");
params.put("paymentCardCSC", "123");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
<?xml version="1.0"?>
<mwResponse>
<custom1/>
<cardExpiryYear>21</cardExpiryYear>
<custom2/>
<custom3/>
<responseMessage>Transaction approved</responseMessage>
<transactionReferenceID>12345</transactionReferenceID>
<cardType>mc</cardType>
<responseCode>0</responseCode>
<authCode>731357433</authCode>
<transactionAmount>1.00</transactionAmount>
<authResponseCode>08</authResponseCode>
<transactionID>1336-37edc560-b601-11e6-b9c3-005056b209e0</transactionID>
<receiptNo>731357433</receiptNo>
<cardExpiryMonth>05</cardExpiryMonth>
<customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
<authSettledDate>2016-11-29</authSettledDate>
<paymentCardNumber>512345XXXXXX2346</paymentCardNumber>
<authMessage>Honour with identification</authMessage>
</mwResponse>
{
"custom1": [],
"cardExpiryYear": "21",
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"cardType": "mc",
"responseCode": "0",
"authCode": "731357433",
"transactionAmount": "1.00",
"authResponseCode": "08",
"transactionID": "1336-37edc560-b601-11e6-b9c3-005056b209e0",
"receiptNo": "731357433",
"cardExpiryMonth": "05",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"paymentCardNumber": "512345XXXXXX2346",
"authMessage": "Honour with identification"
}
{
"custom1": [],
"cardExpiryYear": "21",
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"cardType": "mc",
"responseCode": "0",
"authCode": "731357433",
"transactionAmount": "1.00",
"authResponseCode": "08",
"transactionID": "1336-37edc560-b601-11e6-b9c3-005056b209e0",
"receiptNo": "731357433",
"cardExpiryMonth": "05",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"paymentCardNumber": "512345XXXXXX2346",
"authMessage": "Honour with identification"
}
The processCapture method is used to perform a capture request
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
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. |
transactionCurrency | One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive. |
transactionID | The |
captureAmount | The amount is in the same format as transactionAmount. It cannot be less than 0.01 or more than the initial transaction amount. |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
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 queryCard method in the event a valid response is not received. |
curl -X POST \
-d method="processCapture" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionAmount="1.00" \
-d transactionCurrency="AUD" \
-d transactionID="1336-37edc560-b601-11e6-b9c3-005056b209e0"
-d captureAmount="1.00"
-d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
curl -X POST -d method="processCapture" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionAmount="1.00" -d transactionCurrency="AUD" -d transactionID="1336-37edc560-b601-11e6-b9c3-005056b209e0" -d captureAmount="1.00" -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processCapture',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-37edc560-b601-11e6-b9c3-005056b209e0',
'captureAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processCapture',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-37edc560-b601-11e6-b9c3-005056b209e0',
'captureAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'processCapture',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionID' : '1336-37edc560-b601-11e6-b9c3-005056b209e0',
'captureAmount' : '1.00',
'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'processCapture',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionID' : '1336-37edc560-b601-11e6-b9c3-005056b209e0',
'captureAmount' : '1.00',
'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'processCapture',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-37edc560-b601-11e6-b9c3-005056b209e0',
'captureAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'processCapture',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-37edc560-b601-11e6-b9c3-005056b209e0',
'captureAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processCapture" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0" },
{ "captureAmount", "1.00" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processCapture" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0" },
{ "captureAmount", "1.00" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processCapture"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0"}, _
{"captureAmount", "1.00"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processCapture"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0"}, _
{"captureAmount", "1.00"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "processCapture");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionAmount", "1.00");
params.put("transactionCurrency", "AUD");
params.put("transactionID", "1336-37edc560-b601-11e6-b9c3-005056b209e0");
params.put("captureAmount", "1.00");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<custom1/>
<custom2/>
<custom3/>
<responseMessage>Transaction approved</responseMessage>
<responseCode>0</responseCode>
<authCode>731357526</authCode>
<authResponseCode>00</authResponseCode>
<transactionID>1336-fe4d3be6-b604-11e6-b9c3-005056b209e0</transactionID>
<receiptNo>731357526</receiptNo>
<customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
<authSettledDate>2016-11-30</authSettledDate>
<authMessage>Approved or completed successfully</authMessage>
</mwResponse>
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"responseCode": "0",
"authCode": "731357526",
"authResponseCode": "00",
"transactionID": "1336-fe4d3be6-b604-11e6-b9c3-005056b209e0",
"receiptNo": "731357526",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-30",
"authMessage": "Approved or completed successfully"
}
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"responseCode": "0",
"authCode": "731357526",
"authResponseCode": "00",
"transactionID": "1336-fe4d3be6-b604-11e6-b9c3-005056b209e0",
"receiptNo": "731357526",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-30",
"authMessage": "Approved or completed successfully"
}
The processBatch method enables merchants to securely automate the processing of batch files
containing credit card, token transaction data or bank accounts. This method accepts and processes compressed .csv files directly via the Direct API and should be implemented when automating a large number of transactions is a requirement.
The processBatch method will process a batch file and automatically issue a notification via POST to
the merchant’s application when the batch file has completed processing. The batch response file
(containing the results to all transactions processed via the original batch file) can be sent (and
compressed) with the POST notification if requested by the merchant.
Sample process and response batch files can be found here.
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
batchNotifyURL | Asynchronous POST notifications will be sent to this URL. |
batchFile | The batch file must be in CSV format (.csv) and compressed (.zip). |
fileHash | The hash of the batch file. See Batch File Hash for information on how to construct the hash correctly. |
urlHash | The hash of the batchNotifyURL. See Batch URL Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
batchResponseFileAttach | The value is a boolean to denote whether a response file should be attached with the asynchronous POST notifications. |
batchResponseFileCompress | The value is a boolean to denote whether the response file should be compressed (.zip). |
curl -X POST \
-F "method=processBatch" \
-F "merchantUUID=5265f8eed6a19" \
-F "apiKey=ksmnwxab" \
-F "batchNotifyURL=https://www.mydomain.com/notify" \
-F "[email protected]" \
-F "fileHash=eaf937db33027ba345d0d8a788460b81" \
-F "urlHash=f06d19d9d7311cdcdfc37534a7fd0ea4" https://api.merchantwarrior.com/post/
curl -X POST -F "method=processBatch" -F "merchantUUID=5265f8eed6a19" -F "apiKey=ksmnwxab" -F "batchNotifyURL=https://www.mydomain.com/notify" -F "[email protected]" -F "fileHash=eaf937db33027ba345d0d8a788460b81" -F "urlHash=f06d19d9d7311cdcdfc37534a7fd0ea4" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchNotifyURL' => 'https://www.mydomain.com/notify',
'batchFile' => '@Batch.zip',
'fileHash' => 'eaf937db33027ba345d0d8a788460b81',
'urlHash' => 'f06d19d9d7311cdcdfc37534a7fd0ea4'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchNotifyURL' => 'https://www.mydomain.com/notify',
'batchFile' => '@Batch.zip',
'fileHash' => 'eaf937db33027ba345d0d8a788460b81',
'urlHash' => 'f06d19d9d7311cdcdfc37534a7fd0ea4'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'processBatch',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'batchNotifyURL' : 'https://www.mydomain.com/notify',
'batchFile' : '@Batch.zip',
'fileHash' : 'eaf937db33027ba345d0d8a788460b81',
'urlHash' : 'f06d19d9d7311cdcdfc37534a7fd0ea4'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'processBatch',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'batchNotifyURL' : 'https://www.mydomain.com/notify',
'batchFile' : '@Batch.zip',
'fileHash' : 'eaf937db33027ba345d0d8a788460b81',
'urlHash' : 'f06d19d9d7311cdcdfc37534a7fd0ea4'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'processBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchNotifyURL' => 'https://www.mydomain.com/notify',
'batchFile' => '@Batch.zip',
'fileHash' => 'eaf937db33027ba345d0d8a788460b81',
'urlHash' => 'f06d19d9d7311cdcdfc37534a7fd0ea4'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'processBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchNotifyURL' => 'https://www.mydomain.com/notify',
'batchFile' => '@Batch.zip',
'fileHash' => 'eaf937db33027ba345d0d8a788460b81',
'urlHash' => 'f06d19d9d7311cdcdfc37534a7fd0ea4'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processBatch" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "batchNotifyURL", "https://www.mydomain.com/notify" },
{ "batchFile", "@Batch.zip" },
{ "fileHash", "eaf937db33027ba345d0d8a788460b81" },
{ "urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processBatch" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "batchNotifyURL", "https://www.mydomain.com/notify" },
{ "batchFile", "@Batch.zip" },
{ "fileHash", "eaf937db33027ba345d0d8a788460b81" },
{ "urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processBatch"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"batchNotifyURL", "https://www.mydomain.com/notify"}, _
{"batchFile", "@Batch.zip"}, _
{"fileHash", "eaf937db33027ba345d0d8a788460b81"}, _
{"urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processBatch"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"batchNotifyURL", "https://www.mydomain.com/notify"}, _
{"batchFile", "@Batch.zip"}, _
{"fileHash", "eaf937db33027ba345d0d8a788460b81"}, _
{"urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "processBatch");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("batchNotifyURL", "https://www.mydomain.com/notify");
params.put("batchFile", "@Batch.zip");
params.put("fileHash", "eaf937db33027ba345d0d8a788460b81");
params.put("urlHash", "f06d19d9d7311cdcdfc37534a7fd0ea4");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<responseCode>0</responseCode>
<responseMessage>Batch has been successfully submitted.</responseMessage>
<batchUUID>1336583d3a953ce2d</batchUUID>
</mwResponse>
{
"responseCode": "0",
"responseMessage": "Batch has been successfully submitted.",
"batchUUID": "1336583d3a953ce2d"
}
{
"responseCode": "0",
"responseMessage": "Batch has been successfully submitted.",
"batchUUID": "1336583d3a953ce2d"
}
The retrieveBatch method is the method used to retrieve the results of a batch file that has been
processed via the processBatch method (see above). This method returns a .csv or .zip (depending
on whether the merchant requested a compressed response file) file containing the results of all
transactions submitted in the original batch file.
Sample process and response batch files can be found here.
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
batchUUID | |
hash | The hash of the batchUUID. See Batch Response Hash for information on how to construct the hash correctly. |
curl -X POST \
-d method="retrieveBatch" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d batchUUID="1336583d3a953df2d" \
-d hash="fb0e9b2a729d0fda759ui658cb8c2b20" https://api.merchantwarrior.com/post/
curl -X POST -d method="retrieveBatch" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d batchUUID="1336583d3a953df2d" -d hash="fb0e9b2a729d0fda759ui658cb8c2b20" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'retrieveBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchUUID' => '1336583d3a953df2d',
'hash' => 'fb0e9b2a729d0fda759ui658cb8c2b20'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'retrieveBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchUUID' => '1336583d3a953df2d',
'hash' => 'fb0e9b2a729d0fda759ui658cb8c2b20'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'retrieveBatch',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'batchUUID' : '1336583d3a953df2d',
'hash' : 'fb0e9b2a729d0fda759ui658cb8c2b20'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'retrieveBatch',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'batchUUID' : '1336583d3a953df2d',
'hash' : 'fb0e9b2a729d0fda759ui658cb8c2b20'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'retrieveBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchUUID' => '1336583d3a953df2d',
'hash' => 'fb0e9b2a729d0fda759ui658cb8c2b20'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'retrieveBatch',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'batchUUID' => '1336583d3a953df2d',
'hash' => 'fb0e9b2a729d0fda759ui658cb8c2b20'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "retrieveBatch" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "batchUUID", "1336583d3a953df2d" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "retrieveBatch" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "batchUUID", "1336583d3a953df2d" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "retrieveBatch"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"batchUUID", "1336583d3a953df2d"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "retrieveBatch"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"batchUUID", "1336583d3a953df2d"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "retrieveBatch");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("batchUUID", "1336583d3a953df2d");
params.put("hash", "fb0e9b2a729d0fda759ui658cb8c2b20");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map"Transaction ID","Result","Amount","Currency","Created Date","Created Time","Processed Date","Processed Time","Card Name/Card ID","Card Number/Card Key","Custom 1","Custom 2","Custom 3","Store ID","Type","MW Response","Provider Response"
"1336-45a61a65-b60e-11e6-b9c3-005056b209e0","Fail","23.00","AUD","29/11/2016","18:31:49","29/11/2016","18:31:49","Test Customer","5123xxxxxxxx2346","JaYfKnIbVlAx","NyYiVwKwFcUk","VyJvNpVgWgUu","","purchase","Transaction declined","42 - No universal account"
"1336-45e0d356-b60e-11e6-b9c3-005056b209e0","Fail","58.00","AUD","29/11/2016","18:31:49","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","YvMcYhKwPtNo","ReMkHxIsKaFe","WuYiJhWoOuUq","","purchase","Transaction declined","42 - No universal account"
"1336-460cc7af-b60e-11e6-b9c3-005056b209e0","Fail","95.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","WmVaZgVcNmIi","BlVkOnKoMsHo","PtEwVqShSnWp","","purchase","Transaction declined","42 - No universal account"
"1336-463779d5-b60e-11e6-b9c3-005056b209e0","Fail","84.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","WhSkJgUxDaDr","JxMmMrAjUeJp","SpMtMtReQwHo","","purchase","Transaction declined","42 - No universal account"
"1336-465d56ec-b60e-11e6-b9c3-005056b209e0","Fail","36.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","NpAvSjMjShOo","MsIdHfBdBeVx","TkIlCoQjDvCd","","purchase","Transaction declined","42 - No universal account"
"1336-468b285d-b60e-11e6-b9c3-005056b209e0","Fail","76.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","ZsVfXdAtWxGd","ZeChZtSlZxLp","QtKhXnSoTjDv","","purchase","Transaction declined","42 - No universal account"
"1336-46b4bf03-b60e-11e6-b9c3-005056b209e0","Fail","41.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","DbCpNjWsBaSe","XdErQtJkVoUh","AmYdWjSwEmEs","","purchase","Transaction declined","42 - No universal account"
"1336-46e0e0d5-b60e-11e6-b9c3-005056b209e0","Fail","62.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","IsGhDeYnNyJn","BjQsDcBkCpXo","JgMnRxSgMwIe","","purchase","Transaction declined","42 - No universal account"
"1336-470c772d-b60e-11e6-b9c3-005056b209e0","Fail","27.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:52","Test Customer","5123xxxxxxxx2346","NaWuNoUmYmCj","OdCoTdJbLkZp","SfEbKqAxNrRx","","purchase","Transaction declined","42 - No universal account"
"1336-4732f831-b60e-11e6-b9c3-005056b209e0","Fail","6.00","AUD","29/11/2016","18:31:52","29/11/2016","18:31:52","Test Customer","5123xxxxxxxx2346","BmAuNyDtSkYt","PyBvKnTyYpZe","JlAdLmXaBnFc","","purchase","Transaction declined","42 - No universal account"
"Transaction ID","Result","Amount","Currency","Created Date","Created Time","Processed Date","Processed Time","Card Name/Card ID","Card Number/Card Key","Custom 1","Custom 2","Custom 3","Store ID","Type","MW Response","Provider Response"
"1336-45a61a65-b60e-11e6-b9c3-005056b209e0","Fail","23.00","AUD","29/11/2016","18:31:49","29/11/2016","18:31:49","Test Customer","5123xxxxxxxx2346","JaYfKnIbVlAx","NyYiVwKwFcUk","VyJvNpVgWgUu","","purchase","Transaction declined","42 - No universal account"
"1336-45e0d356-b60e-11e6-b9c3-005056b209e0","Fail","58.00","AUD","29/11/2016","18:31:49","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","YvMcYhKwPtNo","ReMkHxIsKaFe","WuYiJhWoOuUq","","purchase","Transaction declined","42 - No universal account"
"1336-460cc7af-b60e-11e6-b9c3-005056b209e0","Fail","95.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","WmVaZgVcNmIi","BlVkOnKoMsHo","PtEwVqShSnWp","","purchase","Transaction declined","42 - No universal account"
"1336-463779d5-b60e-11e6-b9c3-005056b209e0","Fail","84.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","WhSkJgUxDaDr","JxMmMrAjUeJp","SpMtMtReQwHo","","purchase","Transaction declined","42 - No universal account"
"1336-465d56ec-b60e-11e6-b9c3-005056b209e0","Fail","36.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:50","Test Customer","5123xxxxxxxx2346","NpAvSjMjShOo","MsIdHfBdBeVx","TkIlCoQjDvCd","","purchase","Transaction declined","42 - No universal account"
"1336-468b285d-b60e-11e6-b9c3-005056b209e0","Fail","76.00","AUD","29/11/2016","18:31:50","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","ZsVfXdAtWxGd","ZeChZtSlZxLp","QtKhXnSoTjDv","","purchase","Transaction declined","42 - No universal account"
"1336-46b4bf03-b60e-11e6-b9c3-005056b209e0","Fail","41.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","DbCpNjWsBaSe","XdErQtJkVoUh","AmYdWjSwEmEs","","purchase","Transaction declined","42 - No universal account"
"1336-46e0e0d5-b60e-11e6-b9c3-005056b209e0","Fail","62.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:51","Test Customer","5123xxxxxxxx2346","IsGhDeYnNyJn","BjQsDcBkCpXo","JgMnRxSgMwIe","","purchase","Transaction declined","42 - No universal account"
"1336-470c772d-b60e-11e6-b9c3-005056b209e0","Fail","27.00","AUD","29/11/2016","18:31:51","29/11/2016","18:31:52","Test Customer","5123xxxxxxxx2346","NaWuNoUmYmCj","OdCoTdJbLkZp","SfEbKqAxNrRx","","purchase","Transaction declined","42 - No universal account"
"1336-4732f831-b60e-11e6-b9c3-005056b209e0","Fail","6.00","AUD","29/11/2016","18:31:52","29/11/2016","18:31:52","Test Customer","5123xxxxxxxx2346","BmAuNyDtSkYt","PyBvKnTyYpZe","JlAdLmXaBnFc","","purchase","Transaction declined","42 - No universal account"
The refundCard method is used to perform a refund of an existing purchase or capture transaction
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
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. |
transactionCurrency | The currency must match the one submitted with the initial transaction. This is used in the verification hash. |
transactionID | The |
refundAmount | The amount is in the same format as transactionAmount. It cannot be less than 0.01 or more than the initial transaction amount. |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
storeID | The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter. |
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 queryCard method in the event a valid response is not received. |
curl -X POST \
-d method="refundCard" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionAmount="1.00" \
-d transactionCurrency="AUD" \
-d transactionID="1336-20be3569-b600-11e6-b9c3-005056b209f0" \
-d refundAmount="1.00" \
-d hash="b55552ff426d7e3d4635334th7ea0067" https://api.merchantwarrior.com/post/
curl -X POST -d method="refundCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionAmount="1.00" -d transactionCurrency="AUD" -d transactionID="1336-20be3569-b600-11e6-b9c3-005056b209f0" -d refundAmount="1.00" -d hash="b55552ff426d7e3d4635334th7ea0067" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'refundCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056b209f0',
'refundAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'refundCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056b209f0',
'refundAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'refundCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056b209f0',
'refundAmount' : '1.00',
'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'refundCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056b209f0',
'refundAmount' : '1.00',
'hash' : 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'refundCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056b209f0',
'refundAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'refundCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056b209f0',
'refundAmount' => '1.00',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "refundCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0" },
{ "refundAmount", "1.00" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "refundCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0" },
{ "refundAmount", "1.00" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "refundCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0"}, _
{"refundAmount", "1.00"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "refundCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0"}, _
{"refundAmount", "1.00"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "refundCard");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionAmount", "1.00");
params.put("transactionCurrency", "AUD");
params.put("transactionID", "1336-20be3569-b600-11e6-b9c3-005056b209f0");
params.put("refundAmount", "1.00");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<custom1/>
<custom2/>
<custom3/>
<responseMessage>Transaction approved</responseMessage>
<transactionReferenceID>12345</transactionReferenceID>
<responseCode>0</responseCode>
<authCode>731357634</authCode>
<authResponseCode>08</authResponseCode>
<transactionID>1336-1b7762bc-b610-11e6-b9c3-005056b209e0</transactionID>
<receiptNo>731357634</receiptNo>
<customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
<authSettledDate>2016-11-30</authSettledDate>
<authMessage>Honour with identification</authMessage>
</mwResponse>
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"responseCode": "0",
"authCode": "731357634",
"authResponseCode": "08",
"transactionID": "1336-1b7762bc-b610-11e6-b9c3-005056b209e0",
"receiptNo": "731357634",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-30",
"authMessage": "Honour with identification"
}
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"responseCode": "0",
"authCode": "731357634",
"authResponseCode": "08",
"transactionID": "1336-1b7762bc-b610-11e6-b9c3-005056b209e0",
"receiptNo": "731357634",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-30",
"authMessage": "Honour with identification"
}
The queryCard method is used to perform a query of an existing transaction to verify responses or handle timeout scenarios
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionID* | The |
transactionReferenceID* | The |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Query Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
extended | Returns additional information stored with the transaction. This must be in boolean format. |
curl -X POST \
-d method="queryCard" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionID="1336-20be3569-b600-11e6-b9c3-005056e109e0" \
-d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/
curl -X POST -d method="queryCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionID="1336-20be3569-b600-11e6-b9c3-005056e109e0" -d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "queryCard");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionID",
"1336-20be3569-b600-11e6-b9c3-005056e109e0");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Maprequire 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'queryCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'queryCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?> curl -X POST \
-d method="queryCard" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionID="1336-20be3569-b600-11e6-b9c3-005056b209e0" \
-d extended="1" \
-d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/
curl -X POST -d method="queryCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionID="1336-20be3569-b600-11e6-b9c3-005056b209e0" -d extended="1" -d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'extended' => '1',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'extended' => '1',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0" },
{ "extended", "1" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0" },
{ "extended", "1" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0"}, _
{"extended", "1"} _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionID", "1336-20be3569-b600-11e6-b9c3-005056e109e0"}, _
{"extended", "1"} _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "queryCard");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionID",
"1336-20be3569-b600-11e6-b9c3-005056e109e0");
params.put("extended", "1");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Maprequire 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'extended' => '1',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'extended' => '1',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'queryCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'extended' : '1',
'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'queryCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionID' : '1336-20be3569-b600-11e6-b9c3-005056e109e0',
'extended' : '1',
'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?xml version="1.0"?>
<mwResponse>
<custom1/>
<custom2/>
<custom3/>
<responseMessage>Transaction approved</responseMessage>
<refundTotal>1.00</refundTotal>
<responseCode>0</responseCode>
<authCode>731357421</authCode>
<authResponseCode>08</authResponseCode>
<transactionID>1336-20be3569-b600-11e6-b9c3-005056e109e0</transactionID>
<receiptNo>731357421</receiptNo>
<customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
<authSettledDate>2016-11-29</authSettledDate>
<authMessage>Honour with identification</authMessage>
</mwResponse>
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"refundTotal": "1.00",
"responseCode": "0",
"authCode": "731357421",
"authResponseCode": "08",
"transactionID": "1336-20be3569-b600-11e6-b9c3-005056e109e0",
"receiptNo": "731357421",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"authMessage": "Honour with identification"
}
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"refundTotal": "1.00",
"responseCode": "0",
"authCode": "731357421",
"authResponseCode": "08",
"transactionID": "1336-20be3569-b600-11e6-b9c3-005056e109e0",
"receiptNo": "731357421",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"authMessage": "Honour with identification"
}<?xml version="1.0"?>
<mwResponse>
<custom1/>
<custom2/>
<custom3/>
<responseMessage>Transaction approved</responseMessage>
<transactionReferenceID>12345</transactionReferenceID>
<customerCity>Brisbane</customerCity>
<customerName>Test Customer</customerName>
<customerPostcode>4000</customerPostcode>
<refundTotal>1.00</refundTotal>
<responseCode>0</responseCode>
<cardNumberLast>0004</cardNumberLast>
<transactionCurrency>AUD</transactionCurrency>
<customerPhone>61731665489</customerPhone>
<transactionProduct>Test Product</transactionProduct>
<customerState>QLD</customerState>
<authCode>731357421</authCode>
<transactionAmount>1.00</transactionAmount>
<customerAddress>123 Test Street</customerAddress>
<authResponseCode>08</authResponseCode>
<cardNumberFirst>4564</cardNumberFirst>
<customerCountry>AU</customerCountry>
<transactionID>1336-20be3569-b600-11e6-b9c3-005056b209e0</transactionID>
<receiptNo>731357421</receiptNo>
<cardName>Test Customer</cardName>
<customerEmail>[email protected]</customerEmail>
<customHash>65b172551b7d3a0706c0ce5330c98470</customHash>
<authSettledDate>2016-11-29</authSettledDate>
<authMessage>Honour with identification</authMessage>
</mwResponse>
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"customerCity": "Brisbane",
"customerName": "Test Customer",
"customerPostcode": "4000",
"refundTotal": "1.00",
"responseCode": "0",
"cardNumberLast": "0004",
"transactionCurrency": "AUD",
"customerPhone": "61731665489",
"transactionProduct": "Test Product",
"customerState": "QLD",
"authCode": "731357421",
"transactionAmount": "1.00",
"customerAddress": "123 Test Street",
"authResponseCode": "08",
"cardNumberFirst": "4564",
"customerCountry": "AU",
"transactionID": "1336-20be3569-b600-11e6-b9c3-005056b209e0",
"receiptNo": "731357421",
"cardName": "Test Customer",
"customerEmail": "[email protected]",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"authMessage": "Honour with identification"
}
{
"custom1": [],
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": "12345",
"customerCity": "Brisbane",
"customerName": "Test Customer",
"customerPostcode": "4000",
"refundTotal": "1.00",
"responseCode": "0",
"cardNumberLast": "0004",
"transactionCurrency": "AUD",
"customerPhone": "61731665489",
"transactionProduct": "Test Product",
"customerState": "QLD",
"authCode": "731357421",
"transactionAmount": "1.00",
"customerAddress": "123 Test Street",
"authResponseCode": "08",
"cardNumberFirst": "4564",
"customerCountry": "AU",
"transactionID": "1336-20be3569-b600-11e6-b9c3-005056b209e0",
"receiptNo": "731357421",
"cardName": "Test Customer",
"customerEmail": "[email protected]",
"customHash": "65b172551b7d3a0706c0ce5330c98470",
"authSettledDate": "2016-11-29",
"authMessage": "Honour with identification"
}
The processDDebit method is used to perform a direct debit request to debit funds from an Australian or New Zealand bank account.
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionAmount | The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected. |
transactionCurrency | One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive. |
transactionProduct | A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes. |
customerName | This field can only contain alphanumeric characters, as well as the full stop, comma, aposprophe, ampersand, space and hyphen characters. |
customerCountry | Two letter ISO 3166-1 alpha-2 country code. |
customerState | Freeform field, keep consistent for your records and reporting. |
customerCity | Freeform field, keep consistent for your records and reporting. |
customerAddress | Freeform field. |
customerPostCode | This can also accomodate ZIP/Post codes for international transactions. |
paymentAccountBSB | This field must contain 6 digits. |
paymentAccountNumber | This must be a valid account number. |
paymentAccountName | This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed. |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
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 queryCard method in the event a valid response is not received. |
customerPhone | Anything other than +,-, space and 0-9 will be stripped. |
customerEmail | Sending this optional parameter is highly recommended. |
customerIP | Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended. |
storeID | The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter. |
custom1 | Freeform field. Returned as |
custom2 | Freeform field. Returned as |
custom3 | Freeform field. Returned as |
curl -X POST \
-d method="processDDebit" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionAmount="1.00" \
-d transactionCurrency="AUD" \
-d transactionProduct="A1234" \
-d customerName="Test Customer" \
-d customerCountry="AU" \
-d customerState="QLD" \
-d customerCity="Brisbane" \
-d customerAddress="123 Test Street" \
-d customerPostCode="4000" \
-d customerPhone="61731665489" \
-d customerEmail="[email protected]" \
-d customerIP="1.1.1.1" \
-d paymentAccountBSB="014667" \
-d paymentAccountNumber="12345678" \
-d paymentAccountName="Test Customer" \
-d hash="f518187f47bc52fe5a76a18593df72c9" https://api.merchantwarrior.com/post/
curl -X POST -d method="processDDebit" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionAmount="1.00" -d transactionCurrency="AUD" -d transactionProduct="A1234" -d customerName="Test Customer" -d customerCountry="AU" -d customerState="QLD" -d customerCity="Brisbane" -d customerAddress="123 Test Street" -d customerPostCode="4000" -d customerPhone="61731665489" -d customerEmail="[email protected]" -d customerIP="1.1.1.1" -d paymentAccountBSB="014667" -d paymentAccountNumber="12345678" -d paymentAccountName="Test Customer" -d hash="f518187f47bc52fe5a76a18593df72c9" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processDDebit',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'A1234',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentAccountBSB' => '014667',
'paymentAccountNumber' => '12345678',
'paymentAccountName' => 'Test Customer',
'hash' => 'f518187f47bc52fe5a76a18593df72c9'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processDDebit',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'A1234',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentAccountBSB' => '014667',
'paymentAccountNumber' => '12345678',
'paymentAccountName' => 'Test Customer',
'hash' => 'f518187f47bc52fe5a76a18593df72c9'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'processDDebit',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionProduct' : 'A1234',
'customerName' : 'Test Customer',
'customerCountry' : 'AU',
'customerState' : 'QLD',
'customerCity' : 'Brisbane',
'customerAddress' : '123 Test Street',
'customerPostCode' : '4000',
'customerPhone' : '61731665489',
'customerEmail' : '[email protected]',
'customerIP' : '1.1.1.1',
'paymentAccountBSB' : '014667',
'paymentAccountNumber' : '12345678',
'paymentAccountName' : 'Test Customer',
'hash' : 'f518187f47bc52fe5a76a18593df72c9'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'processDDebit',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionAmount' : '1.00',
'transactionCurrency' : 'AUD',
'transactionProduct' : 'A1234',
'customerName' : 'Test Customer',
'customerCountry' : 'AU',
'customerState' : 'QLD',
'customerCity' : 'Brisbane',
'customerAddress' : '123 Test Street',
'customerPostCode' : '4000',
'customerPhone' : '61731665489',
'customerEmail' : '[email protected]',
'customerIP' : '1.1.1.1',
'paymentAccountBSB' : '014667',
'paymentAccountNumber' : '12345678',
'paymentAccountName' : 'Test Customer',
'hash' : 'f518187f47bc52fe5a76a18593df72c9'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'processDDebit',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'A1234',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentAccountBSB' => '014667',
'paymentAccountNumber' => '12345678',
'paymentAccountName' => 'Test Customer',
'hash' => 'f518187f47bc52fe5a76a18593df72c9'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'processDDebit',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'A1234',
'customerName' => 'Test Customer',
'customerCountry' => 'AU',
'customerState' => 'QLD',
'customerCity' => 'Brisbane',
'customerAddress' => '123 Test Street',
'customerPostCode' => '4000',
'customerPhone' => '61731665489',
'customerEmail' => '[email protected]',
'customerIP' => '1.1.1.1',
'paymentAccountBSB' => '014667',
'paymentAccountNumber' => '12345678',
'paymentAccountName' => 'Test Customer',
'hash' => 'f518187f47bc52fe5a76a18593df72c9'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processDDebit" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerName", "Test Customer" },
{ "customerCountry", "AU" },
{ "customerState", "QLD" },
{ "customerCity", "Brisbane" },
{ "customerAddress", "123 Test Street" },
{ "customerPostCode", "4000" },
{ "customerPhone", "61731665489" },
{ "customerEmail", "[email protected]" },
{ "customerIP", "1.1.1.1" },
{ "paymentAccountBSB", "014667" },
{ "paymentAccountNumber", "12345678" },
{ "paymentAccountName", "Test Customer" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processDDebit" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerName", "Test Customer" },
{ "customerCountry", "AU" },
{ "customerState", "QLD" },
{ "customerCity", "Brisbane" },
{ "customerAddress", "123 Test Street" },
{ "customerPostCode", "4000" },
{ "customerPhone", "61731665489" },
{ "customerEmail", "[email protected]" },
{ "customerIP", "1.1.1.1" },
{ "paymentAccountBSB", "014667" },
{ "paymentAccountNumber", "12345678" },
{ "paymentAccountName", "Test Customer" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processDDebit"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerName", "Test Customer"}, _
{"customerCountry", "AU"}, _
{"customerState", "QLD"}, _
{"customerCity", "Brisbane"}, _
{"customerAddress", "123 Test Street"}, _
{"customerPostCode", "4000"}, _
{"customerPhone", "61731665489"}, _
{"customerEmail", "[email protected]"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentAccountBSB", "014667"}, _
{"paymentAccountNumber", "12345678"}, _
{"paymentAccountName", "Test Customer"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processDDebit"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerName", "Test Customer"}, _
{"customerCountry", "AU"}, _
{"customerState", "QLD"}, _
{"customerCity", "Brisbane"}, _
{"customerAddress", "123 Test Street"}, _
{"customerPostCode", "4000"}, _
{"customerPhone", "61731665489"}, _
{"customerEmail", "[email protected]"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentAccountBSB", "014667"}, _
{"paymentAccountNumber", "12345678"}, _
{"paymentAccountName", "Test Customer"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "processDDebit");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionAmount", "1.00");
params.put("transactionCurrency", "AUD");
params.put("transactionProduct", "TestProduct");
params.put("customerName", "TestCustomer");
params.put("customerCountry", "AU");
params.put("customerState", "QLD");
params.put("customerCity", "Brisbane");
params.put("customerAddress", "TestStreet");
params.put("customerPostCode", "4000");
params.put("customerPhone", "61731665489");
params.put("customerEmail", "[email protected]");
params.put("customerIP", "1.1.1.1");
params.put("paymentAccountBSB", "014667");
params.put("paymentAccountNumber", "12345678");
params.put("paymentAccountName", "TestCustomer");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?php
$passphrase = 'YOURPASSPHRASE';
$uploadDir = '/tmp/';
if(!empty($_SERVER['HTTP_MWFILEHASH']) && !empty($_FILES) && !empty($_FILES['file_contents']) && !empty($_FILES['file_contents']['name'])) {
$responseHash = $_SERVER['HTTP_MWFILEHASH'];
$filePath = $_FILES['file_contents']['tmp_name'];
$fileName = $_FILES['file_contents']['name'];
$testHash = md5(strtolower(md5($passphrase).md5_file($filePath)));
if($responseHash == $testHash) {
//fileHash valid
$tmpPath = $_FILES['file_contents']['tmp_name'];
$uploadPath = $uploadDir . $fileName;
if(move_uploaded_file($tmpPath, $uploadPath)) {
//Do something with file
//File retrievable from $uploadPath
}
else {
//file invalid
}
} else {
//fileHash invalid
}
}
exit();
?>
<?xml version="1.0"?>
<mwResponse>
<custom1>1</custom1>
<custom2>2</custom2>
<custom3>3</custom3>
<responseMessage>Transaction pending</responseMessage>
<transactionReferenceID>12345</transactionReferenceID>
<responseCode>10</responseCode>
<settlementDate>2016-12-05</settlementDate>
<transactionID>1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0</transactionID>
<customHash>f696e286657237370aa37cfdd9a8c61c</customHash>
</mwResponse>
{
"custom1": "1",
"custom2": "2",
"custom3": "3",
"responseMessage": "Transaction pending",
"transactionReferenceID": "12345",
"responseCode": "10",
"settlementDate": "2016-12-05",
"transactionID": "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0",
"customHash": "f696e286657237370aa37cfdd9a8c61c"
}
{
"custom1": "1",
"custom2": "2",
"custom3": "3",
"responseMessage": "Transaction pending",
"transactionReferenceID": "12345",
"responseCode": "10",
"settlementDate": "2016-12-05",
"transactionID": "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0",
"customHash": "f696e286657237370aa37cfdd9a8c61c"
}
The processVoid method is used to perform a void on a transaction
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionID* | The |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Void Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
originalTransactionReferenceID | This is a merchant’s unique reference ID for the original transaction sent to Merchant Warrior and can be used in place of the transactionID. |
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 queryCard method in the event a valid response is not received. |
storeID | The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter. |
curl -X POST \
-d method="processVoid" \
-d merchantUUID="513f9b304363a" \
-d apiKey="v7x3vbha" \
-d transactionID="820-093dae7e-d4ae-11eb-8ee7-005056b209e0" \
-d hash="153f148faefa70ec650363e6985982f9" https://api.merchantwarrior.com/post/
curl -X POST -d method="processVoid" -d merchantUUID="513f9b304363a" -d apiKey="v7x3vbha" -d transactionID="820-093dae7e-d4ae-11eb-8ee7-005056b209e0" -d hash="153f148faefa70ec650363e6985982f9" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processVoid',
'merchantUUID' => '513f9b304363a',
'apiKey' => 'v7x3vbha',
'transactionID' => '820-093dae7e-d4ae-11eb-8ee7-005056b209e0',
'hash' => '153f148faefa70ec650363e6985982f9'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'processVoid',
'merchantUUID' => '513f9b304363a',
'apiKey' => 'v7x3vbha',
'transactionID' => '820-093dae7e-d4ae-11eb-8ee7-005056b209e0',
'hash' => '153f148faefa70ec650363e6985982f9'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method': 'processVoid',
'merchantUUID': '513f9b304363a',
'apiKey': 'v7x3vbha',
'transactionID': '820-093dae7e-d4ae-11eb-8ee7-005056b209e0',
'hash': '153f148faefa70ec650363e6985982f9'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method': 'processVoid',
'merchantUUID': '513f9b304363a',
'apiKey': 'v7x3vbha',
'transactionID': '820-093dae7e-d4ae-11eb-8ee7-005056b209e0',
'hash': '153f148faefa70ec650363e6985982f9'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'processVoid',
'merchantUUID' => '513f9b304363a',
'apiKey' => 'v7x3vbha',
'transactionID' => '820-093dae7e-d4ae-11eb-8ee7-005056b209e0',
'hash' => '153f148faefa70ec650363e6985982f9'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'processVoid',
'merchantUUID' => '513f9b304363a',
'apiKey' => 'v7x3vbha',
'transactionID' => '820-093dae7e-d4ae-11eb-8ee7-005056b209e0',
'hash' => '153f148faefa70ec650363e6985982f9'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processVoid" },
{ "merchantUUID", "513f9b304363a" },
{ "apiKey", "v7x3vbha" },
{ "transactionID", "820-093dae7e-d4ae-11eb-8ee7-005056b209e0" },
{ "hash", "153f148faefa70ec650363e6985982f9" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "processVoid" },
{ "merchantUUID", "513f9b304363a" },
{ "apiKey", "v7x3vbha" },
{ "transactionID", "820-093dae7e-d4ae-11eb-8ee7-005056b209e0" },
{ "hash", "153f148faefa70ec650363e6985982f9" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processVoid"}, _
{"merchantUUID", "513f9b304363a"}, _
{"apiKey", "v7x3vbha"}, _
{"transactionID", "820-093dae7e-d4ae-11eb-8ee7-005056b209e0"}, _
{"hash", "153f148faefa70ec650363e6985982f9"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "processVoid"}, _
{"merchantUUID", "513f9b304363a"}, _
{"apiKey", "v7x3vbha"}, _
{"transactionID", "820-093dae7e-d4ae-11eb-8ee7-005056b209e0"}, _
{"hash", "153f148faefa70ec650363e6985982f9"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "processVoid");
params.put("merchantUUID", "513f9b304363a");
params.put("apiKey", "v7x3vbha");
params.put("transactionID", "820-093dae7e-d4ae-11eb-8ee7-005056b209e0");
params.put("hash", "153f148faefa70ec650363e6985982f9");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<custom1/>
<cardExpiryYear>24</cardExpiryYear>
<custom2/>
<custom3/>
<responseMessage>Transaction approved</responseMessage>
<transactionReferenceID/>
<cardType>mc</cardType>
<responseCode>0</responseCode>
<authCode>114552</authCode>
<transactionAmount>1.00</transactionAmount>
<authResponseCode>00</authResponseCode>
<transactionID>820-0f23ce74-d4ae-11eb-8ee7-005056b209e0</transactionID>
<receiptNo>000103929101</receiptNo>
<storeID>store name</storeID>
<cardExpiryMonth>10</cardExpiryMonth>
<feeAmount>0.00</feeAmount>
<customHash>153f148faefa70ec650363e6985982f9</customHash>
<authSettledDate>2021-07-09</authSettledDate>
<paymentCardNumber>545678XXXXXX5670</paymentCardNumber>
<authMessage>Approved or completed successfully</authMessage>
</mwResponse>
{
"custom1": [],
"cardExpiryYear": "24",
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": [],
"cardType": "mc",
"responseCode": "0",
"authCode": "114552",
"transactionAmount": "1.00",
"authResponseCode": "00",
"transactionID": "820-0f23ce74-d4ae-11eb-8ee7-005056b209e0",
"receiptNo": "000103929101",
"storeID": "store name",
"cardExpiryMonth": "10",
"feeAmount": "0.00",
"customHash": "153f148faefa70ec650363e6985982f9",
"authSettledDate": "2021-07-09",
"paymentCardNumber": "545678XXXXXX5670",
"authMessage": "Approved or completed successfully"
}
{
"custom1": [],
"cardExpiryYear": "24",
"custom2": [],
"custom3": [],
"responseMessage": "Transaction approved",
"transactionReferenceID": [],
"cardType": "mc",
"responseCode": "0",
"authCode": "114552",
"transactionAmount": "1.00",
"authResponseCode": "00",
"transactionID": "820-0f23ce74-d4ae-11eb-8ee7-005056b209e0",
"receiptNo": "000103929101",
"storeID": "store name",
"cardExpiryMonth": "10",
"feeAmount": "0.00",
"customHash": "153f148faefa70ec650363e6985982f9",
"authSettledDate": "2021-07-09",
"paymentCardNumber": "545678XXXXXX5670",
"authMessage": "Approved or completed successfully"
}
The verifyCard method is used to perform a zero dollar account verification on a cardholder
Headers
Header | Description |
---|---|
MW-MESSAGEHASH | The verification hash is a combination of your API Passphrase and the body of your request. See MW-MESSAGEHASH form hash if you are not submitting a JSON request or MW-MESSAGEHASH JSON hash for information on how to construct the hash correctly. |
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionCurrency | One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive. |
customerName | This field can only contain alphanumeric characters, as well as the full stop, comma, apostrophe, ampersand, space and hyphen characters. |
customerCountry | Two letter ISO 3166-1 alpha-2 country code. |
customerState | Freeform field, keep consistent for your records and reporting. |
customerCity | Freeform field, keep consistent for your records and reporting. |
customerAddress | Freeform field. |
customerPostCode | This can also accomodate ZIP/Post codes for international transactions. |
paymentCardNumber | Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678). |
paymentCardExpiry | This must be MMYY format. The month must be zero padded if it is less than 10. |
paymentCardName | This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed. |
Optional Parameters
Parameter | Description |
---|---|
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 queryCard method in the event a valid response is not received. |
customerPhone | Anything other than +,-, space and 0-9 will be stripped. |
customerEmail | Must be valid if present. Sending this optional parameter is highly recommended. |
customerIP | Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended. |
storeID | The value of this field is the merchant's store name. Please note that you need to contact Merchant Warrior to enable the storeID feature before you can use this parameter. |
paymentCardCSC | This is also known as the CVN or CVV/2. This is required by some Acquirers if the transaction is initiated by the customer. Please contact Merchant Warrior for more information. |
custom1 | Freeform field. Returned as |
custom2 | Freeform field. Returned as |
custom3 | Freeform field. Returned as |
cardID | A unique alphanumeric string returned by addCard, used to identify a specific card. |
payframeToken | A unique alphanumeric string returned by an MW Payframe that uses the getPayframeToken method. |
payframeKey | A unique alphanumeric string returned by an MW Payframe that uses the getPayframeToken method. |
addCard | This parameter is used to indicate if you want a cardID (see Token Payments) returned after a successful transaction. Its value must be 0 or 1. |
curl --location --request POST 'https://api.merchantwarrior.com/post/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'MW-MESSAGEHASH: 0e4c92cd063726bc545f00af7e03ca07334196b44a6108f452efc087e42da4df' \
--data-urlencode 'method=verifyCard' \
--data-urlencode 'merchantUUID=61a839bf7a9ce' \
--data-urlencode 'apiKey=oybavmhv' \
--data-urlencode 'transactionCurrency=AUD' \
--data-urlencode 'transactionProduct=Test Product' \
--data-urlencode 'paymentCardNumber=5123456789012346' \
--data-urlencode 'paymentCardExpiry=0139' \
--data-urlencode 'paymentCardName=Bob Jones' \
--data-urlencode 'customerCountry=AU' \
--data-urlencode 'customerState=QLD' \
--data-urlencode 'customerPostCode=4000' \
--data-urlencode 'customerCity=Brisbane' \
--data-urlencode 'customerAddress=123 Street' \
--data-urlencode 'paymentCardCSC=123'
curl --location --request POST 'https://api.merchantwarrior.com/post/' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'MW-MESSAGEHASH: 0e4c92cd063726bc545f00af7e03ca07334196b44a6108f452efc087e42da4df' \
--data-urlencode 'method=verifyCard' \
--data-urlencode 'merchantUUID=61a839bf7a9ce' \
--data-urlencode 'apiKey=oybavmhv' \
--data-urlencode 'transactionCurrency=AUD' \
--data-urlencode 'transactionProduct=Test Product' \
--data-urlencode 'paymentCardNumber=5123456789012346' \
--data-urlencode 'paymentCardExpiry=0139' \
--data-urlencode 'paymentCardName=Bob Jones' \
--data-urlencode 'customerCountry=AU' \
--data-urlencode 'customerState=QLD' \
--data-urlencode 'customerPostCode=4000' \
--data-urlencode 'customerCity=Brisbane' \
--data-urlencode 'customerAddress=123 Street' \
--data-urlencode 'paymentCardCSC=123'require "uri"
require "net/http"
url = URI("https://api.merchantwarrior.com/post/")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request["MW-MESSAGEHASH"] = "e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9"
request["Cookie"] = "SERVERID=B; XSRF-TOKEN=eyJpdiI6IjJLa3YrdzNmSGJqcm5XeDdVcmFYM3c9PSIsInZhbHVlIjoiUlRRalNvZVB4aFNrTWNtSFhxODVBY0RIOFdLZDFUSnc0SUpRelwvYUh2SHUwUmJadFhVSGJveFwvUzBEeWVCcThFd3hNM3M5T2RnMllpSFZvVjNJZzJpZz09IiwibWFjIjoiODJkOGE3YjJkMTEyYzcxNWZjZTUyMzE0NmM3ZWU2NzVhMDYwMmFkZGZmZjM4ZGMyYzMxMDkwNjk5OTNmYjQwMiJ9; laravel_session=eyJpdiI6InBGd3NVQ3pOQ2Zjb1YrU2hmdEl4SkE9PSIsInZhbHVlIjoiZjZxbGhYeEpRbjB6MmpDUzRDeTNrMVZTT0dcL204amdQTWlLRW1yT1lwaHIxT0NRYnpxRW9scGpMRDBOREdScXJjazJhcEVUQWxvK2lPZ0ExdWl6UGhRPT0iLCJtYWMiOiJkMjU3YWMxN2JhOWM5NGQ5MzRmM2YzNTc1Mjc3ZTkyODc3YTYyYTBlODIwZDVkMjUwZjllZmVjMWUxZDg4NTcwIn0%3D"
request.body = "method=verifyCard&merchantUUID=61a839bf7a9ce&apiKey=oybavmhv&transactionCurrency=AUD&transactionProduct=Test%20Product&paymentCardNumber=5123456789012346&paymentCardExpiry=0139&paymentCardName=Bob%20Jones&paymentCardCSC=123"
response = https.request(request)
puts response.read_body
require "uri"
require "net/http"
url = URI("https://api.merchantwarrior.com/post/")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/x-www-form-urlencoded"
request["MW-MESSAGEHASH"] = "e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9"
request["Cookie"] = "SERVERID=B; XSRF-TOKEN=eyJpdiI6IjJLa3YrdzNmSGJqcm5XeDdVcmFYM3c9PSIsInZhbHVlIjoiUlRRalNvZVB4aFNrTWNtSFhxODVBY0RIOFdLZDFUSnc0SUpRelwvYUh2SHUwUmJadFhVSGJveFwvUzBEeWVCcThFd3hNM3M5T2RnMllpSFZvVjNJZzJpZz09IiwibWFjIjoiODJkOGE3YjJkMTEyYzcxNWZjZTUyMzE0NmM3ZWU2NzVhMDYwMmFkZGZmZjM4ZGMyYzMxMDkwNjk5OTNmYjQwMiJ9; laravel_session=eyJpdiI6InBGd3NVQ3pOQ2Zjb1YrU2hmdEl4SkE9PSIsInZhbHVlIjoiZjZxbGhYeEpRbjB6MmpDUzRDeTNrMVZTT0dcL204amdQTWlLRW1yT1lwaHIxT0NRYnpxRW9scGpMRDBOREdScXJjazJhcEVUQWxvK2lPZ0ExdWl6UGhRPT0iLCJtYWMiOiJkMjU3YWMxN2JhOWM5NGQ5MzRmM2YzNTc1Mjc3ZTkyODc3YTYyYTBlODIwZDVkMjUwZjllZmVjMWUxZDg4NTcwIn0%3D"
request.body = "method=verifyCard&merchantUUID=61a839bf7a9ce&apiKey=oybavmhv&transactionCurrency=AUD&transactionProduct=Test%20Product&paymentCardNumber=5123456789012346&paymentCardExpiry=0139&paymentCardName=Bob%20Jones&paymentCardCSC=123"
response = https.request(request)
puts response.read_bodyimport requests
url = "https://api.merchantwarrior.com/post/"
payload='method=verifyCard&merchantUUID=61a839bf7a9ce&apiKey=oybavmhv&transactionCurrency=AUD&transactionProduct=Test%20Product&paymentCardNumber=5123456789012346&paymentCardExpiry=0139&paymentCardName=Bob%20Jones&paymentCardCSC=123'
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'MW-MESSAGEHASH': 'e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
import requests
url = "https://api.merchantwarrior.com/post/"
payload='method=verifyCard&merchantUUID=61a839bf7a9ce&apiKey=oybavmhv&transactionCurrency=AUD&transactionProduct=Test%20Product&paymentCardNumber=5123456789012346&paymentCardExpiry=0139&paymentCardName=Bob%20Jones&paymentCardCSC=123'
headers = {
'Content-Type': 'application/x-www-form-urlencoded',
'MW-MESSAGEHASH': 'e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.merchantwarrior.com/post/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'method=verifyCard&merchantUUID=61a839bf7a9ce&apiKey=oybavmhv&transactionCurrency=AUD&transactionProduct=Test%20Product&paymentCardNumber=5123456789012346&paymentCardExpiry=0139&paymentCardName=Bob%20Jones&paymentCardCSC=123',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded',
'MW-MESSAGEHASH: e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
'https://api.merchantwarrior.com/post/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => 'method=verifyCard&merchantUUID=61a839bf7a9ce&apiKey=oybavmhv&transactionCurrency=AUD&transactionProduct=Test%20Product&paymentCardNumber=5123456789012346&paymentCardExpiry=0139&paymentCardName=Bob%20Jones&paymentCardCSC=123',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/x-www-form-urlencoded',
'MW-MESSAGEHASH: e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
var client = new RestClient("https://api.merchantwarrior.com/post/");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeaader("MW-MESSAGEHASH", "e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9");
request.AddParameter("method", "verifyCard");
request.AddParameter("merchantUUID", "61a839bf7a9ce");
request.AddParameter("apiKey", "oybavmhv");
request.AddParameter("transactionCurrency", "AUD");
request.AddParameter("transactionProduct", "Test Product");
request.AddParameter("paymentCardNumber", "5123456789012346");
request.AddParameter("paymentCardExpiry", "0139");
request.AddParameter("paymentCardName", "Bob Jones");
request.AddParameter("paymentCardCSC", "123");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var client = new RestClient("https://api.merchantwarrior.com/post/");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/x-www-form-urlencoded");
request.AddHeaader("MW-MESSAGEHASH", "e34aada763109b8033d0e97c7923c88d642366dc379f8e4487c6895d7819a9d9");
request.AddParameter("method", "verifyCard");
request.AddParameter("merchantUUID", "61a839bf7a9ce");
request.AddParameter("apiKey", "oybavmhv");
request.AddParameter("transactionCurrency", "AUD");
request.AddParameter("transactionProduct", "Test Product");
request.AddParameter("paymentCardNumber", "5123456789012346");
request.AddParameter("paymentCardExpiry", "0139");
request.AddParameter("paymentCardName", "Bob Jones");
request.AddParameter("paymentCardCSC", "123");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);No sample available
No sample availableNo sample available
No sample available<?xml version="1.0"?>
<mwResponse>
<custom1>skipbz9j37</custom1>
<custom2>oppep4eufy</custom2>
<custom3>ujsbsaqw9k</custom3>
<responseMessage>Transaction approved</responseMessage>
<transactionReferenceID/>
<responseCode>0</responseCode>
<authCode>646417</authCode>
<transactionAmount>0.00</transactionAmount>
<authResponseCode>00</authResponseCode>
<transactionID>20066-4373f5cd-b233-11ec-a43d-005056b2764e</transactionID>
<receiptNo>000008646417</receiptNo>
<feeAmount>0.01</feeAmount>
<customHash>72002bcbafe6c96af74c30d2b0be9266</customHash>
<authSettledDate>2022-04-05</authSettledDate>
<paymentCardNumber>512345XXXXXX2346</paymentCardNumber>
<authMessage>Approved</authMessage>
</mwResponse>
{
"custom1": "skipbz9j37",
"custom2": "oppep4eufy",
"custom3": "ujsbsaqw9k",
"responseMessage": "Transaction approved",
"transactionReferenceID": [],
"responseCode": "0",
"authCode": "646417",
"transactionAmount": "0.00",
"authResponseCode": "00",
"transactionID": "20066-4373f5cd-b233-11ec-a43d-005056b2764e",
"receiptNo": "000008646417",
"feeAmount": "0.01",
"customHash": "72002bcbafe6c96af74c30d2b0be9266",
"authSettledDate": "2022-04-05",
"paymentCardNumber": "512345XXXXXX2346",
"authMessage": "Approved"
}
{
"custom1": "skipbz9j37",
"custom2": "oppep4eufy",
"custom3": "ujsbsaqw9k",
"responseMessage": "Transaction approved",
"transactionReferenceID": [],
"responseCode": "0",
"authCode": "646417",
"transactionAmount": "0.00",
"authResponseCode": "00",
"transactionID": "20066-4373f5cd-b233-11ec-a43d-005056b2764e",
"receiptNo": "000008646417",
"feeAmount": "0.01",
"customHash": "72002bcbafe6c96af74c30d2b0be9266",
"authSettledDate": "2022-04-05",
"paymentCardNumber": "512345XXXXXX2346",
"authMessage": "Approved"
}
The queryDD method is the method used to perform a query of an existing direct debit transaction. If you wish to verify the status of a transaction or lost the original response or never receive a response, you can use this method. This method will query the internal MW records and return the available stored data for the transaction.
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionID* | The |
transactionReferenceID* | The |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Query Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
extended | Returns additional information stored with the transaction. This must be in boolean format. |
curl -X POST \
-d method="queryDD" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionID="1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0" \
-d hash="6e3c0ac9fef871a7c43ef5f0e63d6a6b" https://api.merchantwarrior.com/post/
curl -X POST -d method="queryDD" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionID="1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0" -d hash="6e3c0ac9fef871a7c43ef5f0e63d6a6b" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryDD',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
'hash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryDD',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
'hash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'queryDD',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionID' : '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
'hash' : '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'queryDD',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'transactionID' : '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
'hash' : '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'queryDD',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
'hash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'queryDD',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionID' => '1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0',
'hash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryDD" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryDD" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryDD"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryDD"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "queryDD");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionID", "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<responseCode>10</responseCode>
<responseMessage>Transaction pending</responseMessage>
<transactionID>1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0</transactionID>
<settlementDate/>
<custom1/>
<custom2/>
<custom3/>
<customHash>9e71fc2a99a71b722ead746b776b25ac</customHash>
</mwResponse>
{
"responseCode": "10",
"responseMessage": "Transaction pending",
"transactionID": "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0",
"settlementDate": [],
"custom1": [],
"custom2": [],
"custom3": [],
"customHash": "9e71fc2a99a71b722ead746b776b25ac"
}
{
"responseCode": "10",
"responseMessage": "Transaction pending",
"transactionID": "1336-d2b4ccfc-b612-11e6-b9c3-005056b209e0",
"settlementDate": [],
"custom1": [],
"custom2": [],
"custom3": [],
"customHash": "9e71fc2a99a71b722ead746b776b25ac"
}
The queryBIN method is used to determine the banking information (Bank Name, Card Type, Card Country etc) related to a credit/debit card's Bank Identification Number (BIN).
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
binHash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See BIN Hash for information on how to construct the hash correctly. |
Conditional Parameters
Parameter | Description |
---|---|
bin | The six digit BIN of the credit/debit card. Must be included if parmentCardNumber is not. |
paymentCardNumber | The full card number. Must be included if bin is not. |
curl -X POST \
-d method="queryBIN" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d bin="512346" \
-d binHash="6e3c0ac9fef871a7c43ef5f0e63d6a6b" https://api.merchantwarrior.com/post/
curl -X POST -d method="queryBIN" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d bin="512346" -d binHash="6e3c0ac9fef871a7c43ef5f0e63d6a6b" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryBIN',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'bin' => '512346',
'binHash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryBIN',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'bin' => '512346',
'binHash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'queryBIN',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'bin' : '512346',
'binHash' : '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'queryBIN',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'bin' : '512346',
'binHash' : '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'queryBIN',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'bin' => '512346',
'binHash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'bin' => (isset($xml['bin']) ? $xml['bin'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'queryBIN',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'bin' => '512346',
'binHash' => '6e3c0ac9fef871a7c43ef5f0e63d6a6b'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'bin' => (isset($xml['bin']) ? $xml['bin'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryBIN" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "bin", "512346" },
{ "binHash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryBIN" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "bin", "512346" },
{ "binHash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryBIN"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"bin", "512346"}, _
{"binHash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryBIN"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"bin", "512346"}, _
{"binHash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "queryBIN");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("bin", "512346");
params.put("binHash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<rate/>
<recurring_rate/>
<responseMessage>Operation successful</responseMessage>
<bin>456442</bin>
<brand>VISA</brand>
<name>CLASSIC</name>
<responseCode>0</responseCode>
<bank_name>COMMONWEALTH BANK OF AUSTRALIA</bank_name>
<country>AU</country>
<type>CREDIT</type>
</mwResponse>
{
"rate": [],
"recurring_rate": [],
"responseMessage": "Operation successful",
"bin": "456442",
"brand": "VISA",
"name": "CLASSIC",
"responseCode": "0",
"bank_name": "COMMONWEALTH BANK OF AUSTRALIA",
"country": "AU",
"type": "CREDIT"
}
{
"rate": [],
"recurring_rate": [],
"responseMessage": "Operation successful",
"bin": "456442",
"brand": "VISA",
"name": "CLASSIC",
"responseCode": "0",
"bank_name": "COMMONWEALTH BANK OF AUSTRALIA",
"country": "AU",
"type": "CREDIT"
}
The getSettlement method will return a compressed Zip archive that contains a CSV file with a list of transactions that have settled between the dates specified in the request.
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
settlementFrom | The settlement start range date. This parameter cannot be greater than the settlementTo parameter. |
settlementTo | The settlement end range date. The parameter cannot be a future date. The maximum value for this parameter is today's date. |
version | Version of settlement report format required. The latest should be used (1.5), unless you are supporting a legacy integration. Example: 1.5 |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Settlement Type Hash for information on how to construct the hash correctly. |
curl -X POST \
-d method="getSettlement" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d settlementFrom="2017-05-01" \
-d settlementTo="2017-05-02" \
-d version="1.4" \
-d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/
curl -X POST -d method="getSettlement" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d settlementFrom="2017-05-01" -d settlementTo="2017-05-02" -d hash="11b6a860e5bdf0bd91a503b42346ee1d" https://api.merchantwarrior.com/post/using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "getSettlement" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "settlementFrom", "2017-05-01" },
{ "settlementTo", "2017-05-02" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "getSettlement" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "settlementFrom", "2017-05-01" },
{ "settlementTo", "2017-05-02" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "getSettlement"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"settlementFrom", "2017-05-01"},
{"settlementTo", "2017-05-02"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "getSettlement"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"settlementFrom", "2017-05-01"},
{"settlementTo", "2017-05-02"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Moduleimport java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "getSettlement");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("settlementFrom", "2017-05-01");
params.put("settlementTo", "2017-05-02");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Maprequire 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'getSettlement',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'settlementFrom' => '2017-05-01',
'settlementTo' => '2017-05-02',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'getSettlement',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'settlementFrom' => '2017-05-01',
'settlementTo' => '2017-05-02',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'getSettlement',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'settlementFrom' : '2017-05-01',
'settlementTo' : '2017-05-02',
'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'getSettlement',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'settlementFrom' : '2017-05-01',
'settlementTo' : '2017-05-02',
'hash' : '11b6a860e5bdf0bd91a503b42346ee1d'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'getSettlement',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'settlementFrom' => '2017-04-25',
'settlementTo' => '2017-04-30',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);
// Setup CURL defaults
$curl = curl_init();
$tmpFile = '/tmp/settlement.zip';
$tmpZip = fopen($tmpFile, 'w+');
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_FILE, $tmpZip);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
curl_close($curl);
fclose($tmpZip);
// Example of outputting Zip contents
$zip = zip_open($tmpFile);
if ($zip)
{
while ($zip_entry = zip_read($zip))
{
echo "Filename: " . zip_entry_name($zip_entry) . "\n\n";
if (zip_entry_open($zip, $zip_entry))
{
$contents = zip_entry_read($zip_entry);
echo "$contents\n\n";
zip_entry_close($zip_entry);
}
}
zip_close($zip);
// Delete zip file when finished with it
unlink($tmpFile);
}
?>
'getSettlement',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'settlementFrom' => '2017-04-25',
'settlementTo' => '2017-04-30',
'hash' => '11b6a860e5bdf0bd91a503b42346ee1d'
);
// Setup CURL defaults
$curl = curl_init();
$tmpFile = '/tmp/settlement.zip';
$tmpZip = fopen($tmpFile, 'w+');
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_FILE, $tmpZip);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
curl_close($curl);
fclose($tmpZip);
// Example of outputting Zip contents
$zip = zip_open($tmpFile);
if ($zip)
{
while ($zip_entry = zip_read($zip))
{
echo "Filename: " . zip_entry_name($zip_entry) . "\n\n";
if (zip_entry_open($zip, $zip_entry))
{
$contents = zip_entry_read($zip_entry);
echo "$contents\n\n";
zip_entry_close($zip_entry);
}
}
zip_close($zip);
// Delete zip file when finished with it
unlink($tmpFile);
}
?><?xml version="1.0"?>
<mwResponse/>
[]
[]
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
transactionAmount | The amount must be formatted to have two decimal places. Any amounts without two decimal places or amounts less than one cent will be rejected. |
transactionCurrency | One of the following: AUD, CAD, EUR, GBP, JPY, NZD, SGD, USD. This is provider dependant. Please check with MW before attempting to process transactions in any currency other than AUD. This field is case insensitive. |
transactionProduct | A product (or sale) id or description. We recommend using an order/product id. This field’s primary purpose is to help the transaction be identifiable for reporting and accounting purposes. |
paymentCardNumber | Only certain card numbers are deemed valid in the test environment. See Test Data for more information. Do not send separators with the card number (e.g. 1234-5678… or 1234 5678). Optionally, you may elect to use the cardID field (described below) instead of the paymentCard fields if you wish to check the enrollment of a token. |
paymentCardExpiry | This must be MMYY format. The month must be zero padded if it is less than 10. |
paymentCardName | This must contain at the very least a space and no less than two characters. Only alphanumeric characters, hyphens, spaces and full stops are allowed. |
hash | The verification hash is a combination of the MD5 of your API Passphrase, and specific parameters sent in the transaction. See Transaction Type Hash for information on how to construct the hash correctly. |
Optional Parameters
Parameter | Description |
---|---|
customerIP | Any valid IPv4 or IPv6 address is accepted. Sending this optional parameter is highly recommended. |
paymentCardCSC | This is also known as the CVN or CVV/2. This is required by some Acquirers if the transaction is initiated by the customer. Please contact Merchant Warrior for more information. |
cardID | A unique alphanumeric string returned by addCard, used to identify a specific card. This field can be used in place of the paymentCardNumber, paymentCardExpiry and paymentCardName fields. |
curl -X POST \
-d method="checkEnrollment" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d transactionAmount="1.00" \
-d transactionCurrency="AUD" \
-d transactionProduct="Test Product" \
-d customerIP="1.1.1.1" \
-d paymentCardName="Test Customer" \
-d paymentCardNumber="5123456789012346" \
-d paymentCardExpiry="0521" \
-d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
curl -X POST -d method="checkEnrollment" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d transactionAmount="1.00" -d transactionCurrency="AUD" -d transactionProduct="Test Product" -d customerIP="1.1.1.1" -d paymentCardName="Test Customer" -d paymentCardNumber="5123456789012346" -d paymentCardExpiry="0521" -d hash="b55552ff426d7e3d4885465d27ea0062" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'checkEnrollment',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'checkEnrollment',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
import requests
data = {
'method': 'checkEnrollment',
'merchantUUID': '5265f8eed6a19',
'apiKey': 'ksmnwxab',
'transactionAmount': '1.00',
'transactionCurrency': 'AUD',
'transactionProduct': 'Test Product',
'customerIP': '1.1.1.1',
'paymentCardName': 'Test Customer',
'paymentCardNumber': '5123456789012346',
'paymentCardExpiry': '0521',
'hash': 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method': 'checkEnrollment',
'merchantUUID': '5265f8eed6a19',
'apiKey': 'ksmnwxab',
'transactionAmount': '1.00',
'transactionCurrency': 'AUD',
'transactionProduct': 'Test Product',
'customerIP': '1.1.1.1',
'paymentCardName': 'Test Customer',
'paymentCardNumber': '5123456789012346',
'paymentCardExpiry': '0521',
'hash': 'b55552ff426d7e3d4885465d27ea0062'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'checkEnrollment',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'checkEnrollment',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'transactionAmount' => '1.00',
'transactionCurrency' => 'AUD',
'transactionProduct' => 'Test Product',
'customerIP' => '1.1.1.1',
'paymentCardName' => 'Test Customer',
'paymentCardNumber' => '5123456789012346',
'paymentCardExpiry' => '0521',
'hash' => 'b55552ff426d7e3d4885465d27ea0062'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "checkEnrollment" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerIP", "1.1.1.1" },
{ "paymentCardName", "Test Customer" },
{ "paymentCardNumber", "5123456789012346" },
{ "paymentCardExpiry", "0521" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "checkEnrollment" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "transactionAmount", "1.00" },
{ "transactionCurrency", "AUD" },
{ "transactionProduct", "Test Product" },
{ "customerIP", "1.1.1.1" },
{ "paymentCardName", "Test Customer" },
{ "paymentCardNumber", "5123456789012346" },
{ "paymentCardExpiry", "0521" },
{ "hash", "d0fb5716a2b85c743ed802bd5bd7284b" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "checkEnrollment"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentCardName", "Test Customer"}, _
{"paymentCardNumber", "5123456789012346"}, _
{"paymentCardExpiry", "0521"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "checkEnrollment"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"transactionAmount", "1.00"}, _
{"transactionCurrency", "AUD"}, _
{"transactionProduct", "Test Product"}, _
{"customerIP", "1.1.1.1"}, _
{"paymentCardName", "Test Customer"}, _
{"paymentCardNumber", "5123456789012346"}, _
{"paymentCardExpiry", "0521"}, _
{"hash", "d0fb5716a2b85c743ed802bd5bd7284b"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "checkEnrollment");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("transactionAmount", "1.00");
params.put("transactionCurrency", "AUD");
params.put("transactionProduct", "TestProduct");
params.put("customerIP", "1.1.1.1");
params.put("paymentCardName", "TestCard");
params.put("paymentCardNumber", "5123456789012346");
params.put("paymentCardExpiry", "0521");
params.put("hash", "b55552ff426d7e3d4885465d27ea0062");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<responseCode>0</responseCode>
<responseMessage>Operation successful</responseMessage>
<acsURL>https://example.aspx?ReqType=0</acsURL>
<paReq>eNpVUsFu2zAMvesrchjQ</paReq>
<enrolled>Y</enrolled>
<eci>5</eci>
</mwResponse>
{
"responseCode": "0",
"responseMessage": "Operation successful",
"acsURL": "https:\/\/example.aspx?ReqType=0",
"paReq": "eNpVUsFu2zAMvesrchjQ",
"enrolled": "Y",
"eci": "5"
}
{
"responseCode": "0",
"responseMessage": "Operation successful",
"acsURL": "https:\/\/example.aspx?ReqType=0",
"paReq": "eNpVUsFu2zAMvesrchjQ",
"enrolled": "Y",
"eci": "5"
}
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
PARes | The value of this parameter is returned by Customer's issuer bank. |
curl -X POST \
-d method="checkPARes" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d PARes="eJzNWVmvm9iy/it" https://api.merchantwarrior.com/post/
curl -X POST -d method="checkPARes" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d PARes="eJzNWVmvm9iy/it" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'checkPARes',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'PARes' => 'eJzNWVmvm9iy/it'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'checkPARes',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'PARes' => 'eJzNWVmvm9iy/it'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
import requests
data = {
'method': 'checkPARes',
'merchantUUID': '5265f8eed6a19',
'apiKey': 'ksmnwxab',
'PARes': 'eJzNWVmvm9iy/it'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method': 'checkPARes',
'merchantUUID': '5265f8eed6a19',
'apiKey': 'ksmnwxab',
'PARes': 'eJzNWVmvm9iy/it'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'checkPARes',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'PARes' => 'eJzNWVmvm9iy/it'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'checkPARes',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'PARes' => 'eJzNWVmvm9iy/it'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "checkPARes" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "PARes", "eJzNWVmvm9iy/it" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "checkPARes" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "PARes", "eJzNWVmvm9iy/it" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "checkPARes"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"PARes", "eJzNWVmvm9iy/it"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "checkPARes"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"PARes", "eJzNWVmvm9iy/it"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "checkPARes");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("PARes", "eJzNWVmvm9iy/it");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<responseCode>0</responseCode>
<responseMessage>Operation successful</responseMessage>
<threeDSToken>8e86aef68037e8849980</threeDSToken>
<threeDSResult>N</threeDSResult>
<threeDSEci>7</threeDSEci>
<threeDSXid>857e2347c329eec31c75</threeDSXid>
<threeDSCavv/>
</mwResponse>
{
"responseCode": "0",
"responseMessage": "Operation successful",
"threeDSToken": "8e86aef68037e8849980",
"threeDSResult": "N",
"threeDSEci": "7",
"threeDSXid": "857e2347c329eec31c75",
"threeDSCavv": []
}
{
"responseCode": "0",
"responseMessage": "Operation successful",
"threeDSToken": "8e86aef68037e8849980",
"threeDSResult": "N",
"threeDSEci": "7",
"threeDSXid": "857e2347c329eec31c75",
"threeDSCavv": []
}
The addBlacklistedCard method is used to add a card into the merchant blacklist
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
cardName | The name of card holder. |
cardNumber | The full card number. |
cardExpiryMonth | This must be MM format. The month must be zero padded if it is less than 10. |
cardExpiryYear | This must be YY format. |
secureHash | The verification hash is a combination of the full parameters sent in the request and the MD5 of your API Passphrase. See Secure Hash for information on how to construct the hash correctly. |
curl -X POST \
-d method="addBlacklistedCard" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d cardName="Test Customer" \
-d cardNumber="5123456789012346" \
-d cardExpiryMonth="05" \
-d cardExpiryYear="17" https://api.merchantwarrior.com/post/
curl -X POST -d method="addBlacklistedCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d cardName="Test Customer"
-d cardNumber="5123456789012346" -d cardExpiryMonth="05" -d cardExpiryYear="17" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'addBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardName' => 'Test Customer',
'cardNumber' => '5123456789012346',
'cardExpiryMonth' => '05',
'cardExpiryYear' => '17'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'addBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardName' => 'Test Customer',
'cardNumber' => '5123456789012346',
'cardExpiryMonth' => '05',
'cardExpiryYear' => '17'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
import requests
data = {
'method' : 'addBlacklistedCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'cardName' : 'Test Customer',
'cardNumber' : '5123456789012346',
'cardExpiryMonth' : '05',
'cardExpiryYear' : '17'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'addBlacklistedCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'cardName' : 'Test Customer',
'cardNumber' : '5123456789012346',
'cardExpiryMonth' : '05',
'cardExpiryYear' : '17'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'addBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardName' => 'Test Customer',
'cardNumber' => '5123456789012346',
'cardExpiryMonth' => '05',
'cardExpiryYear' => '17'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'addBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardName' => 'Test Customer',
'cardNumber' => '5123456789012346',
'cardExpiryMonth' => '05',
'cardExpiryYear' => '17'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "addBlacklistedCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "cardName", "Test Customer" },
{ "cardNumber", "5123456789012346" },
{ "cardExpiryMonth", "05" },
{ "cardExpiryYear", "17" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "addBlacklistedCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "cardName", "Test Customer" },
{ "cardNumber", "5123456789012346" },
{ "cardExpiryMonth", "05" },
{ "cardExpiryYear", "17" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "addBlacklistedCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"cardName", "Test Customer"}, _
{"cardNumber", "5123456789012346"}, _
{"cardExpiryMonth", "05"}, _
{"cardExpiryYear", "17"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "addBlacklistedCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"cardName", "Test Customer"}, _
{"cardNumber", "5123456789012346"}, _
{"cardExpiryMonth", "05"}, _
{"cardExpiryYear", "17"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "addBlacklistedCard");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("cardName", "TestCustomer");
params.put("cardNumber", "5123456789012346");
params.put("cardExpiryMonth", "05");
params.put("cardExpiryYear", "17");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<responseCode>0</responseCode>
<responseMessage>Operation successful</responseMessage>
<cardID>5bee5e25c09bb</cardID>
<cardNumberFirst>512345</cardNumberFirst>
<cardNumberLast>2346</cardNumberLast>
<cardExpiryMonth>05</cardExpiryMonth>
<cardExpiryYear>21</cardExpiryYear>
</mwResponse>
{
"responseCode": "0",
"responseMessage": "Operation successful",
"cardID": "5bee5e25c09bb",
"cardNumberFirst": "512345",
"cardNumberLast": "2346",
"cardExpiryMonth": "05",
"cardExpiryYear": "21"
}
{
"responseCode": "0",
"responseMessage": "Operation successful",
"cardID": "5bee5e25c09bb",
"cardNumberFirst": "512345",
"cardNumberLast": "2346",
"cardExpiryMonth": "05",
"cardExpiryYear": "21"
}
The removeBlacklistedCard method is used to remove a card out of the merchant blacklist
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
cardID | A unique alphanumeric string returned by addBlacklistedCard, used to identify a specific card. |
curl -X POST \
-d method="removeBlacklistedCard" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d cardID="5bee5e25c09bb" https://api.merchantwarrior.com/post/
curl -X POST -d method="removeBlacklistedCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d cardID="5bee5e25c09bb" https://api.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'removeBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'removeBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
import requests
data = {
'method' : 'removeBlacklistedCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'cardID' : '5bee5e25c09bb'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'removeBlacklistedCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'cardID' : '5bee5e25c09bb'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'removeBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'removeBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "removeBlacklistedCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "cardID", "5bee5e25c09bb" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "removeBlacklistedCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "cardID", "5bee5e25c09bb" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "removeBlacklistedCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"cardID", "5bee5e25c09bb"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "removeBlacklistedCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"cardID", "5bee5e25c09bb"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "removeBlacklistedCard");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("cardID", "5bee5e25c09bb");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<responseCode>0</responseCode>
<responseMessage>Operation successful</responseMessage>
<cardName>Bob Jones</cardName>
<cardNumberFirst>512345</cardNumberFirst>
<cardNumberLast>2346</cardNumberLast>
<cardExpiryMonth>05</cardExpiryMonth>
<cardExpiryYear>21</cardExpiryYear>
</mwResponse>
{
"responseCode": "0",
"responseMessage": "Operation successful",
"cardName": "Bob Jones",
"cardNumberFirst": "512345",
"cardNumberLast": "2346",
"cardExpiryMonth": "05",
"cardExpiryYear": "21"
}
{
"responseCode": "0",
"responseMessage": "Operation successful",
"cardName": "Bob Jones",
"cardNumberFirst": "512345",
"cardNumberLast": "2346",
"cardExpiryMonth": "05",
"cardExpiryYear": "21"
}
The queryBlacklistedCard method is used to query a card info in the merchant black list
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
cardID | A unique alphanumeric string returned by addBlacklistedCard, used to identify a specific card. |
Optional Parameters
Parameter | Description |
---|---|
global | The value indicates the query is based on your black card list or Merchant Warrior global black list. Must be 0 or 1. |
curl -X POST \
-d method="queryBlacklistedCard" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d cardID="5bee5e25c09bb" https://api.merchantwarrior.com/post/
curl -X POST -d method="queryBlacklistedCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d cardID="5bee5e25c09bb" https://api.merchantwarrior.com/post/
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://api.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'queryBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
import requests
data = {
'method' : 'queryBlacklistedCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'cardID' : '5bee5e25c09bb'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'queryBlacklistedCard',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'cardID' : '5bee5e25c09bb'
}
r = requests.post('https://api.merchantwarrior.com/post/', data = data)
print(r.text)
<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://api.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'queryBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'queryBlacklistedCard',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'cardID' => '5bee5e25c09bb'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'transactionID' => (isset($xml['transactionID']) ? $xml['transactionID'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryBlacklistedCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "cardID", "5bee5e25c09bb" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://api.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "queryBlacklistedCard" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "cardID", "5bee5e25c09bb" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryBlacklistedCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"cardID", "5bee5e25c09bb"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://api.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "queryBlacklistedCard"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"cardID", "5bee5e25c09bb"} _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "removeBlacklistedCard");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("cardID", "5bee5e25c09bb");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://api.merchantwarrior.com/post/");
Map<?xml version="1.0"?>
<mwResponse>
<responseCode>0</responseCode>
<responseMessage>Operation successful</responseMessage>
<cardName>Bob Jones</cardName>
<cardNumberFirst>512345</cardNumberFirst>
<cardNumberLast>2346</cardNumberLast>
<cardExpiryMonth>05</cardExpiryMonth>
<cardExpiryYear>21</cardExpiryYear>
</mwResponse>
{
"responseCode": "0",
"responseMessage": "Operation successful",
"cardName": "Bob Jones",
"cardNumberFirst": "512345",
"cardNumberLast": "2346",
"cardExpiryMonth": "05",
"cardExpiryYear": "21"
}
{
"responseCode": "0",
"responseMessage": "Operation successful",
"cardName": "Bob Jones",
"cardNumberFirst": "512345",
"cardNumberLast": "2346",
"cardExpiryMonth": "05",
"cardExpiryYear": "21"
}
Test your sandbox Notify URLs for Direct Debit, Chargebacks, EFT, and BPay. You should contact us during your implementation to set up your sandbox Notify URLs for each of the services you plan on implementing.
Required Parameters
Parameter | Description |
---|---|
method | This field is case sensitive. |
merchantUUID | The value of this parameter is provided to you by Merchant Warrior. |
apiKey | The value of this parameter is provided to you by Merchant Warrior. |
simulateType | The value of this field is the type of transaction and CSVNotify you would like to simulate. Valid options are listed below. |
Notification Types
simulateType | Action |
---|---|
Chargeback |
|
EFT |
|
BPay |
|
DirectDebit |
|
Optional Parameters
Parameter | Description |
---|---|
transactionID | Only functional with the DirectDebit notification type. Used to specify a specific transactionID and change its status, rather than creating new transactions. If this parameter is used, then transactionStatus must be used as well. Example: 4678-6a6ec93c-b4c7-4ca5-ae7e-03159df07e79 |
batchUUID | Only functional with the DirectDebit notification type. Used to specify a specific batchUUID and change the status of the transaction in it, rather than creating new transactions. Can be used in conjunction with the transactionStatus parameter to specify the status to change to. Example: 03159df07e79 |
transactionStatus | Only functional with the DirectDebit notification type. Used in conjunction with the Can be one of the following -
Example: approved |
curl -X POST \
-d method="simulateNotify" \
-d merchantUUID="5265f8eed6a19" \
-d apiKey="ksmnwxab" \
-d simulateType="BPay" \
https://base.merchantwarrior.com/post/
curl -X POST-d method="processCard" -d merchantUUID="5265f8eed6a19" -d apiKey="ksmnwxab" -d simulateType="BPay" https://base.merchantwarrior.com/post/require 'net/http'
require 'uri'
uri = URI.parse("https://base.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'simulateNotify',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'simulateType' => 'BPay'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.body
require 'net/http'
require 'uri'
uri = URI.parse("https://base.merchantwarrior.com/post/")
request = Net::HTTP::Post.new(uri)
request.set_form_data(
'method' => 'simulateNotify',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'simulateType' => 'BPay'
)
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
http.request(request)
end
puts response.bodyimport requests
data = {
'method' : 'simulateNotify',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'simulateType' : 'BPay'
}
r = requests.post('https://base.merchantwarrior.com/post/', data = data)
print(r.text)
import requests
data = {
'method' : 'simulateNotify',
'merchantUUID' : '5265f8eed6a19',
'apiKey' : 'ksmnwxab',
'simulateType' : 'BPay'
}
r = requests.post('https://base.merchantwarrior.com/post/', data = data)
print(r.text)<?php
// Setup the POST url
define('MW_API_ENDPOINT', 'https://base.merchantwarrior.com/post/');
// Setup POST data
$postData = array (
'method' => 'simulateNotify',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'simulateType' => 'BPay'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'bin' => (isset($xml['bin']) ? $xml['bin'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>
'simulateNotify',
'merchantUUID' => '5265f8eed6a19',
'apiKey' => 'ksmnwxab',
'simulateType' => 'BPay'
);
// Setup CURL defaults
$curl = curl_init();
// Setup CURL params for this request
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_URL, MW_API_ENDPOINT);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($postData, '', '&'));
// Run CURL
$response = curl_exec($curl);
$error = curl_error($curl);
// Check for CURL errors
if (isset($error) && strlen($error)) {
throw new Exception("CURL Error: {$error}");
}
// Parse the XML
$xml = simplexml_load_string($response);
// Convert the result from a SimpleXMLObject into an array
$xml = (array)$xml;
// Validate the response - the only successful code is 0
$status = ((int)$xml['responseCode'] === 0) ? true : false;
// Make the response a little more useable
$result = array (
'status' => $status,
'bin' => (isset($xml['bin']) ? $xml['bin'] : null),
'responseData' => $xml
);
exit(var_dump($result));
?>using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://base.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "simulateNotify" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "simulateType", "BPay" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
public class Program {
public static void Main(string[] args) {
using(var client = new System.Net.WebClient()) {
byte[] response = client.UploadValues("https://base.merchantwarrior.com/post/",
new System.Collections.Specialized.NameValueCollection() {
{ "method", "simulateNotify" },
{ "merchantUUID", "578dd399d2373" },
{ "apiKey", "dyqxkzse" },
{ "simulateType", "BPay" },
});
String result = System.Text.Encoding.Default.GetString(response);
Console.WriteLine(result);
}
}
}Imports System
Imports System.Collections.Generic
Imports System.Linq
Public Module Program
Public Sub Main(args As String())
Using client = New System.Net.WebClient()
Dim response As Byte() = client.UploadValues(
"https://base.merchantwarrior.com/post/",
New System.Collections.Specialized.NameValueCollection() From { _
{"method", "simulateNotify"}, _
{"merchantUUID", "578dd399d2373"}, _
{"apiKey", "dyqxkzse"}, _
{"simulateType", "BPay"}, _
})
Dim result As [String] = System.Text.Encoding.[Default].GetString(response)
Console.WriteLine(result)
End Using
End Sub
End Module
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://base.merchantwarrior.com/post/");
Map<String, String> params = new LinkedHashMap<>();
params.put("method", "simulateNotify");
params.put("merchantUUID", "5265f8eed6a19");
params.put("apiKey", "ksmnwxab");
params.put("simulateType", "BPay");
StringBuilder postData = new StringBuilder();
for (Map.Entry<String, String> param : params.entrySet()) {
if (postData.length() != 0)
postData.append('&');
postData.append(param.getKey());
postData.append('=');
postData.append(param.getValue());
}
HttpURLConnection conn = (HttpURLConnection)url.openConnection();
conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
conn.setDoOutput(true);
OutputStreamWriter writer = new OutputStreamWriter(conn.getOutputStream());
writer.write(postData.toString());
writer.flush();
BufferedReader reader = new BufferedReader(
new InputStreamReader(conn.getInputStream()));
String line;
StringBuilder sb = new StringBuilder();
while((line = reader.readLine()) != null){
sb.append(line);
}
System.out.println(sb.toString());
writer.close();
reader.close();
}
catch(Exception ex){
ex.printStackTrace();
}
}
}
import java.io.*;
import java.net.*;
import java.util.*;
public class Program{
public static void main(String[] args) {
try{
URL url = new URL("https://base.merchantwarrior.com/post/");
Map