Contents
- Introduction
- API
- Authentication
- Transactions
- 2 Party Payment
- 2 Party Transaction Result
- 2 Party Search Transactions
- AuthKey
- Webform
- JavaScript - Simple
- JavaScript - Advanced
- 3 Party Redirect
- Iframe
- Transaction Result
- Wallets
- Amex
- Tokens
- 2 Party
- Add
- Update
- Tokenise Card
- Retrieve
- Search Token
- Delete
- AuthKey
- Add
- Update
- Webform
- Add
- Update
- JavaScript - Simple
- Add
- Update
- JavaScript - Advanced
- Add
- Update
- 3 Party Redirect
- Add
- Update
- 3 Party Iframe
- Add
- Update
- Lookup Token Result
- 2 Party
- WebHooks
- 3D Secure
- References
- API Response Codes
- TxnResp Responses
- Firewall Configuration
- Currency List
- Test Mode Transactions
- Card Details Object
- Customer Details Object
- Hpp Parameters Object
- DataVault Hpp Parameters Object
- Order Object
- Billing Address Object
- Shipping Address Object
- Order Items Object
- Shipping Address Object
- Contact Details Object
- Personal Details Object
- Token Request Object
- Fixed Add Token Data Object
- Bank Details Object
- API Response Object
- Transaction Response Object
- CVN Result Object
- Auth 3D Response Object
- Json Object
- Error Object
- Transaction Action Object
- Transaction Type Object
- Card Type Object
- Transaction Source Object
- Transaction Sub Type Object
- CVN Response Object
- Tokenisation Mode Object
Getting Started
It's easy to start developing with MerchantSuite. Follow the simple steps below:
- Register for a Gold or Platinum package. Choose a Free Trial if you want to try it out first. Your card details are not required for free trials.
- Log into the MySuite portal.
- Navigate to MY SUITE >> API.
- Set up an API user.
- Use the API user credentials, username and password, to begin developing and testing with MerchantSuite.
Introduction
The MerchantSuite API offers a way of interfacing with the MerchantSuite platform programmatically in a REST interface using HTTP over SSL. Requests are submitted to process transactions, create and update entities including tokens, and perform searches.
Requests to the API are categorised by the different areas of functionality of the MerchantSuite platform. The API supports transaction processing and token processing with other areas planned. Each area has its own URL endpoint. Different HTTP methods imply different operations, for example retrieval of information from the database is handled by the GET operation, while updates are handled by either POST or PUT requests.
For nearly all operations, requests and responses are defined within a JavaScript Object Notation (JSON) object. Where appropriate the API also supports WebForm (HTTP POST) requests for operations allowing seamless integration with web applications.
Errors from the API are handled by both HTTP Status Codes and API specific response codes. HTTP Status Code errors handle generic scenarios such as using incorrect HTTP verbs or incorrect URLs. API response codes handle specific validation, system errors and invalid authentication details.
Libraries
Libraries are available in several programming languages and are designed to make it easy to incorporate the API into your site by providing prepared methods to invoke.
Please select your preferred programming language from the drop down box displayed in the top right of each section.
Changing the programming language in one section will update the programming language in all sections.
API Endpoint
https://www.merchantsuite.com/api/v2/
API
Authentication
Direct Integration Method requests use an "Authorization" header to pass a base64 encoded string containing the API user credentials.
Authentication Format
The string is formatted as follows:
username|membershipid:password
For example, the HTTP header for above credentials string is:
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
The spelling of the header name is critical for correct authentication.
Transactions
Processes a transaction using either a card or previously added token.
URL Endpoint
https://www.merchantsuite.com/api/v2/txns/
2 Party Payment
Use this method for direct communication between your server and MerchantSuite. Note that if your system is passing credit card details, it will be directly in scope for PCI compliance.
URL
POST
/txns/
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your POST request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request is a TxnReq
(transaction request details) JSON object with the following properties.
Property | Type | Description |
---|---|---|
Action |
string | For this operation, one of the following values MUST be used: |
TestMode |
boolean |
Flag to indicate whether transactions should be processed in test mode. (see section Test Mode Transactions) If present, it must be either "true" or "false". If absent, it will default to "false", resulting in transactions being submitted to the bank for authorisation. Optional |
Amount |
64 bit integer |
Transaction amount in the lowest denomination for the currency. If AUD use 12000 for $120.00. If JPY use 120 for ¥120. |
AmountOriginal |
64 bit integer | Total payment amount without surcharge - this field is for information and reporting only and does not alter the value of the transaction (as specified by Amount). Optional |
AmountSurcharge |
64 bit integer | Surcharge amount for payment - this field is for information and reporting only and does not alter the value of the transaction (as specified by Amount). Optional |
PaymentReason |
string | Payment Reason for the transaction (MaxLen = 50). Optional |
CardDetails |
object Refer to Card Details Object |
MANDATORY when action is payment, preauth or unmatched_refund, otherwise NOT REQUIRED and will be ignored. |
Reference1 |
string | This field should be unique for each payment (MaxLen = 50). |
Reference2 |
string | Additional reference field (MaxLen = 50). Optional |
Reference3 |
string | Additional reference field (MaxLen = 50). Optional |
Currency |
string |
The currency that the transaction is to be processed in as an ISO 4217 code (see section Currency List). Your bank merchant account must be configured to accept the currency used in this field. Please speak to your bank if you are unsure what currencies your bank merchant account can transact in (MinLen = 3, MaxLen = 3). Optional |
Customer |
object Refer to Customer Details Object |
JSON object containing customer details. Optional |
InternalNote |
string | Reference that is for internal use only. (MaxLen = 50). Optional |
Order |
object Refer to Order Object |
JSON object containing order details. Optional |
OriginalTxnNumber |
string |
Used for refunds, reversals and captures. For refunds it is the transaction number of the payment or capture being refunded. For reversals it is the transaction number of the payment, refund, preauth, capture or unmatched_refund that is being reversed. For captures it is the transaction number of preauth that is being captured. MANDATORY when action is refund, reversal or capture, otherwise NOT REQUIRED and will be ignored (MaxLen = 50). |
StoreCard |
boolean | Flag to indicate whether the cardholder agrees to save their card details. This flag allows merchant to create a token from the card details used to process the transaction. Optional |
SubType |
string | Defines a sub type for transaction: |
TokenisationMode |
64 bit integer | Determines whether or not tokenisation of the payment instrument will occur: |
Type |
string | Defines a type for transaction: |
FraudScreeningRequest |
object Refer to Fraud Screening Request Object |
JSON object used for Fraud Screening. Optional If this object is null, no fraud screening will be performed. |
POST https://www.merchantsuite.com/api/v2/txns/ HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 411
Expect: 100-continue
Connection: Keep-Alive
{
"TxnReq" : {
"Action" : "payment",
"Amount" : 19900,
"AmountOriginal" : 19800,
"AmountSurcharge" : 100,
"CardDetails" : {
"CardHolderName" : "John Smith",
"CardNumber" : "5123456789012346",
"CVN" : "123",
"ExpiryDate" : "0521"
},
"Currency" : "AUD",
"Customer" : {
"Address" : {
"AddressLine1" : "123 Fake Street",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "Melbourne",
"CountryCode" : "AUS",
"PostCode" : "3000",
"State" : "VIC"
},
"ContactDetails" : {
"EmailAddress" : "john.smith@email.com",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"CustomerNumber" : "1234",
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "John",
"LastName" : "Smith",
"MiddleName" : "",
"Salutation" : "Mr"
},
"DaysOnFile" : 23,
"ExistingCustomer" : true
},
"InternalNote" : "test merchant ref",
"Order" : {
"BillingAddress" : {
"Address" : {
"AddressLine1" : "",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "",
"CountryCode" : "",
"PostCode" : "",
"State" : ""
},
"ContactDetails" : {
"EmailAddress" : "",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "",
"LastName" : "",
"MiddleName" : "",
"Salutation" : ""
}
},
"OrderItems" : [{
"Comments" : "",
"Description" : "",
"GiftMessage" : "",
"PartNumber" : "",
"ProductCode" : "",
"Quantity" : 1,
"SKU" : "",
"ShippingMethod" : "",
"ShippingNumber" : "",
"UnitPrice" : 100
}, {
"Comments" : "",
"Description" : "",
"GiftMessage" : "",
"PartNumber" : "",
"ProductCode" : "",
"Quantity" : 1,
"SKU" : "",
"ShippingMethod" : "",
"ShippingNumber" : "",
"UnitPrice" : 100
}],
"ShippingAddress" : {
"Address" : {
"AddressLine1" : "",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "",
"CountryCode" : "",
"PostCode" : "",
"State" : ""
},
"ContactDetails" : {
"EmailAddress" : "",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "",
"LastName" : "",
"MiddleName" : "",
"Salutation" : ""
}
},
"ShippingMethod" : "",
"OrderRecipients" : [{
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "",
"LastName" : "",
"MiddleName" : "",
"Salutation" : ""
},
"ContactDetails" : {
"EmailAddress" : "",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"Address" : {
"AddressLine1" : "",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "",
"CountryCode" : "",
"PostCode" : "",
"State" : ""
}
},
{
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "",
"LastName" : "",
"MiddleName" : "",
"Salutation" : ""
},
"ContactDetails" : {
"EmailAddress" : "",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"Address" : {
"AddressLine1" : "",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "",
"CountryCode" : "",
"PostCode" : "",
"State" : ""
}
}]
},
"OriginalTxnNumber" : null,
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"EmailAddress" : "user@test.com",
"PaymentReason" : null,
"TestMode" : false,
"TokenisationMode" : 0,
"StoreCard" : false,
"SubType" : "single",
"Type" : "internet",
"FraudScreeningRequest" : {
"PerformFraudScreening" : "true",
"DeviceFingerprint" : "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
}
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456",MerchantSuite\Mode::Live);
$txn = new MerchantSuite\Transaction();
$cardDetails = new MerchantSuite\CardDetails();
$order = new MerchantSuite\Order();
$shippingAddress = new MerchantSuite\OrderAddress();
$billingAddress = new MerchantSuite\OrderAddress();
$address = new MerchantSuite\Address();
$customer = new MerchantSuite\Customer();
$personalDetails = new MerchantSuite\PersonalDetails();
$contactDetails = new MerchantSuite\ContactDetails();
$order_item_1 = new MerchantSuite\OrderItem();
$order_recipient_1 = new MerchantSuite\OrderRecipient();
$fraudScreening = new MerchantSuite\FraudScreeningRequest();
$txn->setAction(MerchantSuite\Actions::Payment);
$txn->setCredentials($credentials);
$txn->setAmount(20000);
$txn->setCurrency("AUD");
$txn->setInternalNote("Internal Note");
$txn->setReference1("My Customer Reference");
$txn->setReference2("Medium");
$txn->setReference3("Large");
$txn->setStoreCard(FALSE);
$txn->setSubType("single");
$txn->setType(MerchantSuite\TransactionType::Internet);
$cardDetails->setCardHolderName("MR C CARDHOLDER");
$cardDetails->setCardNumber("4444333322221111");
$cardDetails->setCVN("678");
$cardDetails->setExpiryDate("0521");
$txn->setCardDetails($cardDetails);
$address->setAddressLine1("123 Fake Street");
$address->setCity("Melbourne");
$address->setCountryCode("AUS");
$address->setPostCode("3000");
$address->setState("Vic");
$contactDetails->setEmailAddress("example@email.com");
$personalDetails->setDateOfBirth("1900-01-01");
$personalDetails->setFirstName("John");
$personalDetails->setLastName("Smith");
$personalDetails->setSalutation("Mr");
$billingAddress->setAddress($address);
$billingAddress->setContactDetails($contactDetails);
$billingAddress->setPersonalDetails($personalDetails);
$shippingAddress->setAddress($address);
$shippingAddress->setContactDetails($contactDetails);
$shippingAddress->setPersonalDetails($personalDetails);
$order_item_1->setDescription("an item");
$order_item_1->setQuantity(1);
$order_item_1->setUnitPrice(1000);
$orderItems = array($order_item_1);
$order_recipient_1->setAddress($address);
$order_recipient_1->setContactDetails($contactDetails);
$order_recipient_1->setPersonalDetails($personalDetails);
$orderRecipients = array($order_recipient_1);
$order->setBillingAddress($billingAddress);
$order->setOrderItems($orderItems);
$order->setOrderRecipients($orderRecipients);
$order->setShippingAddress($shippingAddress);
$order->setShippingMethod("boat");
$txn->setOrder($order);
$customer->setCustomerNumber("1234");
$customer->setAddress($address);
$customer->setExistingCustomer(false);
$customer->setContactDetails($contactDetails);
$customer->setPersonalDetails($personalDetails);
$customer->setCustomerNumber("1");
$customer->setDaysOnFile(1);
$txn->setCustomer($customer);
$fraudScreening->setPerformFraudScreening(true);
$fraudScreening->setDeviceFingerprint("0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");
$txn->setFraudScreeningRequest($fraudScreening);
$txn->setTokenisationMode(3);
$txn->setTimeout(93121);
$response = $txn->submit();
from MerchantSuite.Requests import Credentials, TransactionRequest, Customer,\
PersonalDetails, ContactDetails, Address, Order, OrderAddress, OrderItem,\
OrderRecipient, FraudScreeningRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TransactionRequest(credentials)
request.base_url = "https://www.merchantsuite.com/api/v2"
request.card_details = CardDetails(
card_holder_name = "MR C CARDHOLDER",
expiry_date = "0521",
card_number = "4444333322221111",
cvn = "123")
request.customer = Customer()
request.customer.address = Address()
request.customer.address.address_line1 = "123 Fake Street"
request.customer.address.city = "Melbourne"
request.customer.address.country_code = "AUS"
request.customer.address.post_code = "3000"
request.customer.address.state = "VIC"
request.customer.contact_details = ContactDetails()
request.customer.contact_details.email_address = "example@email.com"
request.customer.contact_details.home_phone_number = "93123456"
request.customer.contact_details.mobile_phone_number = "0412345678"
request.customer.contact_details.work_phone_number = "0412345678"
request.customer.personal_details = PersonalDetails()
request.customer.personal_details.date_of_birth = "1900-01-01"
request.customer.personal_details.first_name = "John"
request.customer.personal_details.last_name = "Smith"
request.customer.personal_details.middle_name = "C"
request.customer.personal_details.salutation = "Mr"
request.customer.customer_number = "1234"
request.customer.existing_customer = False
request.customer.days_on_file = 0
request.order = Order()
request.order.billing_address = OrderAddress()
request.order.billing_address.address = Address()
request.order.billing_address.address.address_line1 = "123 Fake Street"
request.order.billing_address.address.city = "Melbourne"
request.order.billing_address.address.country_code = "AUS"
request.order.billing_address.address.post_code = "3000"
request.order.billing_address.address.state = "VIC"
request.order.billing_address.contact_details = ContactDetails()
request.order.billing_address.contact_details.email_address = "example@email.com"
request.order.billing_address.contact_details.home_phone_number = "93123456"
request.order.billing_address.contact_details.mobile_phone_number = "0412345678"
request.order.billing_address.contact_details.work_phone_number = "0412345678"
request.order.billing_address.personal_details = PersonalDetails()
request.order.billing_address.personal_details.date_of_birth = "1900-01-01"
request.order.billing_address.personal_details.first_name = "John"
request.order.billing_address.personal_details.last_name = "Smith"
request.order.billing_address.personal_details.middle_name = "C"
request.order.billing_address.personal_details.salutation = "Mr"
request.order.shipping_address = OrderAddress()
request.order.shipping_address.address = Address()
request.order.shipping_address.address.address_line1 = "123 Fake Street"
request.order.shipping_address.address.city = "Melbourne"
request.order.shipping_address.address.country_code = "AUS"
request.order.shipping_address.address.post_code = "3000"
request.order.shipping_address.address.state = "VIC"
request.order.shipping_address.contact_details = ContactDetails()
request.order.shipping_address.contact_details.email_address = "example@email.com"
request.order.shipping_address.contact_details.home_phone_number = "93123456"
request.order.shipping_address.contact_details.mobile_phone_number = "0412345678"
request.order.shipping_address.contact_details.work_phone_number = "0412345678"
request.order.shipping_address.personal_details = PersonalDetails()
request.order.shipping_address.personal_details.date_of_birth = "1900-01-01"
request.order.shipping_address.personal_details.first_name = "John"
request.order.shipping_address.personal_details.last_name = "Smith"
request.order.shipping_address.personal_details.middle_name = "C"
request.order.shipping_address.personal_details.salutation = "Mr"
request.order.shipping_method = "boat"
order_receipient_1 = OrderRecipient()
order_receipient_1.address = Address()
order_receipient_1.address.address_line1 = "123 Fake Street"
order_receipient_1.address.city = "Melbourne"
order_receipient_1.address.country_code = "AUS"
order_receipient_1.address.post_code = "3000"
order_receipient_1.address.state = "VIC"
order_receipient_1.contact_details = ContactDetails()
order_receipient_1.contact_details.email_address = "example@email.com"
order_receipient_1.contact_details.home_phone_number = "93123456"
order_receipient_1.contact_details.mobile_phone_number = "0412345678"
order_receipient_1.contact_details.work_phone_number = "0412345678"
order_receipient_1.personal_details = PersonalDetails()
order_receipient_1.personal_details.date_of_birth = "1900-01-01"
order_receipient_1.personal_details.first_name = "John"
order_receipient_1.personal_details.last_name = "Smith"
order_receipient_1.personal_details.middle_name = "C"
order_receipient_1.personal_details.salutation = "Mr"
request.order.order_recipients = [order_receipient_1.get_payload()]
order_item_1 = OrderItem()
order_item_1.comments = "Order item comment"
order_item_1.description = "Test Order Item 1"
order_item_1.gift_message = "Test gift message"
order_item_1.quantity = 1
order_item_1.unit_price = 1000
request.order.order_items = [order_item_1.get_payload()]
request.fraud_screening_request = FraudScreeningRequest()
request.fraud_screening_request.perform_fraud_screening = True
request.fraud_screening_request.device_fingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
request.store_card = True
request.action = "payment"
request.amount = 200
request.currency = "AUD"
request.reference1 = "Ref One"
request.sub_type = "recurring"
request.type = "internet"
request.tokenisation_mode = 3
request.timeout = 90000
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::TransactionRequest.new()
cc = MerchantSuite::CardDetails.new()
cc.card_holder_name = "MR C CARDHOLDER"
cc.card_number = "4444333322221111"
cc.expiry_date = "0521"
cc.cvn = "123"
ad = MerchantSuite::Address.new()
ad.address_line_1 = "123 Fake Street"
ad.city = "Melbourne"
ad.country_code = "AUS"
ad.post_code = "3000"
ad.state = "VIC"
cd = MerchantSuite::ContactDetails.new()
cd.email_address = "example@email.com"
pd = MerchantSuite::PersonalDetails.new()
pd.date_of_birth = "1900-01-01"
pd.first_name = "John"
pd.last_name = "Smith"
pd.salutation = "Mr"
ba = MerchantSuite::OrderAddress.new()
ba.address = ad;
ba.contact_details = cd
ba.personal_details = pd
sa = MerchantSuite::OrderAddress.new()
sa.address = ad;
sa.contact_details = cd
sa.personal_details = pd
or_item_1 = MerchantSuite::OrderItem.new()
or_item_1.description = "an item"
or_item_1.quantity = 1
or_item_1.unit_price = 1000
order_items = [or_item_1.payload()]
order_recipient_1 = MerchantSuite::OrderRecipient.new()
order_recipient_1.address = ad;
order_recipient_1.contact_details = cd
order_recipient_1.personal_details = pd
order_recipients = [order_recipient_1.payload()]
order = MerchantSuite::Order.new()
order.billing_address = ba
order.shipping_address = sa
order.order_items = order_items
order.shipping_method = "Boat"
order.order_recipients = order_recipients
fs = MerchantSuite::FraudScreeningRequest.new()
fs.perform_fraud_screening = true
fs.device_fingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
cust = MerchantSuite::Customer.new()
cust.customer_number = "1234"
cust.address = ad
cust.existing_customer = false
cust.contact_details = cd
cust.personal_details = pd
cust.customer_number = "1"
cust.days_on_file = 1
req.base_url = "https://www.merchantsuite.com/api/v2"
req.reference1 = "Test Ref 1"
req.currency = "AUD"
req.action = "payment"
req.amount = 1000
req.type = "internet"
req.subtype = "single"
req.store_card = true
req.card_details = cc
req.credentials = cred
req.order = order
req.fraud_screening_request = fs
req.customer = cust
req.tokenisation_mode = 3
req.timeout = 90000
response = req.submit()
import com.MerchantSuite.api.*;
import java.math.BigDecimal;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
CreditCardDetails cc = new CreditCardDetails();
Sender s = new Sender();
cc.setCardNumber("4444333322221111");
cc.setExpiryDate("0521");
cc.setCVN("123");
cc.setCardHolderName("MR C CARDHOLDER");
TxnRequest txn = new TxnRequest(credentials);
TxnResp resp;
txn.setBaseUrl("https://www.merchantsuite.com/api/v2");
txn.setAction("payment");
txn.setAmount((long) 1000);
txn.setReference1("Test Ref 1");
txn.setType("internet");
txn.setTestMode(false);
txn.setSubType("single");
txn.setCurrency("AUD");
txn.setStoreCard(false);
txn.setAmountOriginal((long) 0);
txn.setAmountSurcharge((long) 0);
txn.setCardDetails(cc);
txn.setCredentials(credentials);
txn.setTokenisationMode(TokenisationMode.TOKENISE);
Address ad = new Address();
ad.setAddressLine1("123 Fake Street");
ad.setCity("Melbourne");
ad.setCountryCode("AUS");
ad.setPostCode("3000");
ad.setState("VIC");
ContactDetails cd = new ContactDetails();
cd.setEmailAddress("example@email.com");
PersonalDetails pd = new PersonalDetails();
pd.setDateOfBirth("1900-01-01");
pd.setFirstName("John");
pd.setLastName("Smith");
pd.setSalutation("Mr");
OrderAddress ba = new OrderAddress();
ba.setAddress(ad);
ba.setContactDetails(cd);
ba.setPersonalDetails(pd);
OrderAddress sa = new OrderAddress();
sa.setAddress(ad);
sa.setContactDetails(cd);
sa.setPersonalDetails(pd);
OrderItem or_item_1 = new OrderItem();
or_item_1.setDescription("an item");
or_item_1.setQuantity(new BigDecimal(1));
or_item_1.setUnitPrice((long)1000);
ArrayOfOrderItem order_items = new ArrayOfOrderItem();
order_items.getOrderItem().add(or_item_1);
OrderRecipient order_recipient_1 = new OrderRecipient();
order_recipient_1.setAddress(ad);
order_recipient_1.setContactDetails(cd);
order_recipient_1.setPersonalDetails(pd);
ArrayOfOrderRecipient order_recipients = new ArrayOfOrderRecipient();
order_recipients.getOrderRecipient().add(order_recipient_1);
Order or = new Order();
or.setBillingAddress(ba);
or.setShippingAddress(sa);
or.setOrderItems(order_items);
or.setOrderRecipients(order_recipients);
or.setShippingMethod("Boat");
txn.setOrder(or);
Customer cust = new Customer();
cust.setCustomerNumber("1234");
cust.setAddress(ad);
cust.setExistingCustomer(false);
cust.setContactDetails(cd);
cust.setPersonalDetails(pd);
cust.setDaysOnFile(1);
txn.setCustomer(cust);
FraudScreeningRequest fs = new FraudScreeningRequest();
fs.setPerformFraudScreening(true);
fs.setDeviceFingerprint("0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");
txn.setFraudScreeningRequest(fs);
resp = s.submit(txn);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $cc = MerchantSuite::CardDetails->new(
card_number => "4444333322221111",
expiry_date => "0521",
cvn => "123",
card_holder_name => "MR C CARDHOLDER"
);
my $address = MerchantSuite::Address->new(
address_line_1 =>"123 Fake Stree",
address_line_2 => "",
address_line_3 => "",
city => "Melbourne",
country_code => "AUS",
post_code => "1234",
state => "VIC");
my $contact_details = MerchantSuite::ContactDetails->new(
email_address => 'example@email.com',
fax_number => "0123456789",
home_phone_number => "0123456789",
mobile_phone_number => "0123456789",
work_phone_number=> "0123456789");
my $personal_details = MerchantSuite::PersonalDetails->new(
date_of_birth => "1900-01-01",
first_name => "John",
last_name => "Smith",
middle_name => "",
salutation => "Mr");
my $customer = MerchantSuite::Customer->new(
address => $address,
contact_details => $contact_details,
customer_number => "1234",
personal_details => $personal_details,
days_on_file => 1);
my $shipping_address = MerchantSuite::OrderAddress->new(
address => $address,
contact_details => $contact_details,
personal_details => $personal_details);
my $billing_address = MerchantSuite::OrderAddress->new(address => $address,
contact_details => $contact_details,
personal_details =>$ personal_details);
my $item = MerchantSuite::OrderItem->new(
description => "An item of some description",
part_number => "1",
quantity => "4",
shipping_number => "1234",
unit_price => 1099);
my @itemArray = ($item);
my $order = MerchantSuite::Order->new(
shipping_address => $shipping_address,
billing_address => $billing_address);
@{$order->{order_items}} = @itemArray;
my $fraud_screening = MerchantSuite::FraudScreeningRequest->new(
perform_fraud_screening => 1,
device_fingerprint => "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");
my $req;
$req = MerchantSuite::TransactionRequest->new(
action => "payment",
amount => 2000,
currency => "AUD",
credentials => $cred,
card_details => $cc,
order => $order,
customer => $customer,
reference1 => "Perl Test 1",
type => "internet",
sub_type => "single",
internal_note => "Perl Internal Note 1",
tokenisation_mode => 3,
fraud_screening_request => $fraud_screening
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var txnClient = ClientFactory.
GetClientInstance<TxnClient>(new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new ProcessTxnReq()
{
TxnReq = new TxnRequest()
{
Action = "payment",
Amount = 1000,
AmountOriginal = 0,
AmountSurcharge = 0,
CardDetails = new CreditCardDetails()
{
CardNumber = "4444333322221111",
ExpiryDate = "0521",
CVN = "123",
CardHolderName = "MR C CARDHOLDER"
},
Currency = "AUD",
InternalNote = "test merchant ref",
OriginalTxnNumber = null,
Reference1 = "Reference 1",
Reference2 = "Reference 2",
Reference3 = "Reference 3",
PaymentReason = null,
StoreCard = false,
SubType = "single",
Type = "internet",
TokenisationMode = 3,
TestMode = false,
EmailAddress = "customer@email.address"
}
};
var response = txnClient.ProcessTxn(apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var cc = new api.CardDetails({
CardNumber: "4444333322221111",
ExpiryDate : "0521",
CardHolderName : "MR C CARDHOLDER",
CVN : "123"});
var ad = new api.Address({
AddressLine1 : "123 Fake Street",
AddressLine2 : "",
AddressLine3 : "",
City : "Melbourne",
CountryCode : "AUS",
PostCode : "3000",
State : "VIC"
});
var cd = new api.ContactDetails({
EmailAddress : "john.smith@email.com"
});
var pd = new api.PersonalDetails({
DateOfBirth : "",
FirstName : "John",
LastName : "Smith",
MiddleName : "",
Salutation : "Mr"
});
var cust = new api.Customer({
Address: ad,
ContactDetails: cd,
CustomerNumber: "1234",
PersonalDetails: pd
});
var ba = new api.OrderAddress({
Address: ad,
ContactDetails: cd,
PersonalDetails: pd
});
var sa = new api.OrderAddress({
Address: ad,
ContactDetails: cd,
PersonalDetails: pd
});
var order_item = new api.OrderItem({
Description : "An Item",
Quantity : 1,
UnitPrice : 100
});
var order_items = [order_item];
var order_recipient = new api.OrderRecipient({
Address: ad,
ContactDetails: cd,
PersonalDetails: pd
});
var order_recipients = [order_recipient];
var order = new api.Order({
BillingAddress: ba,
OrderItems: order_items,
ShippingAddress: sa,
ShippingMethod: "Boat",
OrderRecipients: order_recipients
});
var fs = new api.FraudScreeningRequest({
PerformFraudScreening: true,
DeviceFingerprint: "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
});
var req = new api.TxnRequest({
Action : "payment",
Amount: 2100,
CardDetails : cc,
Reference1: "NodeJS Test Transaction 1",
Currency: "AUD",
Order: order,
Customer: cust,
FraudScreeningRequest: fs,
Type: "internet",
SubType: "single",
StoreCard : true});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Configure the ApiConfig.java file to input your API user and Merchant credentials
import main.java.com.merchantsuite.android.api.ApiManager;
String paymentAction = "payment";
float txnAmount = 25.50f;
String crn1 = "A CRN";
String crn2 = "A CRN";
String crn3 = "A CRN";
String paymentCurrency = "AUD";
String cardHolderName = "MR C Cardholder";
String cardNumber = "5123456789012346";
String expiryDate = "9900";
String response = ApiManager.processTransactionWithAction(paymentAction,
txnAmount, crn1, crn2, crn3,
paymentCurrency, cardHolderName, cardNumber,
expiryDate);
//Configure the MerchantSuiteApiConfig.h file to input your API user and Merchant credentials
#import <Foundation/Foundation.h>
#import <bPointSDK/bPointSDK.h>
NSString* paymentType = @"payment";
GCFLoat txnAmmount = 25.50f;
NSString* crn1 = @"A CRN";
NSString* crn2 = @"A CRN";
NSString* crn3 = @"A CRN";
NSString* cardNumber = @"5123456789012346";
NSString* expiryDate = @"9900";
NSString* cardHolderName = @"MR C Cardholder";
NSString* currency = @"AUD";
[[MerchantSuiteTransaction sharedMerchantSuiteTransaction] processTransactionWithAction:paymentType invoiceAmount:txnAmmount invoiceNumber:crn1 invoiceDueDate:crn2 invoiceOrderNumber:crn3 currency:currency cardHolderName:cardHolderName cardToken:cardNumber cardExpiryDate:expiryDate UsingDelegate:self];
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TxnResp |
object Refer to Transaction Response Object |
TxnResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 884
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=wlliqq4uutv42xh0hfu134xy; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:15:15 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TxnResp" : {
"Action" : "payment",
"Amount" : 19900,
"AmountOriginal" : 19800,
"AmountSurcharge" : 100,
"Authentication3DSResponse" : null,
"AuthoriseID" : "372626",
"BankAccountDetails" : null,
"BankResponseCode" : "00",
"CVNResult" : {
"CVNResultCode" : "Unsupported"
},
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"Currency" : "AUD",
"InternalNote" : "test merchant ref",
"Is3DS" : false,
"IsCVNPresent" : true,
"MembershipID" : "MS123456",
"OriginalTxnNumber" : null,
"ProcessedDateTime" : "2014-12-12T12:15:19.6370000",
"RRN" : "434612372626",
"ReceiptNumber" : "49316411177",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"ResponseCode" : "0",
"ResponseText" : "Approved",
"PaymentReason" : null,
"SettlementDate" : "20141212",
"Source" : "api",
"StoreCard" : false,
"IsTestTxn" : false,
"SubType" : "single",
"TxnNumber" : "1177",
"Token" : null,
"Type" : "internet",
"FraudScreeningResponse" : {
"ReDResponse" : {
"FRAUD_REC_ID" : "123412341234SAX20150101100000000",
"FRAUD_RSP_CD" : "0100",
"FRAUD_STAT_CD" : "ACCEPT",
"ORD_ID" : "12341234",
"REQ_ID" : "123412341234",
"STAT_CD" : "PENDING"
},
"ResponseCode" : "",
"ResponseMessage" : "",
"TxnRejected" : false
}
}
}
2 Party Transaction Result
Retrieves details of a previously processed transaction.
URL
GET
/txns/{txnNumber}
URL Parameters
txnNumber
- transaction number of a previously processed transaction
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your GET request.
- Authorization
- base64 encoded API user credentials
Response Headers
- Content-Type
- application/json; charset=utf-8
GET https://www.merchantsuite.com/api/v2/txns/1178 HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Host: www.merchantsuite.com
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456",MerchantSuite\Mode::Live);
$txnRet = new MerchantSuite\TransactionRetrieval("1178");
$txnRet->setCredentials($credentials);
$response = $txnRet->submit();
from MerchantSuite.Requests import Credentials, TransactionResultRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TransactionResultRequest(credentials, "1178")
request.base_url = "https://www.merchantsuite.com/api/v2"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::TransactionResultRequest.new("1178")
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TxnFetchRequest txn = new TxnFetchRequest(credentials, "1178");
TxnResp resp;
txn.setBaseUrl("https://www.merchantsuite.com/api/v2");
resp = s.submit(txn);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TransactionFetchRequest->new(
txn_number => "1178",
credentials => $cred
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var txnClient = ClientFactory.
GetClientInstance<TxnClient>(new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var response = txnClient.RetrieveTxn("1178");
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.TxnFetch("0001");
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TxnResp |
object Refer to Transaction Response Object |
TxnResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 882
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:20:55 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TxnResp" : {
"Action" : "payment",
"Amount" : 19900,
"AmountOriginal" : 19800,
"AmountSurcharge" : 100,
"Authentication3DSResponse" : null,
"AuthoriseID" : "380662",
"BankAccountDetails" : null,
"BankResponseCode" : "00",
"CVNResult" : {
"CVNResultCode" : "Unsupported"
},
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"Currency" : null,
"InternalNote" : "test merchant ref",
"Is3DS" : false,
"IsCVNPresent" : true,
"MembershipID" : "MS123456",
"OriginalTxnNumber" : null,
"ProcessedDateTime" : "2014-12-12T12:21:00.8300000",
"RRN" : "434612380662",
"ReceiptNumber" : "49316511178",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"ResponseCode" : "0",
"ResponseText" : "Approved",
"PaymentReason" : "",
"SettlementDate" : "20141212",
"Source" : "api",
"StoreCard" : false,
"IsTestTxn" : false,
"SubType" : "single",
"TxnNumber" : "1178",
"Token" : null,
"Type" : "internet"
}
}
2 Party Search Transactions
Performs a search on previously processed transactions.
URL
POST
/txns/search
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your POST request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request is a SearchInput
JSON object with following properties.
Property | Type | Description |
---|---|---|
Action |
string | For this operation, one of the following values MUST be used: |
Amount |
64 bit integer |
Amount in the lowest denomination for the currency. If AUD use 12000 for $120.00. If JPY use 120 for ¥120 Optional |
AuthoriseID |
string | AuthoriseID issued by the Acquirer for approved transactions. Not all Acquirers return the AuthoriseID even if the transaction is approved. (MaxLen = 50) Optional |
BankResponseCode |
string | Response code returned from the issuing bank. (MaxLen = 2) Optional |
PaymentReason |
string | Payment Reason for the transaction. (MaxLen = 50) Optional |
CardType |
string | Defines a Card type: |
Reference1 |
string | (MaxLen = 50) Optional |
Reference2 |
string | (MaxLen = 50) Optional |
Reference3 |
string | (MaxLen = 50) Optional |
Currency |
string | Currency transaction was processed in. (MinLen = 3, MaxLen = 3) Optional |
ExpiryDate |
string |
Card expiry date In MMYY format. (MinLen = 4, MaxLen = 4) Optional |
FromDate |
string | Start date and time for a date range search, compared against transaction processed date. In ISO8601 format. (MaxLen = 50) Optional If a date and time range is not specified, the search will be conducted on the last 18 months by default. |
MaskedCardNumber |
string | Masked card number. (MaxLen = 12) Optional |
InternalNote |
string | Internal Note (MaxLen = 50) Optional |
RRN |
string | Retrieval reference number. (MaxLen = 50) Optional |
ReceiptNumber |
string | Receipt number. (MaxLen = 50) Optional |
ResponseCode |
string | Summary response code. 0 means Approved transaction. Any other value indicates Decline or Error (MaxLen = 50). To prevent fraud, we recommend this is not passed back to end customers.Optional |
SettlementDate |
string |
Date of settlement. In YYYYMMDD format. (MaxLen = 8) Optional |
Source |
string |
Defines the transaction origin: |
ToDate |
string | End date and time for a date range search, compared against transaction processed date. In ISO8601 format. (MaxLen = 50) Optional |
TxnNumber |
string | Unique transaction number.(MaxLen = 50) Optional |
POST https://www.merchantsuite.com/api/v2/txns/search HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 449
Expect: 100-continue
Connection: Keep-Alive
{
"SearchInput" : {
"Action" : null,
"Amount" : 0,
"AuthoriseID" : null,
"BankResponseCode" : null,
"CardType" : null,
"Currency" : null,
"ExpiryDate" : null,
"FromDate" : "2014-12-11T12:23:53.3897895+11:00",
"InternalNote" : null,
"MaskedCardNumber" : null,
"RRN" : null,
"ReceiptNumber" : null,
"Reference1" : null,
"Reference2" : null,
"Reference3" : null,
"ResponseCode" : null,
"PaymentReason" : null,
"SettlementDate" : null,
"Source" : null,
"ToDate" : "2014-12-12T12:23:53.3897895+11:00",
"TxnNumber" : null
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$txnSearch = new MerchantSuite\TransactionSearch();
$txnSearch->setCredentials($credentials);
$txnSearch->setReference1("Reference 1");
$txnSearch->setFromDate('2015-01-09 00:00:00');
$txnSearch->setToDate('2015-01-15 00:00:00');
$response = $txnSearch->submit();
from MerchantSuite.Requests import Credentials, TransactionSearchRequest
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TransactionSearchRequest(credentials)
request.base_url = "https://www.merchantsuite.com/api/v2"
request.action = "payment"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::TransactionSearchRequest.new()
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
req.masked_card_number = "444433...111"
response = req.submit()
import com.MerchantSuite.api.*;
import java.util.ArrayList;
import java.util.List;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TxnSearchRequest search = new TxnSearchRequest(credentials);
TransactionSearchResponse resp;
search.setBaseUrl("https://www.merchantsuite.com/api/v2");
search.setMaskedCardNumber("444433...111");
resp = s.submit(search);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TransactionSearchRequest->new(
masked_card_number => "444433...111",
currency => "AUD",
credentials => $cred,
settlement_date => "20150205",
amount => 1000
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var txnClient = ClientFactory.
GetClientInstance<TxnClient>(new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new SearchTxnsReq()
{
SearchInput = new SearchTxnsInput()
{
MaskedCardNumber = "444433...111"
}
};
var response = txnClient.SearchTxns(apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.TxnSearch({
Action : "payment",
Amount : 2157});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TxnRespList |
array Refer to Transaction Response Object |
Array of Transaction Response objects |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 1689
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=nguhp2vlyqra1iz0se3h1zmo; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:23:49 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TxnRespList" : [{
"Action" : "payment",
"Amount" : 19900,
"AmountOriginal" : 19900,
"AmountSurcharge" : 0,
"Authentication3DSResponse" : null,
"AuthoriseID" : "372626",
"BankAccountDetails" : null,
"BankResponseCode" : "00",
"CVNResult" : {
"CVNResultCode" : "Unsupported"
},
"CardDetails" : {
"CardHolderName" : null,
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"Currency" : null,
"InternalNote" : "test merchant ref",
"Is3DS" : false,
"IsCVNPresent" : true,
"MembershipID" : "MS123456",
"OriginalTxnNumber" : null,
"ProcessedDateTime" : "2014-12-12T12:15:19.6370000",
"RRN" : "434612372626",
"ReceiptNumber" : "49316411177",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"ResponseCode" : "0",
"ResponseText" : "Approved",
"PaymentReason" : null,
"SettlementDate" : "20141212",
"Source" : "api",
"StoreCard" : false,
"IsTestTxn" : false,
"SubType" : "single",
"TxnNumber" : "1177",
"Token" : null,
"Type" : "internet"
},..., {
"Action" : "payment",
"Amount" : 19900,
"AmountOriginal" : 19900,
"AmountSurcharge" : 0,
"Authentication3DSResponse" : null,
"AuthoriseID" : "380662",
"BankAccountDetails" : null,
"BankResponseCode" : "00",
"CVNResult" : {
"CVNResultCode" : "Unsupported"
},
"CardDetails" : {
"CardHolderName" : null,
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"Currency" : null,
"InternalNote" : "test merchant ref",
"Is3DS" : false,
"IsCVNPresent" : true,
"MembershipID" : "MS123456",
"OriginalTxnNumber" : null,
"ProcessedDateTime" : "2014-12-12T12:21:00.8300000",
"RRN" : "434612380662",
"ReceiptNumber" : "49316511178",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"ResponseCode" : "0",
"ResponseText" : "Approved",
"PaymentReason" : null,
"SettlementDate" : "20141212",
"Source" : "api",
"StoreCard" : false,
"IsTestTxn" : false,
"SubType" : "single",
"TxnNumber" : "1177",
"Token" : null,
"Type" : "internet"
}]
}
AuthKey
Creates a one-time AuthKey to be used with "Process Transaction" operation when using Browser integration method.
URL
POST
/txns/processtxnauthkey
Request Headers
This is a browser integration method. You will be required to supply following HTTP headers with your POST request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request includes the following parameters.
Property | Type | Description |
---|---|---|
HppParameters |
object Refer to Hpp Parameters Object |
JSON object containing the hosted payment page parameters. Optional |
ProcessTxnData |
object Refer to ProcessTxnData Object |
JSON object containing the data required to process a transaction. |
RedirectionUrl |
string | Merchant receipt redirection URL. |
WebHookUrl |
string | Merchant web hook handler URL. Optional |
IframeParameters |
object Refer to iframe Parameters Object |
JSON object containing the iframe parameters (see 3 Party Iframe). Optional |
POST https://www.merchantsuite.com/api/v2/txns/processtxnauthkey HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 292
Expect: 100-continue
Connection: Keep-Alive
{
"HppParameters" : {
"TokeniseTxnCheckBoxDefaultValue" : true,
"HidePaymentReason" : false,
"HideReference1" : false,
"HideReference2" : false,
"HideReference3" : false,
"ReturnBarLabel" : "Return Bar Label",
"ReturnBarUrl" : "http://yourmerchantwebsite.com/ReturnBarUrl"
},
"ProcessTxnData" : {
"Action" : "payment",
"Amount" : 0,
"Currency" : "AUD",
"Customer" : {
"Address" : {
"AddressLine1" : "123 Fake Street",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "Melbourne",
"CountryCode" : "AUS",
"PostCode" : "3000",
"State" : "VIC"
},
"ContactDetails" : {
"EmailAddress" : "john.smith@email.com",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"CustomerNumber" : "1234",
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "John",
"LastName" : "Smith",
"MiddleName" : "",
"Salutation" : "Mr"
}
},
"InternalNote" : "test merchant ref",
"Order" : {
"BillingAddress" : {
"Address" : {
"AddressLine1" : "",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "",
"CountryCode" : "",
"PostCode" : "",
"State" : ""
},
"ContactDetails" : {
"EmailAddress" : "",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "",
"LastName" : "",
"MiddleName" : "",
"Salutation" : ""
}
},
"OrderItems" : [{
"Comments" : "",
"Description" : "",
"GiftMessage" : "",
"PartNumber" : "",
"ProductCode" : "",
"Quantity" : 1,
"SKU" : "",
"ShippingMethod" : "",
"ShippingNumber" : "",
"UnitPrice" : 100
}, {
"Comments" : "",
"Description" : "",
"GiftMessage" : "",
"PartNumber" : "",
"ProductCode" : "",
"Quantity" : 1,
"SKU" : "",
"ShippingMethod" : "",
"ShippingNumber" : "",
"UnitPrice" : 100
}],
"ShippingAddress" : {
"Address" : {
"AddressLine1" : "",
"AddressLine2" : "",
"AddressLine3" : "",
"City" : "",
"CountryCode" : "",
"PostCode" : "",
"State" : ""
},
"ContactDetails" : {
"EmailAddress" : "",
"FaxNumber" : "",
"HomePhoneNumber" : "",
"MobilePhoneNumber" : "",
"WorkPhoneNumber" : ""
},
"PersonalDetails" : {
"DateOfBirth" : "",
"FirstName" : "",
"LastName" : "",
"MiddleName" : "",
"Salutation" : ""
}
},
Bypass3DS : false
},
"Reference1" : "test Reference1",
"Reference2" : "test Reference2",
"Reference3" : "test Reference3",
"PaymentReason" : null,
"TokenisationMode" : 3,
"TestMode" : false,
"SubType" : "single",
"Type" : "internet",
"FraudScreeningRequest" : {
"PerformFraudScreening" : "true",
"DeviceFingerprint" : "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=",
"CustomerIPAddress" : "10.1.1.1",
"TxnSourceWebsiteURL" : "www.txn-source.com",
"CustomFields" : [{"CustomField" : "A custom field"}]
},
"EmailAddress" : null,
"AmexExpressCheckout" : false,
"TokenData" : {
"Token" : "5999999789012346",
"ExpiryDate" : "0521",
"UpdateTokenExpiryDate" : false
}
},
"RedirectionUrl" : "http://yourmerchantwebsite.com/txnreceipt",
"WebHookUrl" : null,
"IframeParameters" : {
"CSS" : ".control-label{color:blue;}",
"ShowSubmitButton": true
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$hppParameters = new MerchantSuite\HppTxnFlowParameters();
$hppParameters->setTokeniseTxnCheckBoxDefaultValue(false);
$hppParameters->setHidePaymentReason(false);
$hppParameters->setHideReference1(false);
$hppParameters->setHideReference2(false);
$hppParameters->setHideReference3(false);
$hppParameters->setReturnBarLabel("Return Bar Label");
$hppParameters->setReturnBarUrl("http://yourmerchantwebsite.com/ReturnBarUrl");
$iframeParameters = new MerchantSuite\IframeParameters();
$iframeParameters->setCSS(".control-label{color:blue;}");
$iframeParameters->setShowSubmitButton(true);
$tokenData = new MerchantSuite\TokenData();
$tokenData->setToken("5999999789012346");
$tokenData->setExpiryDate("0521");
$tokenData->setUpdateTokenExpiryDate(false);
$customField = new MerchantSuite\CustomField();
$customField->setCustomField("A custom field");
$customFieldArray = array();
$customFieldArray[] = $customField;
$fraudScreeningRequest = new MerchantSuite\FraudScreeningRequest();
$fraudScreeningRequest->setPerformFraudScreening(true);
$fraudScreeningRequest->setDeviceFingerprint("0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");
$fraudScreeningRequest->setCustomerIPAddress("10.1.1.1");
$fraudScreeningRequest->setTxnSourceWebsiteURL("www.txn-source.com");
$fraudScreeningRequest->setCustomFields($customFieldArray);
$txn = new MerchantSuite\AuthKeyTransaction();
$txn->setAction(MerchantSuite\Actions::Payment);
$txn->setCredentials($credentials);
$txn->setAmount(20000);
$txn->setCurrency("AUD");
$txn->setInternalNote("Authkey Request");
$txn->setReference1("Authkey Reference 1");
$txn->setReference2("Authkey Reference 2");
$txn->setReference3("Authkey Reference 3");
$txn->setRedirectionURL("http://yourmerchantwebsite.com/tokenreceipt");
$txn->setTokenisationMode(3);
$txn->setHppParameters($hppParameters);
$txn->setAmexExpressCheckout(false);
$txn->setIframeParameters($iframeParameters);
$txn->setTokenData($tokenData);
$txn->setFraudScreeningRequest($fraudScreeningRequest);
$txn->setBypass3DS(false);
$response = $txn->submit();
from MerchantSuite.Requests import Credentials, TransactionAuthKeyRequest,\
HppTxnFlowParameters, IframeParameters, FraudScreeningRequest, CustomField
from MerchantSuite.Utils import TokenData
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
hpp_parameters = HppTxnFlowParameters()
hpp_parameters.tokenise_txn_check_box_default_value = True
hpp_parameters.hide_payment_reason = False
hpp_parameters.hide_reference1 = False
hpp_parameters.hide_reference2 = False
hpp_parameters.hide_reference3 = False
hpp_parameters.return_bar_label = "Return Bar Label"
hpp_parameters.return_bar_url = "http://yourmerchantwebsite.com/ReturnBarUrl"
token_data = TokenData()
token_data.token = "5999999789012346"
token_data.expiry_date = "0521"
token_data.update_token_expiry_date = False
iframe_parameters = IframeParameters()
iframe_parameters.css = ".control-label{color:blue;}"
iframe_parameters.show_submit_button = True
custom_field = CustomField()
custom_field.custom_field = "A custom field"
fraud_screening_request = FraudScreeningRequest()
fraud_screening_request.perform_fraud_screening = True
fraud_screening_request.device_fingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
fraud_screening_request.customer_ip_address = "10.1.1.1"
fraud_screening_request.txn_source_website_url = "www.txn-source.com"
fraud_screening_request.custom_fields = [custom_field]
request = TransactionAuthKeyRequest(credentials)
request.base_url = "https://www.merchantsuite.com/api/v2"
request.hpp_parameters = hpp_parameters
request.token_data = token_data
request.action = "payment"
request.amount = 200
request.currency = "AUD"
request.reference1 = "Ref One"
request.redirection_url = "http://yourmerchantwebsite.com/tokenreceipt"
request.tokenisation_mode = 3
request.amex_express_checkout = False
request.iframe_parameters = iframe_parameters
request.fraud_screening_request = fraud_screening_request
request.bypass_3_ds = False
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
hpp = MerchantSuite::HppTxnFlowParameters.new
hpp.tokenise_txn_check_box_default_value = true
hpp.hide_payment_reason = false
hpp.hide_reference1 = false
hpp.hide_reference2 = false
hpp.hide_reference3 = false
hpp.return_bar_label = "Return Bar Label"
hpp.return_bar_url = "http://yourmerchantwebsite.com/ReturnBarUrl"
token_data = MerchantSuite::TokenData.new
token_data.token = "5999999789012346"
token_data.expiry_date = "0521"
token_data.update_token_expiry_date = false
iframe_parameters = MerchantSuite::IframeParameters.new
iframe_parameters.css = ".control-label{color:blue;}"
iframe_parameters.show_submit_button = true
custom_field = MerchantSuite::CustomField.new
custom_field.custom_field = "A custom field"
fraud_screening_request = MerchantSuite::FraudScreeningRequest.new
fraud_screening_request.perform_fraud_screening = true
fraud_screening_request.device_fingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
fraud_screening_request.customer_ip_address = "10.1.1.1"
fraud_screening_request.txn_source_website_url = "www.txn-source.com"
fraud_screening_request.custom_fields = [custom_field]
req = MerchantSuite::TransactionAuthKeyRequest.new
req.base_url = "https://www.merchantsuite.com/api/v2"
req.action = "payment"
req.amount = 200
req.reference1 = "Authkey Test 1"
req.internal_note = "Reference for merhcant"
req.redirection_url = "http://yourmerchantwebsite.com"
req.currency = "AUD"
req.tokenisation_mode = 3
req.credentials = cred
req.hpp_parameters = hpp
req.amex_express_checkout = false
req.iframe_parameters = iframe_parameters
req.token_data = token_data
req.fraud_screening_request = fraud_screening_request
req.bypass_3_ds = false
response = req.submit()
import com.MerchantSuite.api.*;
import java.util.ArrayList;
import java.util.List;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
HppParameters hppParameters = new HppParameters();
hppParameters.setTokeniseTxnCheckBoxDefaultValue(true);
hppParameters.setHidePaymentReason(true);
hppParameters.setHideReference1(true);
hppParameters.setHideReference2(true);
hppParameters.setHideReference3(true);
hppParameters.setReturnBarLabel("Return Bar Label");
hppParameters.setReturnBarUrl("http://yourmerchantwebsite.com/ReturnBarUrl");
IframeParameters iframeParameters = new IframeParameters();
iframeParameters.setCSS(".control-label{color:blue;}");
iframeParameters.setShowSubmitButton(true);
TokenData tokenData = new TokenData();
tokenData.setToken("5999999789012346");
tokenData.setExpiryDate("0521");
tokenData.setUpdateTokenExpiryDate(false);
CustomField customField = new CustomField();
customField.setCustomField("A custom field");
List<CustomField> customFieldArray = new ArrayList<CustomField>();
customFieldArray.add(customField);
FraudScreeningRequest fraudScreeningRequest = new FraudScreeningRequest();
fraudScreeningRequest.setPerformFraudScreening(true);
fraudScreeningRequest.setDeviceFingerprint("0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");
fraudScreeningRequest.setCustomerIPAddress("10.1.1.1");
fraudScreeningRequest.setTxnSourceWebsiteURL("www.txn-source.com");
fraudScreeningRequest.setCustomFields(customFieldArray);
ProcessTxnData txn = new ProcessTxnData();
txn.setAmount((long) 100);
txn.setReference1("Java AuthKey Reference 1");
txn.setAction("payment");
txn.setCurrency("AUD");
txn.setTestMode(false);
txn.setTokenisationMode(TokenisationMode.TOKENISE);
txn.setAmexExpressCheckout(false);
txn.setTokenData(tokenData);
txn.setBypass3DS(false);
txn.setFraudScreeningRequest(fraudScreeningRequest);
TxnAuthKeyRequest req = new TxnAuthKeyRequest(credentials);
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setProcessTxnData(txn);
req.setRedirectionUrl("http://www.mywebsite.com");
req.setWebHookUrl("http://www.mywebsite.com");
req.setHppParameters(hppParameters);
req.setIframeParameters(iframeParameters);
AuthKeyResponse resp;
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
my $hppParameters = MerchantSuite::HppTxnFlowParameters->new(
tokenise_txn_check_box_default_value => 1,
hide_payment_reason => 0,
hide_reference1 => 0,
hide_reference2 => 0,
hide_reference3 => 0,
return_bar_label => "Return Bar Label",
return_bar_url => "http://yourmerchantwebsite.com/ReturnBarUrl"
);
my $tokenData = MerchantSuite::TokenData->new(
token => "5999999789012346",
expiry_date => "0521",
update_token_expiry_date => 0
);
my $iframeParameters = MerchantSuite::IframeParameters->new(
css => ".control-label{color:blue;}",
show_submit_button => 1
);
my $customField = MerchantSuite::CustomField->new( custom_field => "A custom field");
my @customFieldArray = ($customField);
my $fraudScreeningRequest = MerchantSuite::FraudScreeningRequest->new(
perform_fraud_screening => 1,
device_fingerprint => "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=",
customer_ip_address => "10.1.1.1",
txn_source_website_url => "www.txn-source.com",
);
@{$fraudScreeningRequest->{custom_fields}} = @customFieldArray;
$req = MerchantSuite::TransactionAuthKeyRequest->new(
action => "payment",
redirection_url => "http://yourmerchantwebsite.com",
reference1 => "This is a reference",
amount => 12345,
credentials => $cred,
tokenisation_mode => 3,
hpp_parameters => $hppParameters,
amex_express_checkout => 0,
iframe_parameters => $iframeParameters,
token_data => $tokenData,
fraud_screening_request => $fraudScreeningRequest,
bypass_3_ds => 0
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var txnClient = ClientFactory.
GetClientInstance<TxnClient>(new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new CreateProcessTxnAuthKeyReq
{
WebHookUrl = null,
RedirectionUrl = "http://yourmerchantwebsite.com/txnreceipt",
ProcessTxnData = new ProcessTxnData
{
TestMode = false,
Action = "payment",
PaymentReason = null,
InternalNote = "test merchant ref",
Reference1 = "test Reference1",
Reference2 = "test Reference2",
Reference3 = "test Reference3",
Currency = "AUD",
Amount = 0,
AmountOriginal = 0,
AmountSurcharge = 0,
TokenisationMode = 0,
AmexExpressCheckout = false,
TokenData = new TokenDetails
{
Token = "5999999789012346",
ExpiryDate = "0521",
UpdateTokenExpiryDate = false
},
Customer = new Customer
{
ContactDetails = new ContactDetails
{
EmailAddress = "email@address.com"
}
},
FraudScreeningRequest = new FraudScreeningRequest
{
PerformFraudScreening = true,
FraudScreeningDeviceFingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=",
CustomerIPAddress = "10.1.1.1",
SourceWebsiteURL = "www.txn-source.com",
CustomFields = new [] { new CustomField{CustomFieldMember = "A custom field"} }
},
Bypass3DS = false
},
HppParameters = new HppTxnFlowParameters
{
TokeniseTxnCheckBoxDefaultValue = true,
HidePaymentReason = false,
HideReference1 = false,
HideReference2 = false,
HideReference3 = false,
ReturnBarLabel = "Return Bar Label",
ReturnBarUrl = "http://yourmerchantwebsite.com/ReturnBarUrl"
},
IframeParameters = new IframeFlowParameters
{
CSS = ".control-label{color:blue;}",
ShowSubmitButton = true
}
};
var response = txnClient.CreateProcessTxnAuthKey(apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var hppParameters = new api.HppTxnFlowParameters({
TokeniseTxnCheckBoxDefaultValue : true,
HidePaymentReason : false,
HideReference1 : false,
HideReference2 : false,
HideReference3 : false,
ReturnBarLabel : "Return Bar Label",
ReturnBarUrl : "http://yourmerchantwebsite.com/ReturnBarUrl"
});
var tokenData = new api.TokenData({
Token : "5999999789012346",
ExpiryDate : "0521",
UpdateTokenExpiryDate : false
});
var customField = new api.CustomField({CustomField :"A custom field"});
var fraudScreeningRequest = new api.FraudScreeningRequest({
PerformFraudScreening : true,
DeviceFingerprint : "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=",
CustomerIPAddress : "10.1.1.1",
TxnSourceWebsiteURL : "www.txn-source.com",
CustomFields : [customField]
});
var iframeParameters = new api.IframeParameters({
CSS : ".control-label{color:blue;}",
ShowSubmitButton : true
});
var req = new api.TxnAuthKey({
Action: "payment",
Amount : 2100,
Reference1: "NodeJS AuthKey Test 1",
TestMode : false,
Currency: "AUD",
RedirectionUrl : "http://yourmerchantwebsite.com/",
HppParameters : hppParameters,
AmexExpressCheckout : false,
IframeParameters : iframeParameters,
TokenData : tokenData,
FraudScreeningRequest : fraudScreeningRequest,
Bypass3DS : false
});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"
});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Configure the ApiConfig.java file to input your API user and Merchant credentials
import main.java.com.merchantsuite.android.api.ApiManager;
String paymentAction = "payment";
float txnAmount = 25.50f;
String crn1 = "A CRN";
String crn2 = "A CRN";
String crn3 = "A CRN";
String paymentCurrency = "AUD"
String response = ApiManager.createAnAuthKeyToProcessTransactionWithAction(paymentAction,txnAmount, crn1, crn2, crn3, paymentCurrency);
//Configure the MerchantSuiteApiConfig.h file to input your API user and Merchant credentials
#import <Foundation/Foundation.h>
#import <bPointSDK/bPointSDK.h>
NSString* paymentType = @"payment";
GCFLoat txnAmmount = 25.50f;
NSString* crn1 = @"A CRN";
NSString* currency = @"AUD";
[[MerchantSuiteTransaction sharedMerchantSuiteTransaction] createUrlToProcessTransactionWithAction:paymentType invoiceAmount:txnAmmount invoiceNumber:crn1 currency:currency UsingDelegate:self];
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
AuthKey |
string | Unique key that the merchant must use when invoking the "Process Transaction" operation using Browser integration method. The AuthKey is returned only if the API response code indicates success. |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 108
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=5g35ug3awdd5pifyctnrveol; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:27:07 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"AuthKey" : "df998fea-f309-4e6e-9629-7149799dc028"
}
Webform
Processes a transaction.
Note: This request is made directly from the cardholder's browser. The browser will also automatically handle the response and redirect the cardholder to merchant's redirection URL and optionally perform a server-to-server callback (see section WebHooks). Should neither of these be received, a Search Transactions call (see 2 Party Search Transactions) should be made to determine the transaction outcome.
URL
POST
/txns/webform/process
Request Headers
This is a browser integration method. You will be required to supply following HTTP headers with your POST request.
- Content-Type
- application/x-www-form-urlencoded charset=utf-8
Response Headers
- Location
- merchant's redirection URL, API response appended to query string
Request
Request is a Form with following properties.
Property | Type | Description |
---|---|---|
Amount |
string |
Transaction amount. Ignored if provided in "Create AuthKey" request. |
AmountOriginal |
string | Total payment amount without surcharge - this field is for information and reporting only and does not alter the value of the transaction (as specified by Amount) Optional |
AmountSurcharge |
string | Surcharge amount for payment - this field is for information and reporting only and does not alter the value of the transaction (as specified by Amount) Optional |
AuthKey |
string | Unique key created using "Create AuthKey" operation (MaxLen = 500) |
PaymentReason |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
CardHolderName |
string | Cardholder name (MaxLen = 50) Optional |
CardNumber |
string | Card number(MinLen = 13, MaxLen = 16) |
Reference1 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) |
Reference2 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
Reference3 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
Currency |
string |
The currency that the transaction is to be processed in as an ISO 4217 code (see section Currency List) Your bank merchant account must be configured to accept the currency used in this field. Please speak to your bank if you are unsure what currencies your bank merchant account can transact in (MinLen = 3, MaxLen = 3). Optional |
CVN |
string | Card verification number (MinLen = 3, MaxLen = 4) |
ExpiryDateMonth |
string |
Card expiry date month In MM format (MinLen = 2, MaxLen = 2) |
ExpiryDateYear |
string |
Card expiry date year In YY format (MinLen = 2, MaxLen = 2) |
InternalNote |
string | Reference that is for internal use only. Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
StoreCard |
boolean |
Flag to indicate whether the cardholder agrees to save their card details. This flag allows merchant to create a token from the card details used to process the transaction. (if present must be either "true" or "false") Optional |
POST https://www.merchantsuite.com/api/v2/txns/webform/process HTTP/1.1
Content-Type: application/x-www-form-urlencoded charset=utf-8
Host: www.merchantsuite.com
Content-Length: 276
Expect: 100-continue
&PaymentReason=&InternalNote=test+merchant+ref&Reference1=test+reference1&Reference2=test+reference2&Reference3=test+reference3&Amount=199.00&CardNumber=5123456789012346&ExpiryDateMonth=05&ExpiryDateYear=17&CVN=123&CardHolderName=John+Smith&StoreCard=0&AuthKey=df998fea-f309-4e6e-9629-7149799dc028
Response Location
Merchant's redirection URL, API response appended to query string
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: http://yourmerchantwebsite.com/txnreceipt?ResponseCode=0&ResponseText=Success&ResultKey=13cfa799-8278-4872-a705-7ed49d516c0b
Set-Cookie: ASP.NET_SessionId=3cddgyr1zk3zl4oiwciqdvzd; path=/; secure; HttpOnly
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:27:09 GMT
Content-Length: 0
JavaScript - Simple
The API JavaScript makes it easy to process card payments without having sensitive data pass through your servers.
Including api.js
Add this script tag to your page (preferably at the bottom) to get started with the JavaScript API.
<script src="https://www.merchantsuite.com/api/merchantsuite/api.js?v=2" type="text/javascript"></script>
Setting up payment form
This is all you need to start processing payments with MerchantSuite. The MerchantSuite JavaScript library will process the payment and redirect the browser to the "RedirectionUrl" supplied when the AuthKey was created (Refer AuthKey). At the end of the redirection, invoke the "Retrieve Payment Result" call (Refer Transaction Result) from your web server to retrieve the payment result and render the payment receipt to your customers.
The three parameters in the sample code are compulsory. There are several optional parameters, which you can pass to the "SetupPayment" method to further customise the payment form as required. Please find below information about the parameters which you can pass to the "SetupPayment" method.
merchantsuite.SetupPayment({
AppendToElementId: "pay-form-location",
AuthKey: $("#AuthKey").val(),
DefaultErrorUrl: "https://www.yourdomain.com/handleerror"
});
Property | Type | Description |
---|---|---|
AppendToElementId |
string | ID of the HTML element on your page where you want the payment form to be inserted. |
AuthKey |
string | Unique key created using "Create AuthKey" operation (Refer AuthKey). You may store this in a hidden field and then pass the value. (MaxLen = 500) |
DefaultErrorUrl |
string | A fall-back URL which the browser is redirected to if a response is not received. |
PaymentReason |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Payment Reason field on the page. Optional |
Reference1 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 1 field on the page. Optional |
Reference2 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 2 field on the page. Optional |
Reference3 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 3 field on the page. Optional |
InternalNote |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Internal Note field on the page. Optional |
Amount |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display amount field on the page. Optional |
StoreCard |
object Refer to Json Object |
Include this object with appropriate flags if you wish to offer option for your user to store the card details for future use. This will render a checkbox on the payment form. Optional |
Type |
string | Specifies the capture type: |
TruncatedCardNumberValue |
string | If provided this variable will be displayed as the truncated card number. |
ExpiryDateValue |
string | Card expiry date In MMYY format. |
JavaScript - Advanced
"SetupPayment" as explained above is the simple approach to begin processing payments using the API. For more control over the user experience, please follow the custom payment method as described below.
Process payment
Invoke the process payment method as explained below when you are ready to process the payment e.g. a button click. "ProcessPayment" is an asynchronous call - it returns immediately and invokes the "CallbackFunction" when it receives a response from the server.
merchantsuite.ProcessPayment({
AuthKey: $("#AuthKey").val(),
PaymentReason: $("#PaymentReason").val(),
Reference1: $("#Reference1").val(),
Reference2: $("#Reference2").val(),
Reference3: $("#Reference3").val(),
InternalNote: $("#InternalNote").val(),
EmailAddress: $("#EmailAddress").val(),
Amount: $("#Amount").val(),
AmountOriginal: $("#AmountOriginal").val(),
AmountSurcharge: $("#AmountSurcharge").val(),
Currency: $("#Currency").val(),
CardNumber: $("#CardNumber").val(),
CVN: $("#CVN").val(),
ExpiryMonth: $("#ExpMonth").val(),
ExpiryYear: $("#ExpYear").val(),
CardHolderName: $("#CardHolderName").val(),
StoreCard: $("#StoreCard").prop("checked"),
CallbackFunction: ProcessPaymentCallBack
Type: $("#Type").val()
});
Property | Type | Description |
---|---|---|
AuthKey |
string | Unique key created using "Create AuthKey" operation (Refer AuthKey). You may store this in a hidden field and then pass the value. (MaxLen = 500) |
PaymentReason |
string | Payment Reason to attach to a payment (MaxLen = 50) Optional |
Reference1 |
string | Reference 1 for the payment. This is optional if supplied while creating the AuthKey (Refer AuthKey) (MaxLen = 50). |
Reference2 |
string | Reference 2 for the payment Optional (MaxLen = 50). |
Reference3 |
string | Reference 3 for the payment Optional (MaxLen = 50). |
InternalNote |
string | Internal Note for the payment Optional (MaxLen = 50). |
EmailAddress |
string | Customer's email address. (MaxLen = 250) Optional |
Currency |
string |
The currency that the transaction is to be processed in as an ISO 4217 code (see section Currency List) Your bank merchant account must be configured to accept the currency used in this field. Please speak to your bank if you are unsure what currencies your bank merchant account can transact in (MinLen = 3, MaxLen = 3). Optional |
Amount |
string | Amount to process Optionalif supplied while creating the AuthKey (Refer AuthKey) |
AmountOriginal |
string | Total payment amount without surcharge - this field is for information and reporting only and does not alter the value of the transaction (as specified by Amount) Optional |
AmountSurcharge |
string | Surcharge amount for payment - this field is for information and reporting only and does not alter the value of the transaction. (as specified by Amount) Optional |
CardNumber |
numeric | Card number you wish to charge |
CVN |
numeric | Card verification number |
ExpiryMonth |
numeric | Expiry month of the card |
ExpiryYear |
numeric | Expiry year of the card |
CardHolderName |
string | Name on the card Optional |
StoreCard |
boolean | Set this flag if you wish to create a token to store the card details for future use. Alternatively you may render a checkbox on your form for your customer to opt in. Optional |
CallbackFunction |
function | This is a callback you provide to handle the response from the API. Please see below for more information on this. |
Type |
string | Specifies the capture type: |
The "CallbackFunction" is a JavaScript function you provide to handle the response from the API. It does the following:
- If the payment information returned an error, display it on the page; or
- If an error was not returned, then submit the result back to your server to call the "Retrieve Transaction Result" (Refer AuthKey) and render the receipt. If you are integrating for a shopping cart then this would be the time to check out the cart. Note: It is recommended that you do not submit the card details to your server, and only submit the result of the call back to your server.
function ProcessPaymentCallBack(result) {
var errors = new Array();
if (result.AjaxResponseType == 0) {
//AJAX call was successful
if (result.ApiResponseCode == 0) {
//API returned success.
//Refer to (API Response Codes) for API Response codes.
//Submit result.ResultKey to your server for further
//processing (Refer Transaction Result)
}
else if (result.ApiResponseCode == 300) {
if (result.RedirectionUrl != null && result.RedirectionUrl.length > 0)
window.location.href = result.RedirectionUrl;
else
errors = result.Errors;
}
else {
errors = result.Errors;
}
}
else if(result.AjaxResponseType == 1) {
//Error with AJAX call
errors = result.Errors;
}
else if(result.AjaxResponseType == 2) {
//AJAX call timed out
errors = result.Errors;
}
//Show errors on the page
if (errors.length > 0) {
var ul = $("<ul></ul>");
$.each(errors, function (i, r) {
ul.append("<li>" + r.Message + "</li>");
});
$(".validation-summary").append(ul).show();
}
}
Result Object
The result object is described as below.
Property | Type | Description |
---|---|---|
AjaxResponseType |
numeric | This is the result of the AJAX call. This will assist you in handling the call back. |
ApiResponseCode |
numeric | This is the response code returned by the API |
Errors |
array Refer to Error Object |
List of errors returned. |
ResultKey |
string | This is the result key that you will have to submit to retrieve the transaction result and present the receipt to the customer,"Retrieve Transaction Result" (Refer Transaction Result). |
RedirectionUrl |
string | URL to use for redirection (if you receive an ApiResponseCode of 300, perform a full browser redirect with this value). |
3 Party Redirect
Note: The payment page presented to the cardholder comes directly from MerchantSuite.
To process a transaction using this method, the cardholder's browser must be directed to the appropriate URL using either a hyperlink or HTTP 302 redirect. In both cases, two values are required to be included:
- merchantAlias, By default this is the same as your MerchantSuite Membership ID (for example, MS123456)
- authKey - Obtained via AuthKey call
Hyperlink example
Render a link on your page similar to the following - this will direct the cardholder to the Hosted Payment Page
<a href="https://www.merchantsuite.com/pay/{MerchantAlias}?in_pay_token={authKey}">Proceed to payment</a>
Redirect example
Send the following HTTP 302 Redirect to the cardholder's browser - this will direct the cardholder to the Hosted Payment Page
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: https://www.merchantsuite.com/pay/{MerchantAlias}?in_pay_token={authKey}
Response
An API response will be appended to the query string of the redirection URL specified in the authkey request.
China UnionPay transactions will always have a response code of "P". You will need to poll MerchantSuite using the 2 Party Search Transaction method to obtain the result. China UnionPay only returns a response for approved transactions. If the transaction is not completed and approved within 2 hours then a response code of "x" - "description" will be returned.
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: http://yourmerchantwebsite.com/txnreceipt?ResponseCode=0&ResponseText=Success&ResultKey=13cfa799-8278-4872-a705-7ed49d516c0b
Set-Cookie: ASP.NET_SessionId=3cddgyr1zk3zl4oiwciqdvzd; path=/; secure; HttpOnly
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:27:09 GMT
Content-Length: 0
3 Party Iframe
There are two available methods.
- Submit button inside iframe (multi page / button mode)
- Submit button outside iframe (single page / button mode)
Submit button inside example
If IframeParameters.ShowSubmitButton is set to true in create AuthKey request (see AuthKey) then the iframe payment page will operate in the multi-page / button mode. In this mode the "Process Iframe Payment" method (See submit button outside example) does not need to be invoked. Instead, the ProcessTxnData.Amount and ProcessTxnData.Crn1 parameters need to be submitted in the create AuthKey call.
<iframe src="https://www.merchantsuite.com/api/v2/txns/iframe/{authKey}" frameborder="0"></iframe>
Clicking the "Submit" button inside iframe will process the payment and will redirect the iframe to the RedirectionUrl specified in the AuthKey request.
http://yourmerchantwebsite.com/txnreceipt?ResponseCode=0&ResponseText=Success&ResultKey=13cfa799-8278-4872-a705-7ed49d516c0b
Request
The Process Iframe Payment request is a TxnReq
(transaction request details) JSON object with the following properties.
Property | Type | Description |
---|---|---|
AuthKey |
string | Unique key created using "Create AuthKey" operation (see AuthKey) |
Amount |
string |
If AUD use 120.00 for $120.00. If JPY use 120 for ¥120.Optional Ignored if provided in "Create AuthKey" request. |
AmountOriginal |
string | Total payment amount without surcharge - this field is for information and reporting only and does not alter the value of the transaction (as specified by Amount) Optional |
AmountSurcharge |
string | Surcharge amount for payment - this field is for information and reporting only and does not alter the value of the transaction (as specified by Amount) Optional |
PaymentReason |
string | Ignored if provided in "Create AuthKey" request Optional |
CardDetails |
object Refer to Card Details Object |
|
Reference1 |
string | Ignored if provided in "Create AuthKey" request |
Reference2 |
string | Ignored if provided in "Create AuthKey" request Optional |
Reference3 |
string | Ignored if provided in "Create AuthKey" request Optional |
EmailAddress |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 250) Optional |
Currency |
string |
The currency that the transaction is to be processed in as an ISO 4217 code (see section Currency List) Your bank merchant account must be configured to accept the currency used in this field. Please speak to your bank if you are unsure what currencies your bank merchant account can transact in (MinLen = 3, MaxLen = 3). Optional |
InternalNote |
string | Reference that is for internal use only. Ignored if provided in "Create AuthKey" request Optional |
StoreCard |
boolean | Flag to indicate whether the cardholder agrees to save their card details. This flag allows merchant to create a token from the card details used to process the transaction. Optional |
FraudScreeningDeviceFingerprint |
string | Machine fingerprint for fraud screening.Optional |
Submit button outside example
If IframeParameters.ShowSubmitButton is either not set (default) or set to false in create AuthKey call (see AuthKey) then the iframe payment page will operate in the single page / button mode. In this mode as the consumer enters their details into the card fields (card number, expiry date and cvn), it will get stored on the AuthKey session. The Process Iframe Payment (https://www.merchantsuite.com/api/v2/txns/processiframetxn/{authKey}) function will need to be invoked to process the payment, this can be either an ajax call or a server to server call.
Server to server example
POST https://www.merchantsuite.com/api/v2/txns/processiframetxn/{authKey} HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 292
Expect: 100-continue
Connection: Keep-Alive
{
"TxnReq" : {
"Amount" : "101.00",
"AmountOriginal" : "100.00",
"AmountSurcharge" : "1.00",
"Currency" : "AUD",
"InternalNote" : "test merchant reference",
"Reference1" : "Transaction Reference 1",
"Reference2" : "Transaction Reference 2",
"Reference3" : "Transaction Reference 3",
"PaymentReason" : "00Example00",
"StoreCard" : false,
"EmailAddress" : "user@test.com",
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDateMonth" : "07",
"ExpiryDateYear" : "20"
},
"FraudScreeningDeviceFingerprint" : "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$cardDetails = new MerchantSuite\AuthKeyCardDetails();
$cardDetails->setCardHolderName("John Smith");
$cardDetails->setExpiryDateMonth("07");
$cardDetails->setExpiryDateYear("20");
$txnWithAuth = new MerchantSuite\TransactionWithAuthKey();
$txnWithAuth->setAmount("101.00");
$txnWithAuth->setAmountOriginal("100.00");
$txnWithAuth->setAmountSurcharge("1.00");
$txnWithAuth->setCardDetails($cardDetails);
$txnWithAuth->setCurrency("AUD");
$txnWithAuth->setReference1("Transaction Reference 1");
$txnWithAuth->setReference2("Transaction Reference 2");
$txnWithAuth->setReference3("Transaction Reference 3");
$txnWithAuth->setEmailAddress("user@test.com");
$txnWithAuth->setStoreCard(false);
$txnWithAuth->setPaymentReason("00Example00");
$txnWithAuth->setInternalNote("test merchant reference");
$txnWithAuth->setFraudScreeningDeviceFingerprint("0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");
$processIframeTxn = new MerchantSuite\ProcessIframeTxn("df998fea-f309-4e6e-9629-7149799dc028");
$processIframeTxn->setCredentials($credentials);
$processIframeTxn->setProcessTransactionWithAuthKey($txnWithAuth);
$response = $processIframeTxn->submit();
from MerchantSuite.Requests import Credentials, TransactionWithAuthKeyRequest,\
ProcessIframeTxnRequest
from MerchantSuite.Utils import AuthKeyCardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
card_details = AuthKeyCardDetails()
card_details.card_holder_name = "a name"
card_details.expiry_date_month = "07"
card_details.expiry_date_year = "20"
txn_with_auth = TransactionWithAuthKeyRequest()
txn_with_auth.reference1 = "Transaction Reference 1"
txn_with_auth.reference2 = "Transaction Reference 2"
txn_with_auth.reference3 = "Transaction Reference 3"
txn_with_auth.amount = "101.00"
txn_with_auth.amount_original = "100.00"
txn_with_auth.amount_surcharge = "1.00"
txn_with_auth.currency = "AUD"
txn_with_auth.internal_note = "test merchant reference"
txn_with_auth.payment_reason = "00Example00"
txn_with_auth.store_card = False
txn_with_auth.card_details = card_details
txn_with_auth.email_address = "user@test.com"
txn_with_auth.fraud_screening_device_fingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
request = ProcessIframeTxnRequest(credentials,"df998fea-f309-4e6e-9629-7149799dc028")
request.base_url = "https://www.merchantsuite.com/api/v2"
request.process_transaction_with_auth_key_request = txn_with_auth
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
card_details = MerchantSuite::AuthKeyCardDetails.new()
card_details.card_holder_name = "a name"
card_details.expiry_date_month = "07"
card_details.expiry_date_year = "20"
txn_with_auth = MerchantSuite::TransactionWithAuthKeyRequest.new()
txn_with_auth.amount = "101.00"
txn_with_auth.amount_original = "100.00"
txn_with_auth.amount_surcharge = "1.00"
txn_with_auth.card_details = card_details
txn_with_auth.currency = "AUD"
txn_with_auth.email_address = "user@test.com"
txn_with_auth.internal_note = "test merchant reference"
txn_with_auth.payment_reason = "00Example00"
txn_with_auth.store_card = false
txn_with_auth.fraud_screening_device_fingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
req = MerchantSuite::ProcessIframeTxnRequest.new("df998fea-f309-4e6e-9629-7149799dc028")
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
req.proess_transaction_with_auth_key_request = txn_with_auth
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
CreditCardDetailsWith2PartExpiryDate cardDetails = new CreditCardDetailsWith2PartExpiryDate();
cardDetails.setCardHolderName("a name");
cardDetails.setExpiryDateMonth("07");
cardDetails.setExpiryDateYear("20");
TxnRequestWithAuthKey txnWithAuth = new TxnRequestWithAuthKey();
txnWithAuth.setAmount("101.00");
txnWithAuth.setAmountOriginal("100.00");
txnWithAuth.setAmountSurcharge("1.00");
txnWithAuth.setCurrency("AUD");
txnWithAuth.setReference1("Transaction Reference 1");
txnWithAuth.setReference2("Transaction Reference 2");
txnWithAuth.setReference3("Transaction Reference 3");
txnWithAuth.setCardDetails(cardDetails);
txnWithAuth.setPaymentReason("00Example00");
txnWithAuth.setInternalNote("test merchant reference");
txnWithAuth.setEmailAddress("user@test.com");
txnWithAuth.setStoreCard(false);
txnWithAuth.setFraudScreeningDeviceFingerprint("0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");
ProcessTxnWithAuthKeyReq processTxnAuthReq = new ProcessTxnWithAuthKeyReq();
processTxnAuthReq.setTxnReq(txnWithAuth);
ProcessIframeTxnRequest req = new ProcessIframeTxnRequest(credentials,"df998fea-f309-4e6e-9629-7149799dc028");
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setProcessTxnWithAuthKeyReq(processTxnAuthReq);
ProcessTxnWithAuthKeyResp resp;
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $authCardDetails = MerchantSuite::AuthKeyCardDetails->new(
card_holder_name => "A name",
expiry_date_month => "07",
expiry_date_year => "20"
);
my $authkeytxnreq = MerchantSuite::TransactionRequestWithAuthKey->new(
auth_card_details => $authCardDetails,
amount => "101.00",
amount_original => "100.00",
amount_surcharge => "1.00",
currency => "AUD",
reference1 => "Transaction Reference 1",
reference2 => "Transaction Reference 2",
reference3 => "Transaction Reference 3",
internal_note => "test merchant reference",
payment_reason => "00Example00",
store_card => 0,
email_address => "user@test.com",
fraud_screening_device_fignerprint => "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
);
my $processtTxnWithAuthReq = MerchantSuite::ProcessTxnWithAuthKeyRequest->new(
txn_request_with_auth_key => $authkeytxnreq
);
my $req = MerchantSuite::ProcessIframeTxnRequest->new(
credentials => $cred
process_txn_with_auth_key_request => $processtTxnWithAuthReq,
auth_key => "df998fea-f309-4e6e-9629-7149799dc028"
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var txnClient = ClientFactory.
GetClientInstance<TxnClient>(new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new ProcessTxnWithAuthKeyReq
{
TxnReq = new TxnRequestWithAuthKey
{
Amount = "101.00",
AmountOriginal = "100.00",
AmountSurcharge = "1.00",
PaymentReason = "00Example00",
CardDetails = new CreditCardDetailsWith2PartExpiryDate
{
CardHolderName = "A name",
ExpiryDateMonth = "07",
ExpiryDateYear = "20"
},
Reference1 = "Transaction Reference 1",
Reference2 = "Transaction Reference 2",
Reference3 = "Transaction Reference 3",
Currency = "AUD",
EmailAddress = "user@test.com",
FraudScreeningDeviceFingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=",
InternalNote = "test merchant reference",
StoreCard = false
}
};
var response = txnClient.ProcessIframeTxn("df998fea-f309-4e6e-9629-7149799dc028",apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var cardDetails = new api.AuthKeyCardDetails({
CardHolderName : "A name",
CardExpiryMonth : "07",
CardExpiryYear : "20"
});
var txnWithAuth = new api.TxnRequestWithAuthKey({
Amount : "101.00",
AmountOriginal : "100.00",
AmountSurcharge : "1.00",
CardDetails : cardDetails,
Currency : "AUD",
EmailAddress : "user@test.com",
InternalNote : "test merchant reference",
Reference1 : "Transaction Reference 1",
Reference2 : "Transaction Reference 2",
Reference3 : "Transaction Reference 3",
PaymentReason : "00Example00",
StoreCard : false,
FraudScreeningDeviceFingerprint : "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
});
var processTxnAuthReq = new api.ProcessTxnWithAuthKeyReq({
TxnRequestWithAuthKey : txnWithAuth
});
var req = new api.ProcessIframeTxn("df998fea-f309-4e6e-9629-7149799dc028",{
ProcessTxnWithAuthKeyReq : processTxnAuthReq
});
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"
});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Ajax example
<div class="validation-summary"></div>
<div>
<label>Reference1:</label>
<input id="Reference1" name="Reference1" type="text"/>
</div>
<div>
<label>Reference2:</label>
<input id="Reference2" name="Reference2" type="text"/>
</div>
<div>
<label>Reference3:</label>
<input id="Reference3" name="Reference3" type="text"/>
</div>
<div>
<label>EmailAddress:</label>
<input id="EmailAddress" name="EmailAddress" type="text"/>
</div>
<div>
<label>Amount:</label>
<input id="Amount" name="Amount" type="text"/>
</div>
<div>
<label>AmountOriginal:</label>
<input id="AmountOriginal" name="AmountOriginal" type="text"/>
</div>
<div>
<label>AmountSurcharge:</label>
<input id="AmountSurcharge" name="AmountSurcharge" type="text"/>
</div>
<div>
<label>CardHolderName:</label>
<input id="CardHolderName" name="CardHolderName" type="text"/>
</div>
<div>
<iframe src="https://www.merchantsuite.com/api/v2/txns/iframe/{authKey}" frameborder="0"></iframe>
</div>
<div>
<button id="btnProcess" type="button">Process</button>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#btnProcess").click(function () {
$("input").attr("disabled", "disabled");
setTimeout(ProcessPayment, 1000);
});
});
function ProcessPayment() {
$(".validation-summary").empty().hide();
var url = "https://www.merchantsuite.com/api/v2/txns/processiframetxn/{authKey}";
var jsonModel = JSON.stringify(GetModelForProcessing());
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
url: url,
data: jsonModel,
success: function (result) {
$("input").removeAttr("disabled");
if (result && result.APIResponse) {
if (result.APIResponse.ResponseCode == 0) {
window.location.href = result.RedirectionUrl;
}
else
ShowError(result.APIResponse.ResponseText);
}
else {
ShowError("Error processing your request. Response from API is either empty or invalid.");
}
},
error: function (jqXhr, textStatus) {
$("input").removeAttr("disabled");
ShowError("AJAX Error processing your request. XHR Status: " + textStatus);
}
});
}
function ShowError(errorText) {
var ul = $("<ul></ul>");
ul.append("<li>" + errorText + "</li>");
$(".validation-summary").append(ul).show();
}
function GetModelForProcessing() {
var model = new Object();
model.TxnReq = new Object();
model.TxnReq.PaymentReason = "PaymentReason"
model.TxnReq.InternalNote = "InternalNote"
model.TxnReq.Reference1 = $("#Reference1").val();
model.TxnReq.Reference2 = $("#Reference2").val();
model.TxnReq.Reference3 = $("#Reference3").val();
model.TxnReq.EmailAddress = $("#EmailAddress").val();
model.TxnReq.Currency = "AUD"
model.TxnReq.Amount = $("#Amount").val();
model.TxnReq.AmountOriginal = $("#AmountOriginal").val();
model.TxnReq.AmountSurcharge = $("#AmountSurcharge").val();
model.TxnReq.CardDetails = new Object();
model.TxnReq.CardDetails.CardHolderName = $("#CardHolderName").val();
return model;
}
</script>
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
ResultKey |
string | This is the result key that you will have to submit to retrieve the transaction result and present the receipt to the customer,"Retrieve Transaction Result" (Refer Transaction Result). |
RedirectionUrl |
string | URL to use for redirection (if you receive an ApiResponseCode of 300, perform a full browser redirect with this value). |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 144
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=qmytl98r23956x2998tyuins; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:27:07 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"ResultKey" : "df998fea-f309-4e6e-9629-7149799dc028",
"RedirectionUrl" : "http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=df998fea-f309-4e6e-9629-7149799dc028"
}
Transaction Result
Retrieves the result of a transaction processed via an operation using the Browser integration method. Should the resultKey not be available, the result of the transaction can be determined by issuing a Search Transactions (see section AuthKey) API call.
URL
GET
/txns/withauthkey/{resultKey}
URL Parameters
resultKey
- result key returned in a response to process transaction operation
Request Headers
This is a browser integration method. You will be required to supply following HTTP headers with your GET request
- Authorization
- base64 encoded API user credentials
Response Headers
- Content-Type
- application/json; charset=utf-8
GET https://www.merchantsuite.com/api/v2/txns/withauthkey/13cfa799-8278-4872-a705-7ed49d516c0b HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Host: www.merchantsuite.com
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$txn = new MerchantSuite\ResultKeyRetrieval("13cfa799-8278-4872-a705-7ed49d516c0b");
$txn->setCredentials($credentials);
$response = $txn->submit();
from MerchantSuite.Requests import Credentials, TransactionResultKeyRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TransactionResultKeyRequest(credentials, "13cfa799-8278-4872-a705-7ed49d516c0b")
request.base_url = "https://www.merchantsuite.com/api/v2"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::TransactionResultKeyRequest.new("13cfa799-8278-4872-a705-7ed49d516c0b")
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TxnResultKeyRequest req = new TxnResultKeyRequest(credentials, "13cfa799-8278-4872-a705-7ed49d516c0b");
TxnResp resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setCredentials(credentials);
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TransactionResultKeyRequest->new(
credentials => $cred,
resultkey => "13cfa799-8278-4872-a705-7ed49d516c0b"
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var txnClient = ClientFactory.
GetClientInstance<TxnClient>(new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var response = txnClient.
RetrieveProcessTxnResult("13cfa799-8278-4872-a705-7ed49d516c0b");
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.TxnResultKey(
"13cfa799-8278-4872-a705-7ed49d516c0b");
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Configure the ApiConfig.java file to input your API user and Merchant credentials
import main.java.com.merchantsuite.android.api.ApiManager;
String authKey = "13cfa799-8278-4872-a705-7ed49d516c0b";
String response = retrieveTransactionResultWithTokenResult(authKey);
//Configure the MerchantSuiteApiConfig.h file to input your API user and Merchant credentials
#import <Foundation/Foundation.h>
#import <bPointSDK/bPointSDK.h>
NSString* authKey = @"13cfa799-8278-4872-a705-7ed49d516c0b";
[[MerchantSuiteTransaction sharedMerchantSuiteTransaction] retrieveTransactionResultWithTokenResult:authKey UsingDelegate:self];
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TxnResp |
object Refer to Transaction Response Object |
TxnResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 882
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:27:09 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TxnResp" : {
"Action" : "payment",
"Amount" : 19900,
"AmountOriginal" : 19900,
"AmountSurcharge" : 0,
"Authentication3DSResponse" : null,
"AuthoriseID" : "384582",
"BankAccountDetails" : null,
"BankResponseCode" : "00",
"CVNResult" : {
"CVNResultCode" : "Unsupported"
},
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"Currency" : "AUD",
"InternalNote" : "test merchant ref",
"Is3DS" : false,
"IsCVNPresent" : true,
"MembershipID" : "MS123456",
"OriginalTxnNumber" : null,
"ProcessedDateTime" : "2014-12-12T12:27:15.6830000",
"RRN" : "434612384582",
"ReceiptNumber" : "49316631179",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"ResponseCode" : "0",
"ResponseText" : "Approved",
"PaymentReason" : "",
"SettlementDate" : "20141212",
"Source" : "api",
"StoreCard" : false,
"IsTestTxn" : false,
"SubType" : "single",
"TxnNumber" : "1179",
"Token" : null,
"Type" : "internet"
}
}
Wallets
Your payment page can integrate with the digital wallet solutions from major providers.
Including wallets.js
Add this script tag to your page (preferably at the bottom) to get started with the wallet integration.
<script src="https://www.merchantsuite.com/api/merchantsuite/wallets.js?v=2&authkey={AuthKey}" type="text/javascript"></script>
Amex Express Checkout
After passing in the AmexExpressCheckout
variable as true in the AuthKey request (see section AuthKey) the Amex Express Checkout button can be integrated and configured for your payment page.
Configuring the Amex Express Checkout button
Add this tag to your page (preferably at the bottom but before the wallets.js script tag) to configure the Amex Express Checkout appearance.
<wallets:init amex-express-checkout-container-id="amexExpressCheckout" amex-express-checkout-button-color="dark" amex-express-checkout-button-theme="desktop"></wallets:init>
Amex Express Checkout Button Init
The init tag defines how the button will display:
Property | Description |
---|---|
amex-express-checkout-container-id |
Attach the Amex Express Checkout button to the element with this id. |
amex-express-checkout-button-color |
Configure the button to either "light" or "dark" depending on the background shade. |
amex-express-checkout-button-theme |
Configure the display by choosing between "desktop", "mobile" and "responsive". |
Placing Amex Express Checkout button
To place the Amex Express Checkout button, add a div tag to your page with the id that was passed into the amex-express-checkout-container-id
parameter.
<div id="amexExpressCheckout"></div>
Tokens
Processes a transaction using either a card or previously added token.
URL Endpoint
https://www.merchantsuite.com/api/v2/token/
2 Party Token
2 Party Add Token
Securely stores payment details and creates a unique token.
URL
POST
/tokens/
Request Headers
Use this method for direct communication between your server and MerchantSuite.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request is a TokenReq
(Token request details) JSON object with following properties.
Property | Type | Description |
---|---|---|
TokenReq |
object Refer to Token Request Object |
Token Request object |
POST https://www.merchantsuite.com/api/v2/tokens/ HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 247
Expect: 100-continue
Connection: Keep-Alive
{
"TokenReq" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith",
"CardNumber" : "5123456789012346",
"CVN" : null,
"ExpiryDate" : "0521"
},
"AcceptBADirectDebitTC" : true,
"EmailAddress" : "john.smith@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : null
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$txn = new MerchantSuite\AddToken();
$cardDetails = new MerchantSuite\CardDetails();
$txn->setCredentials($credentials);
$cardDetails->setCardNumber("XXXXXXXXXXXXXXXX");
$cardDetails->setCardHolderName("cardholdername");
$cardDetails->setExpiryDate("9901");
$txn->setCardDetails($cardDetails);
$txn->setEmailAddress("user@email.com");
$txn->setReference1("Token Reference 1");
$txn->setReference2("Token Reference 2");
$txn->setReference3("Token Reference 3");
$response = $txn->submit();
from MerchantSuite.Requests import Credentials, AddTokenRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = AddTokenRequest(credentials)
request.base_url = "https://www.merchantsuite.com/api/v2"
request.card_details = CardDetails(
card_holder_name = "MR C CARDHOLDER",
expiry_date = "0521",
card_number = "4444333322221111")
request.reference1 = "Ref One"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::AddTokenRequest.new()
req.credentials = cred
cc = MerchantSuite::CardDetails.new()
cc.card_holder_name = "Card Holder Name"
cc.expiry_date = "9901"
cc.card_number = "5123456789012346"
req.base_url = "https://www.merchantsuite.com/api/v2"
req.card_details = cc
req.reference1 = "reference 1"
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenAddRequest req = new TokenAddRequest(credentials);
CreditCardDetails cc = new CreditCardDetails();
TokenResp resp;
cc.setCardNumber("4444333322221111");
cc.setExpiryDate("0521");
cc.setCardHolderName("MR C CARDHOLDER");
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setReference1("Java Token 1");
req.setCardDetails(cc);
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
my $cc = MerchantSuite::CardDetails->new(
card_number => "4444333322221111",
expiry_date => "0521",
card_holder_name => "MR C CARDHOLDER");
$req = MerchantSuite::TokenAddRequest->new(
credentials => $cred,
reference1 => "Perl Token 1",
card_details => $cc);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new AddTokenReq()
{
TokenReq = new TokenRequest()
{
CardDetails = new CreditCardDetails(){
CardHolderName = "John Smith",
CardNumber = "5123456789012346",
ExpiryDate = "0521"
},
Reference1 = "12345",
Reference2 = "",
Reference3 = "",
EmailAddress = "john.smith@email.com.au"
}
};
var response = tokenClient.AddToken(apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var cc = new api.CardDetails({
CardNumber: "4444333322221111",
ExpiryDate : "0521",
CardHolderName : "MR C CARDHOLDER"});
var req = new api.TokenRequest({
Reference1: "NodeJS Token 1",
EmailAddress: "notatoken@token.com",
CardDetails: cc});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TokenResp |
object Refer to Token Response Object |
TokenResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 339
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=v35boh4ee43lw34cnhhnelst; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:35:07 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TokenResp" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"EmailAddress" : "john.smith@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : null,
"Token" : "5999999789012346"
}
}
2 Party Update Token
Updates details for a given token.
URL
PUT
/tokens/{token}
URL Parameters
token
- token to be updated
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your PUT request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request is a TokenReq
(Token request details) JSON object with following properties.
Property | Type | Description |
---|---|---|
TokenReq |
object Refer to Token Request Object |
Token Request object |
All fields other than CardNumber should be present in any update request. If a field other than CardNumber is omitted, the corresponding token details will be deleted.
PUT https://www.merchantsuite.com/api/v2/tokens/5999999789012346 HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 249
Expect: 100-continue
{
"TokenReq" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "Joanne Smurf",
"CardNumber" : "4005550000000001",
"ExpiryDate" : "0521"
},
"EmailAddress" : "tommy.smith@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : null
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$txn = new MerchantSuite\UpdateToken("5999999789012346");
$cardDetails = new MerchantSuite\CardDetails();
$cardDetails->setExpiryDate("9901");
$txn->setCredentials($credentials);
$txn->setCardDetails($cardDetails);
$txn->setReference1("New Reference 1");
$txn->setEmailAddress("user@email.com");
$response = $txn->submit();
from MerchantSuite.Requests import Credentials, UpdateTokenRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = UpdateTokenRequest(credentials,"5999999789012346")
request.base_url = "https://www.merchantsuite.com/api/v2"
request.card_details = CardDetails(
card_holder_name = "MR C CARDHOLDER",
expiry_date = "0521",
card_number = "4444333322221111")
request.reference1 = "Ref One"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::UpdateTokenRequest.new("5999999789012346")
req.credentials = cred
cc = MerchantSuite::CardDetails.new()
cc.card_holder_name = "MR C CARDHOLDER"
cc.expiry_date = "0521"
cc.card_number = "4444333322221111"
req.base_url = "https://www.merchantsuite.com/api/v2"
req.card_details = cc
req.reference1 = "Token Reference"
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenUpdateRequest req = new TokenUpdateRequest(credentials, "5999999789012346");
CreditCardDetails cc = new CreditCardDetails();
TokenResp resp;
cc.setCardNumber("4444333322221111");
cc.setExpiryDate("0521");
cc.setCardHolderName("MR C CARDHOLDER");
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setReference1("Java Update Token 1");
req.setCardDetails(cc);
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
my $cc = MerchantSuite::CardDetails->new(
card_number => "4444333322221111",
expiry_date => "0521",
card_holder_name => "MR C CARDHOLDER");
$req = MerchantSuite::TokenUpdateRequest->new(
credentials => $cred,
reference1 => "Perl Token 1",
card_details => $cc,
token => "5999999789012346"
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new UpdateTokenReq()
{
TokenReq = new TokenRequest()
{
CardDetails = new CreditCardDetails(){
CardHolderName = "John Smith",
CardNumber = "5123456789012346",
ExpiryDate = "0521"
},
Reference1 = "12345",
Reference2 = "",
Reference3 = "",
EmailAddress = "john.smith@email.com.au"
}
};
var response = tokenClient.UpdateToken("5999999789012346",apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var cc = new api.CardDetails({
CardNumber: "4444333322221111",
ExpiryDate : "0521",
CardHolderName : "MR C CARDHOLDER"});
var req = new api.TokenUpdate({
Token: "5999999789012346",
CardDetails: cc, Reference1:
"NodeJS Token 1 - Updated"});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TokenResp |
object Refer to Token Response Object |
TokenResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 339
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:43:34 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TokenResp" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "Joanne Smurf",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "400555...001"
},
"CardType" : "VC",
"EmailAddress" : "tommy.smith@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : "",
"Token" : "5999999789012346"
}
}
2 Party Tokenise Card
Creates a token using payment details from a previously processed transaction. The following conditions must be true to tokenise a previously processed transaction:
- The transaction was approved
- The transaction was submitted with StoreCard set to true (see sections 2 Party Payment and AuthKey)
URL
POST
/tokens/txn/{txnNumber}
URL Parameters
txnNumber
- transaction number of a previously processed transaction
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your POST request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
POST https://www.merchantsuite.com/api/v2/tokens/txn/1180 HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 0
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$txn = new MerchantSuite\TokeniseTransaction("1180");
$txn->setCredentials($credentials);
$response = $txn->submit();
from MerchantSuite.Requests import Credentials, TokeniseTransactionRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TokeniseTransactionRequest(credentials, "1180")
request.base_url = "https://www.merchantsuite.com/api/v2"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::TokeniseTransactionRequest.new("1180")
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokeniseTransactionRequest req = new TokeniseTransactionRequest(credentials, "1180");
TokenResp resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TokeniseTransactionRequest->new(
credentials => $cred,
txn_number => "1180");
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var response = tokenClient.TokeniseTxn("1180");
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.TokeniseTransaction("0001");
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TokenResp |
object Refer to Token Response Object |
TokenResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 329
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=0d1btj43s3vpxx3dc2zbt422; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:48:31 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TokenResp" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : null,
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"EmailAddress" : null,
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"Token" : "5999999789012346"
}
}
2 Party Retrieve Token
Retrieves token details.
URL
GET
/tokens/{token}
URL Parameters
token
- token record to retrieve
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your GET request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
GET https://www.merchantsuite.com/api/v2/tokens/5999999789012346 HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Host: www.merchantsuite.com
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$txn = new MerchantSuite\RetrieveToken("5999999789012346");
$txn->setCredentials($credentials);
$response = $txn->submit();
from MerchantSuite.Requests import Credentials, TokenRetrievalRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TokenRetrievalRequest(credentials, "5999999789012346")
request.base_url = "https://www.merchantsuite.com/api/v2"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::RetrieveTokenRequest.new("5999999789012346")
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenFetchRequest req = new TokenFetchRequest(credentials, "5999999789012346");
TokenResp resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TokenRetrievalRequest->new(
credentials => $cred,
token => "5999999789012346");
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var response = tokenClient.RetrieveToken("5999999789012346");
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.RetrieveToken("5999999789012346");
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TokenResp |
object Refer to Token Response Object |
TokenResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 337
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:50:40 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TokenResp" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"EmailAddress" : "john.smith@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : "",
"Token" : "5999999789012346"
}
}
2 Party Search Tokens
Performs a search on the merchant's tokens.
URL
POST
/tokens/search
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your POST request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request is a SearchInput
(Search details) JSON object with following properties.
Property | Type | Description |
---|---|---|
CardType |
string | (MaxLen = 2) Optional |
Reference1 |
string | (MaxLen = 50) Optional |
Reference2 |
string | (MaxLen = 50) Optional |
Reference3 |
string | (MaxLen = 50) Optional |
ExpiredCardsOnly |
boolean | Flag to indicate search should only return tokens where the card expiry date is in the past. Optional |
ExpiryDate |
string | Card expiry date. MMYY format (MinLen = 4, MaxLen = 4) Optional |
FromDate |
string | Start date and time for a date range search, compared against the token creation date. In ISO8601 format. (MaxLen = 50) Optional |
MaskedCardNumber |
string | Masked card number. (MaxLen = 12) Optional |
Source |
string | Transaction origin - |
ToDate |
string | End date and time for a date range search, compared against the token creation date. In ISO8601 format. (MaxLen = 50) Optional |
Token |
string | Token Number (MaxLen = 16) Optional |
UserCreated |
string | Username of the user who created the token (MaxLen = 50) Optional |
UserUpdated |
string | Username of the user who last updated the token (MaxLen = 50) Optional |
All fields other than CardNumber should be present in any update request. If a field other than CardNumber is omitted, the corresponding token details will be deleted.
POST https://www.merchantsuite.com/api/v2/tokens/search HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 311
Expect: 100-continue
{
"SearchInput" : {
"CardType" : null,
"ExpiredCardsOnly" : false,
"ExpiryDate" : null,
"FromDate" : "2014-12-11T12:52:24.8176630+11:00",
"MaskedCardNumber" : null,
"Reference1" : null,
"Reference2" : null,
"Reference3" : null,
"Source" : null,
"ToDate" : "2014-12-12T12:52:24.8176630+11:00",
"Token" : null,
"UserCreated" : null,
"UserUpdated" : null
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$search = new MerchantSuite\TokenSearch();
$search->setCredentials($credentials);
$search->setMaskedCardNumber("444433...111");
$response = $search->submit();
from MerchantSuite.Requests import Credentials, TokenSearchRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TokenSearchRequest(credentials)
request.masked_card_number = "444433...111";
request.base_url = "https://www.merchantsuite.com/api/v2"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::TokenSearchRequest.new()
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
req.masked_card_number = "444433...111"
response = req.submit()
import com.MerchantSuite.api.*;
import java.util.ArrayList;
import java.util.List;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenSearchRequest req = new TokenSearchRequest(credentials);
TokenSearchResponse resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setMaskedCardNumber("444433...111");
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TokenSearchRequest->new(
masked_card_number => "444433...111",
credentials => $cred);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new SearchTokensReq()
{
SearchInput = new SearchTokensInput()
{
MaskedCardNumber = "444433...111"
}
};
var response = tokenClient.SearchTokens(apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.SearchTokens({
MaskedCardNumber : "444433...111" });
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TokenRespList |
array Refer to Token Response Object |
Array of token response objects |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 1963
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=ykvzrfcv53mexg0dbo5uluz0; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:52:18 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TokenRespList" : [{
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"EmailAddress" : "jimmy@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : "",
"Token" : "5999999789012346"
},..., {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"EmailAddress" : "",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : "",
"Token" : "5999999789012346"
}]
}
2 Party Delete Token
Deletes an existing token
URL
DELETE
/tokens/{token}
URL Parameters
token
- token record to delete
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your DELETE request.
- Authorization
- base64 encoded API user credentials
Response Headers
- Content-Type
- application/json; charset=utf-8
DELETE https://www.merchantsuite.com/api/v2/tokens/5999999789012346 HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 0
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$delete = new MerchantSuite\DeleteToken();
$delete->setCredentials($credentials);
$delete->setToken("5999999789012346");
$response = $delete->submit();
from MerchantSuite.Requests import Credentials, DeleteTokenRequest
from MerchantSuite.Utils import CardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = DeleteTokenRequest(credentials, "5999999789012346")
request.base_url = "https://www.merchantsuite.com/api/v2"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::DeleteTokenRequest.new("5999999789012346")
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenDeleteRequest req = new TokenDeleteRequest(credentials, "5999999789012346");
Response resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TokenDeleteRequest->new(
token => "5999999789012346",
credentials => $cred);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var response = tokenClient.DeleteToken("5999999789012346");
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.DeleteToken("5999999789012346");
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 59
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:54:38 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
}
}
AuthKey Token
AuthKey Add Token
Creates a one-time AuthKey to be used with "Add Token" operation when using Browser integration method.
This operation serves following functions:
- Authenticates the merchant by username, merchant number and password. If these details are not correct, the AuthKey will not be generated.
- Creates a unique AuthKey to allow merchant's customer to save their payment details.
- AuthKey prevents processing of duplicate requests.
-
Allows merchant to "lock in" certain details and means they cannot be modified even if submitted in subsequent "Add Token" request. These fields include:
- Reference1
- Reference2
- Reference3
- EmailAddress
- AuthKey is valid only for a predefined period of time (20 minutes). If the request is not attempted during that time merchant's application will need to request a new AuthKey.
URL
POST
/tokens/addtokenauthkey
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your POST request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request is a JSON object with following properties.
Property | Type | Description |
---|---|---|
FixedAddTokenData |
object Refer to Fixed Add Token Data Object |
Optional |
HppParameters |
object Refer to HppParameters Data Object |
Optional |
IframeParameters |
object Refer to Iframe Parameters Object |
JSON object containing the iframe parameters (see 3 Party Iframe). Optional |
RedirectionUrl |
string | Merchant redirection URL. |
WebHookUrl |
string | Merchant web hook handler URL. Optional |
POST https://www.merchantsuite.com/api/v2/tokens/addtokenauthkey HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 91
Expect: 100-continue
{
"FixedAddTokenData" : {
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"EmailAddress" : "john.smith@email.com.au"
},
"HppParameters" : {
"HideReference1" : "false",
"HideReference2" : "true",
"HideReference3" : "true",
"IsEddr" : "true",
"ShowCustomerDetailsForm" : "true",
"PaymentReason" : "00Example00",
"Reference1Label" : "Reference1",
"Reference2Label" : "",
"Reference3Label" : ""
},
"IframeParameters" : {
"CSS" : ".control-label{color:blue;}",
"ShowSubmitButton": true
},
"RedirectionUrl" : "http://yourmerchantwebsite.com/tokenreceipt",
"WebHookUrl" : null
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$hppParameters = new MerchantSuite\HppParameters();
$hppParameters->setPaymentReason("00Example00");
$hppParameters->setReferenceLabel1("Reference1");
$hppParameters->setHideReference1(false);
$hppParameters->setHideReference2(true);
$hppParameters->setHideReference3(true);
$hppParameters->setIsEddr(true);
$hppParameters->setShowCustomerDetailsForm(true);
$iframeParameters = new MerchantSuite\IframeParameters();
$iframeParameters->setCSS(".control-label{color:blue;}");
$iframeParameters->setShowSubmitButton(true);
$auth = new MerchantSuite\AddTokenAuthKey();
$auth->setCredentials($credentials);
$auth->setReference1("Ref One");
$auth->setRedirectionUrl("http://yourmerchantwebsite.com/tokenreceipt");
$auth->setEmailAddress("user@email.com");
$auth->setHPPParameters($hppParameters);
$auth->setIframeParameters($iframeParameters);
$response = $auth->submit();
from MerchantSuite.Requests import Credentials, AddTokenAuthKeyRequest, HppParameters, IframeParameters
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
hppParameters = HppParameters()
hppParameters.hide_reference1 = False
hppParameters.hide_reference2 = True
hppParameters.hide_reference3 = True
hppParameters.is_eddr = True
hppParameters.reference1_label = "Reference1"
hppParameters.payment_reason = "00Exmaple00"
hppParameters.show_customer_details_form = True
iframe_parameters = IframeParameters()
iframe_parameters.css = ".control-label{color:blue;}"
iframe_parameters.show_submit_button = True
request = AddTokenAuthKeyRequest(credentials)
request.base_url = "https://www.merchantsuite.com/api/v2"
request.reference1 = "Ref One"
request.redirection_url = "http://yourmerchantwebsite.com/tokenreceipt"
request.hpp_parameters = hppParameters
request.iframe_parameters = iframe_parameters
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
hpp = MerchantSuite::HppParameters.new
hpp.hide_reference1 = false
hpp.hide_reference2 = true
hpp.hide_reference3 = true
hpp.is_eddr = true
hpp.reference1_label = "Reference1"
hpp.payment_reason = "00Example00"
hpp.show_customer_details_form = true
iframe_parameters = MerchantSuite::IframeParameters.new
iframe_parameters.css = ".control-label{color:blue;}"
iframe_parameters.show_submit_button = true
req = MerchantSuite::AddTokenAuthKeyRequest.new()
req.base_url = "https://www.merchantsuite.com/api/v2"
req.reference1 = "Test Ref 1"
req.redirection_url ="http://yourmerchantwebsite.com/tokenreceipt"
req.credentials = cred
req.hpp_parameters = hpp
req.iframe_parameters = iframe_parameters
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenAddAuthKeyRequest req = new TokenAddAuthKeyRequest(credentials);
AuthKeyResponse resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setReference1("Java Token AuthKey Add Ref 1");
req.setRedirectionUrl("http://yourmerchantwebsite.com/tokenreceipt");
IframeParameters iframeParameters = new IframeParameters();
iframeParameters.setCSS(".control-label{color:blue;}");
iframeParameters.setShowSubmitButton(true);
HppTokenFlowParameters hppParameters = new HppTokenFlowParameters();
hppParameters.setPaymentReason("00Example00");
hppParameters.setReference1Label("Reference1");
hppParameters.setHideReference1(false);
hppParameters.setIsEddr(true);
hppParameters.setShowCustomerDetailsForm(true);
req.setHppTokenFlowParameters(hppParameters);
req.setIframeParameters(iframeParameters);
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
my $hppParameters = MerchantSuite::HppParameters->new(
hide_reference1 => 0, hide_reference2 => 1, hide_reference3 => 1,
is_eddr => 1, reference1_label =>"Reference1", reference2_label =>"", reference3_label =>"", payment_reason =>"00Example00",
show_customer_details_form => 1
);
my $iframeParameters = MerchantSuite::IframeParameters->new(
css => ".control-label{color:blue;}",
show_submit_button=> 1
);
$req = MerchantSuite::TokenAddAuthKeyRequest->new(
credentials => $cred,
reference1 => "Perl AuthKey Token Add 1",
redirection_url => "http://yourmerchantwebsite.com/tokenreceipt",
iframe_parameters => $iframeParameters,
hpp_parameters => $hppParameters
);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new CreateAddTokenAuthKeyReq()
{
WebHookUrl = null,
RedirectionUrl = "http://yourmerchantwebsite.com/tokenreceipt",
FixedAddTokenData = new AddTokenData
{
Reference1 = "Ref One",
Reference2 = "",
Reference3 = "",
EmailAddress = "user@email.com"
},
IframeParameters = new IframeFlowParameters
{
CSS = ".control-label{color:blue;}",
ShowSubmitButton = true
}
};
var response = tokenClient.CreateAddTokenAuthKey(apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var hppParameters = new api.HppParameters({
HideReference1 : false,
HideReference2 : true,
HideReference3 : true,
IsEddr : true,
ShowCustomerDetailsForm : true,
PaymentReason : "00Example00",
reference1Label : "Reference1",
reference2Label : null,
reference3Label : null
});
var iframeParameters = new api.IframeParameters({
CSS : ".control-label{color:blue;}",
ShowSubmitButton : true
});
req = new api.AddTokenAuthKey({
Reference1 : "NodeJS Add Token AuthKey 1",
HppParameters : hppParameters,
IframeParameters : iframeParameters,
RedirectionUrl: "http://yourmerchantwebsite.com"});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Configure the ApiConfig.java file to input your API user and Merchant credentials
import main.java.com.merchantsuite.android.api.ApiManager;
String crn1 = "A CRN";
String response = createAnAuthKeyToAddADataVaultTokenForUserWithEmail(crn1);
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
AuthKey |
string |
Unique key that the merchant must use when invoking the "Add Token" operation using the Browser integration method. The AuthKey is returned only if the API response code indicates success. (MaxLen = 500) |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 108
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=rser1ad1g3i5umowtys5lpzg; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:56:18 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"AuthKey" : "df998fea-f309-4e6e-9629-7149799dc028"
}
AuthKey Update Token
Creates a one-time AuthKey to be used with the "Update Token" operation when using the Browser integration method.
This operation serves following functions:
- Authenticates the merchant by username, merchant number and password. If these details are not correct, the AuthKey will not be generated.
- Creates a unique AuthKey to allow merchant's customer to update their payment details.
- AuthKey prevents processing of duplicate requests.
-
Allows merchant to "lock in" certain details and prevent the details from being modified. These fields include:
- Reference1
- Reference2
- Reference3
- EmailAddress
- AuthKey is valid only for a predefined period of time (20 minutes). If the request is not attempted during that time merchant's application will need to request a new AuthKey.
URL
POST
/tokens/updatetokenauthkey
Request Headers
This is a direct integration method. You will be required to supply the following HTTP headers with your POST request.
- Authorization
- base64 encoded API user credentials
- Content-Type
- application/json; charset=utf-8
Response Headers
- Content-Type
- application/json; charset=utf-8
Request
Request is a JSON object with following properties.
Property | Type | Description |
---|---|---|
FixedUpdateTokenData |
object Refer to Fixed Update Token Data Object |
Optional |
HppParameters |
object Refer to HppParameters Data Object |
Optional |
IframeParameters |
object Refer to Iframe Parameters Object |
JSON object containing the iframe parameters (see 3 Party Iframe). Optional |
RedirectionUrl |
string | Merchant redirection URL |
WebHookUrl |
string | Merchant web hook handler URL Optional |
POST https://www.merchantsuite.com/api/v2/tokens/updatetokenauthkey HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 270
Expect: 100-continue
{
"FixedUpdateTokenData" : {
"EmailAddress" : "john.smith@email.com.au",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"Token" : "5999999789012346"
},
"HppParameters" : {
"HideReference1" : "false",
"HideReference2" : "true",
"HideReference3" : "true",
"IsEddr" : "true",
"ShowCustomerDetailsForm" : "true",
"PaymentReason" : "00Example00",
"Reference1Label" : "Reference1",
"Reference2Label" : "",
"Reference3Label" : ""
},
"IframeParameters" : {
"CSS" : ".control-label{color:blue;}",
"ShowSubmitButton": true
},
"RedirectionUrl" : "http://yourmerchantwebsite.com/tokenreceipt",
"WebHookUrl" : null
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$hppParameters = new MerchantSuite\HppParameters();
$hppParameters->setPaymentReason("00Example00");
$hppParameters->setReferenceLabel1("Reference1");
$hppParameters->setHideReference1(false);
$hppParameters->setHideReference2(true);
$hppParameters->setHideReference3(true);
$hppParameters->setIsEddr(true);
$hppParameters->setShowCustomerDetailsForm(true);
$iframeParameters = new MerchantSuite\IframeParameters();
$iframeParameters->setCSS(".control-label{color:blue;}");
$iframeParameters->setShowSubmitButton(true);
$auth = new MerchantSuite\UpdateTokenAuthKey();
$auth->setCredentials($credentials);
$auth->setReference1("Ref One");
$auth->setRedirectionUrl("http://yourmerchantwebsite.com/tokenreceipt");
$auth->setEmailAddress("user@email.com");
$auth->setToken("XXXXXXXXXXXXXXXX");
$auth->setHppParameters($hppParameters);
$auth->setIframeParameters($iframeParameters);
$response = $auth->submit();
from MerchantSuite.Requests import Credentials, UpdateTokenAuthKeyRequest, HppParameters, IframeParameters
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
hppParameters = HppParameters()
hppParameters.hide_reference1 = False
hppParameters.hide_reference2 = True
hppParameters.hide_reference3 = True
hppParameters.is_eddr = True
hppParameters.reference1_label = "Reference1"
hppParameters.payment_reason = "00Exmaple00"
hppParameters.show_customer_details_form = True
iframe_parameters = IframeParameters()
iframe_parameters.css = ".control-label{color:blue;}"
iframe_parameters.show_submit_button = True
request = UpdateTokenAuthKeyRequest(credentials,"5999999789012346")
request.base_url = "https://www.merchantsuite.com/api/v2"
request.reference1 = "Ref One"
request.redirection_url = "http://yourmerchantwebsite.com/tokenreceipt"
request.hpp_parameters = hppParameters
request.iframe_parameters = iframe_parameters
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
hpp = MerchantSuite::HppParameters.new
hpp.hide_reference1 = false
hpp.hide_reference2 = true
hpp.hide_reference3 = true
hpp.is_eddr = true
hpp.reference1_label = "Reference1"
hpp.payment_reason = "00Example00"
hpp.show_customer_details_form = true
iframe_parameters = MerchantSuite::IframeParameters.new
iframe_parameters.css = ".control-label{color:blue;}"
iframe_parameters.show_submit_button = true
req = MerchantSuite::UpdateTokenAuthKeyRequest.new()
req.base_url = "https://www.merchantsuite.com/api/v2"
req.reference1 = "Test Ref 1"
req.redirection_url ="http://yourmerchantwebsite.com/tokenreceipt"
req.token = "5999999789012346"
req.credentials = cred
req.hpp_parameters = hpp
req.iframe_parameters = iframe_parameters
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenUpdateAuthKeyRequest req = new TokenUpdateAuthKeyRequest(credentials);
AuthKeyResponse resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setReference1("Java Token AuthKey Update Ref 1");
req.setToken("XXXXXXXXXXXXXXXX");
req.setRedirectionUrl("http://yourmerchantwebsite.com/tokenreceipt");
IframeParameters iframeParameters = new IframeParameters();
iframeParameters.setCSS(".control-label{color:blue;}");
iframeParameters.setShowSubmitButton(true);
HppTokenFlowParameters hppParameters = new HppTokenFlowParameters();
hppParameters.setPaymentReason("00Example00");
hppParameters.setReference1Label("Reference1");
hppParameters.setHideReference1(false);
hppParameters.setIsEddr(true);
hppParameters.setShowCustomerDetailsForm(true);
req.setHppTokenFlowParameters(hppParameters);
req.setIframeParameters(iframeParameters);
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
my $hppParameters = MerchantSuite::HppParameters->new(
hide_reference1 => 0, hide_reference2 => 1, hide_reference3 => 1,
is_eddr => 1, reference1_label => "Reference1", reference2_label => "", reference3_label => "", payment_reason => "00Example00",
show_customer_details_form => 1
);
my $iframeParameters = MerchantSuite::IframeParameters->new(
css => ".control-label{color:blue;}",
show_submit_button => 1
);
$req = MerchantSuite::TokenUpdateAuthKeyRequest->new(credentials => $cred,
reference1 => "Perl AuthKey Token Add 1",
redirection_url => "http://yourmerchantwebsite.com/tokenreceipt",
token => "XXXXXXXXXXXXXXXX",
iframe_parameters => $iframeParameters,
hpp_parameters => $hppParameters);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new CreateUpdateTokenAuthKeyReq()
{
WebHookUrl = null,
RedirectionUrl = "http://yourmerchantwebsite.com/tokenreceipt",
FixedUpdateTokenData = new UpdateTokenData
{
Token = "5999999789012346",
Reference1 = "Ref One",
Reference2 = "",
Reference3 = "",
EmailAddress = "user@email.com"
},
IframeParameters = new IframeFlowParameters
{
CSS = ".control-label{color:blue;}",
ShowSubmitButton = true
}
};
var response = tokenClient.CreateUpdateTokenAuthKey(apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var hppParameters = new api.HppParameters({
HideReference1 : false,
HideReference2 : true,
HideReference3 : true,
IsEddr : true,
ShowCustomerDetailsForm : true,
PaymentReason : "00Example00",
reference1Label : "Reference1",
reference2Label : null,
reference3Label : null
});
var iframeParameters = new api.IframeParameters({
CSS : ".control-label{color:blue;}",
ShowSubmitButton : true
});
var req = new api.UpdateTokenAuthKey({
Token: "5999999789012346",
Reference1 : "NodeJS Add Token AuthKey 1",
HppParameters : hppParameters,
IframeParameters : iframeParameters,
RedirectionUrl: "http://yourmerchantwebsite.com"});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Configure the ApiConfig.java file to input your API user and Merchant credentials
import main.java.com.merchantsuite.android.api.ApiManager;
String token = "5999999789012346";
String response = createAnAuthKeyToUpdateADataVaultToken(token);
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
AuthKey |
string |
Unique key that the merchant must use when invoking the "Update Token" operation using the Browser integration method. The AuthKey is returned only if the API response code indicates success. (MaxLen = 500) |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 108
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:57:55 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"AuthKey" : "df998fea-f309-4e6e-9629-7149799dc028"
}
Token Webform
Add Token Webform
Securely stores payment details and creates a unique token
This request is made directly from the cardholder's browser. The browser will also automatically handle the response and redirect the cardholder to the appropriate URL.
URL
POST
/tokens/webform/add
Request Headers
This is a browser integration method. You will be required to supply following HTTP headers with your POST request.
- Content-Type
- application/x-www-form-urlencoded charset=utf-8
Response Headers
Request
Request is a Form with following properties.
Property | Type | Description |
---|---|---|
AuthKey |
string | Unique key created using the "Create AuthKey" operation (MaxLen = 500) |
CardHolderName |
string | (MaxLen = 50) Optional |
CardNumber |
string | (MinLen = 13, MaxLen = 16) |
CVN |
Not required and will be ignored if included in the request. CVN fields are never stored in MerchantSuite. | |
ExpiryDateMonth |
string |
Card expiry date month In MM format(MinLen = 2, MaxLen = 2) |
ExpiryDateYear |
string |
Card expiry date year In YY format (MinLen = 2, MaxLen = 2) |
AccountName |
Reserved for future use. Set to null. | |
AccountNumber |
Reserved for future use. Set to null. | |
BSBNumber |
Reserved for future use. Set to null. | |
Reference1 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) |
Reference2 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
Reference3 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
EmailAddress |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 250) Optional |
POST https://www.merchantsuite.com/api/v2/tokens/webform/add HTTP/1.1
Content-Type: application/x-www-form-urlencoded charset=utf-8
Host: www.merchantsuite.com
Content-Length: 226
Expect: 100-continue
&Reference1=12345&Reference2=&Reference3=&EmailAddress=john.smith%40email.com.au&CardNumber=5123456789012346&ExpiryDateMonth=05&ExpiryDateYear=17&CVN=123&CardHolderName=John+Smith&AuthKey=9ab0d695-d16d-4bf0-8800-7c784e1bd203
Response Location
URL to redirect to with result appended to query string
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=415d2da7-0cf1-4c75-8c8b-754bba573647
Set-Cookie: ASP.NET_SessionId=g0mgvdi2hzjj1jhibr3vnj2j; path=/; secure; HttpOnly
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:56:18 GMT
Content-Length: 0
Update Token Webform
Updates payment details for existing an existing token
This request is made directly from the cardholder's browser. The browser will also automatically handle the response and redirect the cardholder to the appropriate URL.
URL
POST
/tokens/webform/update
Request Headers
This is a browser integration method. You will be required to supply following HTTP headers with your POST request.
- Content-Type
- application/x-www-form-urlencoded charset=utf-8
Response Headers
Request
Request is a Form with following properties.
Property | Type | Description |
---|---|---|
AuthKey |
string | Unique key created using the "Create AuthKey" operation (MaxLen = 500) |
CardHolderName |
string | (MaxLen = 50) Optional |
CardNumber |
string | Card number (MinLen = 13, MaxLen = 16) |
CVN |
Not required and will be ignored if included in the request. CVN fields are never stored in MerchantSuite. | |
ExpiryDateMonth |
string |
Card expiry date month In MM format (MinLen = 2, MaxLen = 2) |
ExpiryDateYear |
string |
Card expiry date year In YY format (MinLen = 2, MaxLen = 2) |
AccountName |
Reserved for future use. Set to null. | |
AccountNumber |
Reserved for future use. Set to null. | |
BSBNumber |
Reserved for future use. Set to null. | |
Reference1 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50)(this is optional if provided in "Create AuthKey" request) |
Reference2 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
Reference3 |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 50) Optional |
EmailAddress |
string | Ignored if provided in "Create AuthKey" request. (MaxLen = 250) Optional |
POST https://www.merchantsuite.com/api/v2/tokens/webform/update HTTP/1.1
Content-Type: application/x-www-form-urlencoded charset=utf-8
Host: www.merchantsuite.com
Content-Length: 236
Expect: 100-continue
&Reference1=test+reference1&Reference2=test+reference2&Reference3=test+reference3&EmailAddress=john%40john.com&CardNumber=5123456789012346&ExpiryDateMonth=05&ExpiryDateYear=17&CVN=123&CardHolderName=John+Smith&AuthKey=5a9e7240-cdfc-4659-9be2-18a01c713b71
Response Location
URL to redirect to with result appended to query string
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=03a038f5-ae28-44a4-a8d0-8c78279f5445
Set-Cookie: ASP.NET_SessionId=fuarrfzj2u0flw3kdgt1h2o1; path=/; secure; HttpOnly
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:57:56 GMT
Content-Length: 0
Token JavaScript - Simple
Add Token
The API JavaScript makes it easy to store card details without having the card data pass through your servers.
Including api.js
Add this script tag to your page (preferably at the bottom) to get started with the JavaScript API.
Setting up the add token form
This is all you need to start tokenising cards with MerchantSuite. The MerchantSuite JavaScript library will store the card details and redirect the browser to the "RedirectionUrl" supplied when the AuthKey was created (Refer Add Token AuthKey). At the end of the redirection, invoke the "Lookup Add/Update Token Result" call (Refer Lookup Token Result) from your web server to retrieve the token information and render the confirmation receipt to your customers
The three parameters in the sample code above are compulsory. There are several optional parameters, which you can pass to the "SetupAddToken" method to further customise the form as required. Please find below information about the parameters which you can pass to "SetupAddToken" method.
<script src="https://www.merchantsuite.com/api/merchantsuite/api.js?v=2" type="text/javascript"></script>
merchantsuite.SetupAddToken({
AcceptBankAccountTerms: true ,
AppendToElementId: "add-form-location",
AuthKey: $("#AuthKey").val(),
DefaultErrorUrl: "https://www.yourdomain.com/handleerror"
});
Method Parameters
Property | Type | Description |
---|---|---|
AppendToElementId |
string | ID of the HTML element on your page where you want the form to be inserted. |
AuthKey |
string | Unique key created using "Create AuthKey" operation (Refer AuthKey Add Token). You may store this in a hidden field and then pass the value. (MaxLen = 500) |
DefaultErrorUrl |
string | A fall-back URL which the browser is redirected to if a response is not received. |
Reference1 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 1 field on the page Optional |
Reference2 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 2 field on the page Optional |
Reference3 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 3 field on the page Optional |
EmailAddress |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display email address field on the page Optional |
Type |
string | The type of information that you wish to store. E.g. CREDITCARD for storing a CreditCard or BANKACCOUNT for storing a bank account.Optional |
if this parameter is populated via "Create AuthKey" (Refer AuthKey Add Token) operation then that value will take precedence over value submitted here.
Update Token
The API JavaScript makes it easy to update a token without having the information pass through your servers.
Including api.js
Add this script tag to your page (preferably at the bottom) to get started with the JavaScript API.
Setting up update token form
This is all you need to get started with updating a token. The JavaScript library will update the card details and will redirect the browser to the "RedirectionUrl" supplied when the AuthKey was created (Refer AuthKey Update Token). At the end of the redirection, invoke the "Lookup Add/Update Token Result" call (Refer Lookup Token Result) from your web server to retrieve the token information and render the confirmation receipt to your customers.
The three parameters in the sample code above are compulsory. There are several optional parameters, which you can pass to the "SetupUpdateToken" method to further customise the form as required. Please find below information about the parameters which you can pass to "SetupUpdateToken" method.
<script src="https://www.merchantsuite.com/api/merchantsuite/api.js?v=2" type="text/javascript"></script>
merchantsuite.SetupUpdateToken({
AppendToElementId: "update-form-location",
AuthKey: $("#AuthKey").val(),
DefaultErrorUrl: "https://www.yourdomain.com/handleerror"
});
Method Parameters
Property | Type | Description |
---|---|---|
AppendToElementId |
string | ID of the HTML element on your page where you want the form to be inserted. |
AuthKey |
string | Unique key created using "Create AuthKey" operation (Refer AuthKey Add Token). You may store this in a hidden field and then pass the value.(MaxLen = 500) |
DefaultErrorUrl |
string | A fall-back URL which the browser is redirected to if a response is not received. |
Reference1 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 1 field on the page Optional |
Reference2 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 2 field on the page Optional |
Reference3 |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display the Reference 3 field on the page Optional |
EmailAddress |
object Refer to Json Object |
Include this object with appropriate flags if you wish to display email address field on the page Optional |
Type |
string | The type of information that you wish to store. E.g. CREDITCARD for storing a CreditCard or BANKACCOUNT for storing a bank account.Optional |
if this parameter is populated via "Create AuthKey" (Refer AuthKey Update Token) operation then that value will take precedence over value submitted here.
Token JavaScript - Advanced
Add Token
"SetupAddToken" as explained above is the simple approach to start collecting card or bank account information using the API. For more control over the user experience, please follow the custom method as described below.
Process add token
Invoke the process add token method as explained below when you are ready to store the payment instrument e.g. a button click. "ProcessAddToken" is an asynchronous call - it returns immediately and invokes the "CallbackFunction" when it receives a response from the server.
merchantsuite.ProcessAddToken({
AuthKey: $("#AuthKey").val(),
Reference1: $("#Reference1").val(),
Reference2: $("#Reference2").val(),
Reference3: $("#Reference3").val(),
EmailAddress: $("#EmailAddress").val(),
Type: "CREDITCARD",
CardHolderName: $("#CardHolderName").val(),
CardNumber: $("#CardNumber").val(),
ExpiryMonth: $("#CardExpiryMonth").val(),
ExpiryYear: $("#CardExpiryYear").val(),
CallbackFunction: ProcessAddTokenCallBack
});
Method Parameters
Property | Type | Description |
---|---|---|
AuthKey |
string | Unique key created using the "Create AuthKey" operation (Refer AuthKey Add Token). You may store this in a hidden field and then pass the value. (MaxLen = 500) |
Reference1 |
string | Reference 1 to store with the token (MaxLen = 50) Optional if supplied while creating the AuthKey (Refer AuthKey Add Token) |
Reference2 |
string | Reference 2 to store with the token (MaxLen = 50) Optional |
Reference3 |
string | Reference 3 to store with the token (MaxLen = 50) Optional |
EmailAddress |
string | Email address to store with the token (MaxLen = 250) Optional |
Type |
string | The type of information that you wish to store. E.g. CREDITCARD for storing a CreditCard or BANKACCOUNT for storing a bank account.Optional |
CardHolderName |
string | Name on the card (MaxLen = 50) Optional |
CardNumber |
numeric | Card number you wish to tokenise MANDATORYif TYPE is CREDITCARD |
ExpiryMonth |
numeric | Expiry month of the card MANDATORY if TYPE is CREDITCARD |
ExpiryYear |
numeric | Expiry year of the card MANDATORY if TYPE is CREDITCARD |
CallbackFunction |
function | This is a callback you provide to handle the response from the API. Please see below for more information on this. |
The "CallbackFunction" is a JavaScript function you provide to handle the response from the API. It does the following:
- If the payment information entered by the user returned an error, display it on the page
- If an error was not returned, then submit the result back to your server to call the "Lookup Add/Update Token Result" (Refer Lookup Token Result) and render the conformation receipt. Note: It is recommended that you do not submit the card details to your server, and only submit the result of the call back to your server.
Below is a sample implementation of "ProcessAddTokenCallBack":
function ProcessAddTokenCallBack(result) {
var errors = new Array();
if (result.AjaxResponseType == 0) {
//AJAX call was successful
if (result.ApiResponseCode == 0) {
//API returned success.
//Refer to (API Response Codes) for API Response codes.
//Submit result.ResultKey to your server for further
//processing(Refer Lookup Token Result)
}
else {
errors = result.Errors;
}
}
else if(result.AjaxResponseType == 1) {
//Error with AJAX call
errors = result.Errors;
}
else if(result.AjaxResponseType == 2) {
//AJAX call timed out
errors = result.Errors;
}
//Show errors on the page
if (errors.length > 0) {
var ul = $("<ul></ul>");
$.each(errors, function (i, r) {
ul.append("<li>" + r.Message + "</li>");
});
$(".validation-summary").append(ul).show();
}
}
Result
The result object is described as below:
Property | Type | Description |
---|---|---|
AjaxResponseType |
numeric |
This is the result of the AJAX call. This will assist you in handling the call back. Possible values are 0, 1 or 2. Where 0 is success, 1 is error and 2 is timeout. |
ApiResponseCode |
numeric |
This is the response code returned by the API Please refer to Appendix (API Response Codes) for possible values |
Errors |
array Refer to Error Object |
List of errors returned, e.g. validation errors. |
ResultKey |
string | This is the result key that you will have to submit to retrieve the token information, "Lookup Add/Update Token Result" (Refer Lookup Token Result). |
Update Token
"SetupUpdateToken" as explained above is the simple approach to start updating previously stored card or bank account information using the API. For more control over the user experience, please follow the custom method as described below.
Process update token
Invoke the process update token method as explained below when you are ready to update the token e.g. a button click. "ProcessUpdateToken" is an asynchronous call - it returns immediately and invokes the "CallbackFunction" when it received a response from the server.
merchantsuite.ProcessUpdateToken({
AuthKey: $("#AuthKey").val(),
Reference1: $("#Reference1").val(),
Reference2: $("#Reference2").val(),
Reference3: $("#Reference3").val(),
EmailAddress: $("#EmailAddress").val(),
Type: "CREDITCARD",
CardHolderName: $("#CardHolderName").val(),
CardNumber: $("#CardNumber").val(),
ExpiryMonth: $("#CardExpiryMonth").val(),
ExpiryYear: $("#CardExpiryYear").val(),
CallbackFunction: ProcessUpdateTokenCallBack
});
Method Parameters
Property | Type | Description |
---|---|---|
AuthKey |
string | Unique key created using the "Create AuthKey" operation (Refer AuthKey Update Token). You may store this in a hidden field and then pass the value. (MaxLen = 500) |
Reference1 |
string | Reference 1 to store with the token (MaxLen = 50) Optional if supplied while creating the AuthKey (Refer AuthKey Update Token) |
Reference2 |
string | Reference 2 to store with the token (MaxLen = 50) Optional |
Reference3 |
string | Reference 3 to store with the token (MaxLen = 50) Optional |
EmailAddress |
string | Email address to store with the token (MaxLen = 250) Optional |
Type |
string | The type of information that you wish to store. E.g. CREDITCARD for storing a CreditCard or BANKACCOUNT for storing a bank account.Optional |
CardHolderName |
string | Name on the card (MaxLen = 50) Optional |
CardNumber |
numeric | Card number you wish to tokenise MANDATORYif TYPE is CREDITCARD |
ExpiryMonth |
numeric | Expiry month of the card MANDATORYif TYPE is CREDITCARD |
ExpiryYear |
numeric | Expiry year of the card MANDATORYif TYPE is CREDITCARD |
CallbackFunction |
function | This is a callback you provide to handle the response from the API. Please see below for more information on this. |
The "CallbackFunction" is a JavaScript function you provide to handle the response from the API. It does the following:
- If the payment information entered by the user returned an error, display it on the page
- If an error was not returned, then submit the result back to your server to call the "Lookup Add/Update Token Result" (Refer Lookup Token Result) and render the conformation receipt. Note: It is recommended that you do not submit the card details to your server, and only submit the result of the call back to your server.
Below is a sample implementation of "ProcessUpdateTokenCallBack":
function ProcessUpdateTokenCallBack(result) {
var errors = new Array();
if (result.AjaxResponseType == 0) {
//AJAX call was successful
if (result.ApiResponseCode == 0) {
//API returned success.
//Refer to Appendix (API Response Codes) for API Response codes.
//Submit result.ResultKey to your server for further
//processing(Refer Lookup Token Result)
}
else {
errors = result.Errors;
}
}
else if(result.AjaxResponseType == 1) {
//Error with AJAX call
errors = result.Errors;
}
else if(result.AjaxResponseType == 2) {
//AJAX call timed out
errors = result.Errors;
}
//Show errors on the page
if (errors.length > 0) {
var ul = $("<ul></ul>");
$.each(errors, function (i, r) {
ul.append("<li>" + r.Message + "</li>");
});
$(".validation-summary").append(ul).show();
}
}
Result
The result object is described as below:
Property | Type | Description |
---|---|---|
AjaxResponseType |
numeric |
This is the result of the AJAX call. This will assist you in handling the call back. Possible values are 0, 1 or 2. Where 0 is success, 1 is error and 2 is timeout. |
ApiResponseCode |
numeric |
This is the response code returned by the API Please refer to (API Response Codes) for possible values |
Errors |
array Refer to Error Object |
List of errors returned, e.g. validation errors. |
ResultKey |
string | This is the result key that you will have to submit to retrieve the token information, "Lookup Add/Update Token Result" (Refer Lookup Token Result). |
3 Party Redirect
Add Token Redirect
Note: The token add page presented to the cardholder comes directly from MerchantSuite.
To add a token using this method, the cardholder's browser must be directed to the appropriate URL using either a hyperlink or HTTP 302 redirect. In both cases, two values are required to be included:
- merchantAlias, By default this is the same as your MerchantSuite Membership ID (for example, MS123456)
- authKey - Obtained via AuthKey Add call
Hyperlink example
Render a link on your page similar to the following - this will direct the cardholder to the Hosted Payment Page
<a href="https://www.merchantsuite.com/pay/{MerchantAlias}.adddv?in_sessionid={authKey}">Add your payment details</a>
Redirect example
Send the following HTTP 302 Redirect to the cardholder's browser - this will direct the cardholder to the Hosted Payment Page
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: https://www.merchantsuite.com/pay/{MerchantAlias}.adddv?in_sessionid={authKey}
Response
An API response will be appended to the query string of the redirection URL specified in the authkey request.
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=415d2da7-0cf1-4c75-8c8b-754bba573647
Set-Cookie: ASP.NET_SessionId=g0mgvdi2hzjj1jhibr3vnj2j; path=/; secure; HttpOnly
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:56:18 GMT
Content-Length: 0
Update Token Redirect
Note: The token update page presented to the cardholder comes directly from MerchantSuite.
To update a token using this method, the cardholder's browser must be directed to the appropriate URL using either a hyperlink or HTTP 302 redirect. In both cases, two values are required to be included:
- merchantAlias, By default this is the same as your MerchantSuite Membership ID (for example, MS123456)
- authKey - Obtained via AuthKey Update call
Hyperlink example
Render a link on your page similar to the following - this will direct the cardholder to the Hosted Payment Page
<a href="https://www.merchantsuite.com/pay/{MerchantAlias}.updatedv?in_sessionid={authKey}">Update your Payment details</a>
Redirect example
Send the following HTTP 302 Redirect to the cardholder's browser - this will direct the cardholder to the Hosted Payment Page
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: https://www.merchantsuite.com/pay/{MerchantAlias}.updatedv?in_sessionid={authKey}
Response
An API response will be appended to the query string of the redirection URL specified in the authkey request.
HTTP/1.1 302 Found
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Location: http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=415d2da7-0cf1-4c75-8c8b-754bba573647
Set-Cookie: ASP.NET_SessionId=g0mgvdi2hzjj1jhibr3vnj2j; path=/; secure; HttpOnly
p3p: CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:56:18 GMT
Content-Length: 0
3 Party Iframe
3 Party Token Add Iframe
There are two available methods.
- Submit button inside iframe (multi page / button mode)
- Submit button outside iframe (single page / button mode)
Submit button inside example
If IframeParameters.ShowSubmitButton is set to true in a create AuthKey request (see AuthKey) then the iframe add Token page will operate in the multi-page / button mode. In this mode the "Process Add Token Iframe" method (See submit button outside example) does not need to be invoked. Instead, the TokenReq.Crn1 parameter needs to be submitted in the create AuthKey call.
<iframe src="https://www.merchantsuite.com/api/v2/tokens/iframe/add/{authKey}" frameborder="0"></iframe>
Clicking the "Submit" button inside iframe will process the add Token request and will redirect the iframe to the RedirectionUrl specified in the AuthKey request.
http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=13cfa799-8278-4872-a705-7ed49d516c0b
Request
Request is a TokenReq
(Token request details) JSON object with following properties.
Property | Type | Description |
---|---|---|
TokenReq |
object Refer to Token Request Object |
Token Request object |
Submit button outside example
If IframeParameters.ShowSubmitButton is either not set (default) or set to false in create AuthKey call (see AuthKey) then the iframe add Token page will operate in the single page / button mode. In this mode as the consumer enters their details into the card fields (card holder name, card number, expiry date), it will get stored on the AuthKey session. The Process Add Token Iframe (https://www.merchantsuite.com/api/v2/tokens/iframe/add/{authKey}) function will need to be invoked to process the add request, this can be either an ajax call or a server to server call.
Server to server example
POST https://www.merchantsuite.com/api/v2/tokens/iframe/add/{authKey} HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 247
Expect: 100-continue
Connection: Keep-Alive
{
"TokenReq" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith"
},
"AcceptBADirectDebitTC" : true,
"EmailAddress" : "john.smith@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : null
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$cardDetails = new MerchantSuite\AuthKeyCardDetails();
$cardDetails->setCardHolderName("cardholdername");
$addToken = new MerchantSuite\AddTokenViaIframe("{AuthKey}");
$addToken->setCredentials($credentials);
$addToken->setCardDetails($cardDetails);
$addToken->setEmailAddress("user@email.com");
$addToken->setReference1("Token Reference 1");
$addToken->setReference2("Token Reference 2");
$addToken->setReference3("Token Reference 3");
$response = $addToken->submit();
from MerchantSuite.Requests import Credentials, AddTokenViaIframe
from MerchantSuite.Utils import AuthKeyCardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = AddTokenViaIframe(credentials,"{AuthKey}")
request.base_url = "https://www.merchantsuite.com/api/v2"
request.card_details = AuthKeyCardDetails(card_holder_name = "MR C CARDHOLDER")
request.reference1 = "Ref One"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::AddTokenViaIframe.new("{AuthKey}")
req.credentials = cred
cc = MerchantSuite::AuthKeyCardDetails.new()
cc.card_holder_name = "Card Holder Name"
req.base_url = "https://www.merchantsuite.com/api/v2"
req.card_details = cc
req.reference1 = "reference 1"
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
CreditCardDetailsWith2PartExpiryDate cc = new CreditCardDetailsWith2PartExpiryDate();
cc.setCardHolderName("MR C CARDHOLDER");
AddTokenViaIframe req = new AddTokenViaIframe(credentials);
req.setAuthKey("{authKey}");
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setReference1("Java Token 1");
req.setCardDetails(cc);
ResultKeyResponse resp;
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
my $cc = MerchantSuite::AuthKeyCardDetails->new(card_holder_name => "MR C CARDHOLDER");
$req = MerchantSuite::AddTokenViaIframe->new(
credentials => $cred,
reference1 => "Perl Token 1",
card_details => $cc,
auth_key => "{authKey}");
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new AddDVTokenWithAuthKeyReq()
{
TokenReq = new TokenRequestWithAuthKey()
{
CardDetails = new CreditCardDetailsWith2PartExpiryDate(){
CardHolderName = "John Smith"
},
Reference1 = "12345",
Reference2 = "",
Reference3 = "",
EmailAddress = "john.smith@email.com.au"
}
};
var response = tokenClient.AddTokenViaIframe("{authKey}",apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var cc = new api.AuthKeyCardDetails({
CardHolderName : "MR C CARDHOLDER"});
var req = new api.AddTokenViaIframe({
Reference1: "NodeJS Token 1",
EmailAddress: "notatoken@token.com",
CardDetails: cc,
AuthKey: "{AuthKey}"});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Ajax example
<div class="validation-summary"></div>
<div>
<label>Reference1:</label>
<input id="Reference1" name="Reference1" type="text"/>
</div>
<div>
<label>Reference2:</label>
<input id="Reference2" name="Reference2" type="text"/>
</div>
<div>
<label>Reference3:</label>
<input id="Reference3" name="Reference3" type="text"/>
</div>
<div>
<label>EmailAddress:</label>
<input id="EmailAddress" name="EmailAddress" type="text"/>
</div>
<div>
<label>CardHolderName:</label>
<input id="CardHolderName" name="CardHolderName" type="text"/>
</div>
<div>
<iframe src="https://www.merchantsuite.com/api/v2/tokens/iframe/add/{authKey}" frameborder="0"></iframe>
</div>
<div>
<button id="btnProcess" type="button">Process</button>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#btnProcess").click(function () {
$("input").attr("disabled", "disabled");
setTimeout(ProcessTokenisation, 1000);
});
});
function ProcessTokenisation() {
$(".validation-summary").empty().hide();
var url = "https://www.merchantsuite.com/api/v2/tokens/iframe/add/{authKey}";
var jsonModel = JSON.stringify(GetModelForProcessing());
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
url: url,
data: jsonModel,
success: function (result) {
$("input").removeAttr("disabled");
if (result && result.APIResponse) {
if (result.APIResponse.ResponseCode == 0) {
window.location.href = result.RedirectionUrl;
}
else
ShowError(result.APIResponse.ResponseText);
}
else {
ShowError("Error processing your request. Response from API is either empty or invalid.");
}
},
error: function (jqXhr, textStatus) {
$("input").removeAttr("disabled");
$("#btnProcess").removeAttr("disabled");
ShowError("AJAX Error processing your request. XHR Status: " + textStatus);
}
});
}
function ShowError(errorText) {
var ul = $("<ul></ul>");
ul.append("<li>" + errorText + "</li>");
$(".validation-summary").append(ul).show();
}
function GetModelForProcessing() {
var model = new Object();
model.TokenReq = new Object();
model.TokenReq.Crn1 = $("#CRN1").val();
model.TokenReq.Crn2 = $("#CRN2").val();
model.TokenReq.Crn3 = $("#CRN3").val();
model.TokenReq.EmailAddress = $("#EmailAddress").val();
model.TokenReq.CardDetails = new Object();
model.TokenReq.CardDetails.CardHolderName = $("#CardHolderName").val();
return model;
}
</script>
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
ResultKey |
string | This is the result key that you will have to submit to retrieve the add token result and present the receipt to the customer, "Lookup Token Result" (Refer Lookup Token Result). |
RedirectionUrl |
string | URL to use for redirection (if you receive an ApiResponseCode of 300, perform a full browser redirect with this value). |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 144
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=qmytl98r23956x2998tyuins; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:27:07 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"ResultKey" : "df998fea-f309-4e6e-9629-7149799dc028",
"RedirectionUrl" : "http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=df998fea-f309-4e6e-9629-7149799dc028"
}
3 Party Token Update Iframe
There are two available methods.
- Submit button inside iframe (multi page / button mode)
- Submit button outside iframe (single page / button mode)
Submit button inside example
If IframeParameters.ShowSubmitButton is set to true in a create AuthKey request (see AuthKey) then the iframe update Token page will operate in the multi-page / button mode. In this mode the "Process Update Token Iframe" method (See submit button outside example) does not need to be invoked. Instead, the TokenReq.Crn1 parameter needs to be submitted in the create AuthKey call.
<iframe src="https://www.merchantsuite.com/api/v2/tokens/iframe/update/{authKey}" frameborder="0"></iframe>
Clicking the "Submit" button inside iframe will process the update Token request and will redirect the iframe to the RedirectionUrl specified in the AuthKey request.
http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=13cfa799-8278-4872-a705-7ed49d516c0b
Request
Request is a TokenReq
(Token request details) JSON object with following properties.
Property | Type | Description |
---|---|---|
TokenReq |
object Refer to Token Request Object |
Token Request object |
Submit button outside example
If IframeParameters.ShowSubmitButton is either not set (default) or set to false in create AuthKey call (see AuthKey) then the iframe update Token page will operate in the single page / button mode. In this mode as the consumer enters their details into the card fields (card holder name, card number, expiry date), it will get stored on the AuthKey session. The Process Update Token Iframe (https://www.merchantsuite.com/api/v2/tokens/iframe/update/{authKey}) function will need to be invoked to process the update request, this can be either an ajax call or a server to server call.
Server to server example
POST https://www.merchantsuite.com/api/v2/tokens/iframe/update/{authKey} HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Content-Type: application/json; charset=utf-8
Host: www.merchantsuite.com
Content-Length: 247
Expect: 100-continue
Connection: Keep-Alive
{
"TokenReq" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith"
},
"AcceptBADirectDebitTC" : true,
"EmailAddress" : "john.smith@email.com.au",
"Reference1" : "12345",
"Reference2" : "",
"Reference3" : null
}
}
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$cardDetails = new MerchantSuite\AuthKeyCardDetails();
$cardDetails->setCardHolderName("cardholdername");
$addToken = new MerchantSuite\UpdateTokenViaIframe("{AuthKey}");
$addToken->setCredentials($credentials);
$addToken->setCardDetails($cardDetails);
$addToken->setEmailAddress("user@email.com");
$addToken->setReference1("Token Reference 1");
$addToken->setReference2("Token Reference 2");
$addToken->setReference3("Token Reference 3");
$response = $addToken->submit();
from MerchantSuite.Requests import Credentials, UpdateTokenViaIframe
from MerchantSuite.Utils import AuthKeyCardDetails
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = UpdateTokenViaIframe(credentials,"{AuthKey}")
request.base_url = "https://www.merchantsuite.com/api/v2"
request.card_details = AuthKeyCardDetails(card_holder_name = "MR C CARDHOLDER")
request.reference1 = "Ref One"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::UpdateTokenViaIframe.new("{AuthKey}")
req.credentials = cred
cc = MerchantSuite::AuthKeyCardDetails.new()
cc.card_holder_name = "Card Holder Name"
req.base_url = "https://www.merchantsuite.com/api/v2"
req.card_details = cc
req.reference1 = "reference 1"
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
CreditCardDetailsWith2PartExpiryDate cc = new CreditCardDetailsWith2PartExpiryDate();
cc.setCardHolderName("MR C CARDHOLDER");
UpdateTokenViaIframe req = new UpdateTokenViaIframe(credentials);
req.setAuthKey("{authKey}");
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
req.setReference1("Java Token 1");
req.setCardDetails(cc);
ResultKeyResponse resp;
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
my $cc = MerchantSuite::AuthKeyCardDetails->new(card_holder_name => "MR C CARDHOLDER");
$req = MerchantSuite::UpdateTokenViaIframe->new(
credentials => $cred,
reference1 => "Perl Token 1",
card_details => $cc,
auth_key => "{authKey}");
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var apiReq = new UpdateTokenWithAuthKeyReq()
{
TokenReq = new TokenRequestWithAuthKey()
{
CardDetails = new CreditCardDetailsWith2PartExpiryDate(){
CardHolderName = "John Smith"
},
Reference1 = "12345",
Reference2 = "",
Reference3 = "",
EmailAddress = "john.smith@email.com.au"
}
};
var response = tokenClient.UpdateTokenViaIframe("{authKey}",apiReq);
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var cc = new api.AuthKeyCardDetails({
CardHolderName : "MR C CARDHOLDER"});
var req = new api.UpdateTokenViaIframe({
Reference1: "NodeJS Token 1",
EmailAddress: "notatoken@token.com",
CardDetails: cc,
AuthKey: "{AuthKey}"});
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Not Available
//Not Available
Ajax example
<div class="validation-summary"></div>
<div>
<label>Reference1:</label>
<input id="Reference1" name="Reference1" type="text"/>
</div>
<div>
<label>Reference2:</label>
<input id="Reference2" name="Reference2" type="text"/>
</div>
<div>
<label>Reference3:</label>
<input id="Reference3" name="Reference3" type="text"/>
</div>
<div>
<label>EmailAddress:</label>
<input id="EmailAddress" name="EmailAddress" type="text"/>
</div>
<div>
<label>CardHolderName:</label>
<input id="CardHolderName" name="CardHolderName" type="text"/>
</div>
<div>
<iframe src="https://www.merchantsuite.com/api/v2/tokens/iframe/update/{authKey}" frameborder="0"></iframe>
</div>
<div>
<button id="btnProcess" type="button">Process</button>
</div>
<script type="text/javascript">
$(document).ready(function () {
$("#btnProcess").click(function () {
$("input").attr("disabled", "disabled");
setTimeout(ProcessTokenisation, 1000);
});
});
function ProcessTokenisation() {
$(".validation-summary").empty().hide();
var url = "https://www.merchantsuite.com/api/v2/tokens/iframe/update/{authKey}";
var jsonModel = JSON.stringify(GetModelForProcessing());
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
url: url,
data: jsonModel,
success: function (result) {
$("input").removeAttr("disabled");
if (result && result.APIResponse) {
if (result.APIResponse.ResponseCode == 0) {
window.location.href = result.RedirectionUrl;
}
else
ShowError(result.APIResponse.ResponseText);
}
else {
ShowError("Error processing your request. Response from API is either empty or invalid.");
}
},
error: function (jqXhr, textStatus) {
$("input").removeAttr("disabled");
$("#btnProcess").removeAttr("disabled");
ShowError("AJAX Error processing your request. XHR Status: " + textStatus);
}
});
}
function ShowError(errorText) {
var ul = $("<ul></ul>");
ul.append("<li>" + errorText + "</li>");
$(".validation-summary").append(ul).show();
}
function GetModelForProcessing() {
var model = new Object();
model.TokenReq = new Object();
model.TokenReq.Crn1 = $("#CRN1").val();
model.TokenReq.Crn2 = $("#CRN2").val();
model.TokenReq.Crn3 = $("#CRN3").val();
model.TokenReq.EmailAddress = $("#EmailAddress").val();
model.TokenReq.CardDetails = new Object();
model.TokenReq.CardDetails.CardHolderName = $("#CardHolderName").val();
return model;
}
</script>
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
ResultKey |
string | This is the result key that you will have to submit to retrieve the update token result and present the receipt to the customer, "Lookup Token Result" (Refer Lookup Token Result). |
RedirectionUrl |
string | URL to use for redirection (if you receive an ApiResponseCode of 300, perform a full browser redirect with this value). |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 144
Content-Type: application/json; charset=utf-8
Set-Cookie: ASP.NET_SessionId=qmytl98r23956x2998tyuins; path=/; secure; HttpOnly
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:27:07 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"ResultKey" : "df998fea-f309-4e6e-9629-7149799dc028",
"RedirectionUrl" : "http://yourmerchantwebsite.com/tokenreceipt?ResponseCode=0&ResponseText=Success&ResultKey=df998fea-f309-4e6e-9629-7149799dc028"
}
Lookup Token Result
Retrieves result of a token added/updated via operation using Browser integration method. Should the resultKey value not be available, a token search (see 2 Party Search Tokens) should be performed to confirm that the token is in place and required details retrieved.
URL
GET
/tokens/withauthkey/{resultKey}
URL Parameters
resultKey
- result key returned in a response to add/update transaction operation
Request Headers
This is a merchant integration method. You will be required to supply following HTTP headers with your GET request
- Authorization
- base64 encoded API user credentials
Response Headers
- Content-Type
- application/json; charset=utf-8
GET https://www.merchantsuite.com/api/v2/tokens/withauthkey/03a038f5-ae28-44a4-a8d0-8c78279f5445 HTTP/1.1
Authorization: dXNlcm5hbWV8bWVtYmVyc2hpcGlkOnBhc3N3b3Jk
Host: www.merchantsuite.com
include ("./API/MerchantSuite.php");
MerchantSuite\URLDirectory::setBaseURL("reserved","https://www.merchantsuite.com/api/v2");
$credentials = new MerchantSuite\Credentials("APIUserName", "Passw0rd", "MS123456", MerchantSuite\Mode::Live);
$reskey = new MerchantSuite\TokenResultKeyRetrieval();
$reskey->setCredentials($credentials);
$reskey->setResultKey("03a038f5-ae28-44a4-a8d0-8c78279f5445");
$response = $reskey->submit();
from MerchantSuite.Requests import Credentials, TokenResultKeyRequest
credentials = Credentials("APIUserName", "Passw0rd", "MS123456")
request = TokenResultKeyRequest(credentials,"03a038f5-ae28-44a4-a8d0-8c78279f5445")
request.base_url = "https://www.merchantsuite.com/api/v2"
response = request.submit()
require_relative "API/MerchantSuite"
cred = MerchantSuite::Credentials.new("APIUserName", "Passw0rd", "MS123456")
req = MerchantSuite::TokenAuthKeyResultRequest.new("03a038f5-ae28-44a4-a8d0-8c78279f5445")
req.base_url = "https://www.merchantsuite.com/api/v2"
req.credentials = cred
response = req.submit()
import com.MerchantSuite.api.*;
Credentials credentials = new Credentials("APIUserName", "Passw0rd", "MS123456");
Sender s = new Sender();
TokenResultKeyRequest req = new TokenResultKeyRequest(credentials, "03a038f5-ae28-44a4-a8d0-8c78279f5445");
TokenResp resp;
req.setBaseUrl("https://www.merchantsuite.com/api/v2");
resp = s.submit(req);
use MerchantSuite::API;
use Data::Inspect qw(p);
$MerchantSuite::Sender::base_url = "https://www.merchantsuite.com/api/v2";
my $cred = MerchantSuite::Credentials->new(
username => 'APIUserName',
password => 'Passw0rd',
membership_id => "MS123456"
);
my $req;
$req = MerchantSuite::TokenResultKeyRequest->new(
resultkey => "03a038f5-ae28-44a4-a8d0-8c78279f5445",
credentials => $cred);
$result = $req->submit();
using MerchantSuite.API.Client.V2;
using API.Client.Common;
using API.Client.Common.Helpers;
var tokenClient = ClientFactory.GetClientInstance<TokenClient>(
new JsonWebClientHelper(),
"https://www.merchantsuite.com/api/v2",
"APIUserName",
"MS123456",
"Passw0rd",
null);
var response = tokenClient.
RetrieveAddUpdateTokenResult("03a038f5-ae28-44a4-a8d0-8c78279f5445");
var MerchantSuite = require("./MerchantSuite_API/index.js");
var api = new MerchantSuite();
var req = new api.TokenResultKey(
"13cfa799-8278-4872-a705-7ed49d516c0b");
req.baseUrl("https://www.merchantsuite.com/api/v2");
var creds = req.credentials({
Username : "APIUserName",
Password: "Passw0rd",
MembershipID : "MS123456"});
var resp = req.submit(ResponseHandler, // Custom Callback Function
function(code, body) { console.log(code + " : " + body); }, // Error Callback Function
creds);
//Configure the ApiConfig.java file to input your API user and Merchant credentials
import main.java.com.merchantsuite.android.api.ApiManager;
String authKey = "13cfa799-8278-4872-a705-7ed49d516c0b";
String response = lookupAddUpdateDataVaultWithTokenResult(authKey);
//Not Available
Response
Response is a JSON object with the following properties.
Property | Type | Description |
---|---|---|
APIResponse |
object Refer to API Response Object |
APIResponse object |
TokenResp |
object Refer to Token Response Object |
TokenResp object |
HTTP/1.1 200 OK
Cache-Control: private,no-store,no-cache,must-revalidate,proxy-revalidate
Pragma: no-cache
Content-Length: 359
Content-Type: application/json; charset=utf-8
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: Content-Type
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Max-Age: 1728000
Date: Fri, 12 Dec 2014 01:57:56 GMT
{
"APIResponse" : {
"ResponseCode" : 0,
"ResponseText" : "Success"
},
"TokenResp" : {
"BankAccountDetails" : null,
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"EmailAddress" : "john.smith@email.com.au",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"Token" : "5999999789012346"
}
}
WebHooks
WebHooks are an asynchronous notification mechanism. They are triggered by operations invoked using the Browser integration method. They notify merchant systems that a successful operation has taken place and provides the detailed result.
WebHooks are triggered only if the merchant has provided a WebHook URL in the request to obtain an AuthKey. The system will attempt the WebHook notification upon transaction completion, retrying at 1 hour intervals until successfully acknowledged by the merchant or the retry period has expired. The retry period is 24 hours.
To acknowledge a WebHook notification, the merchant's application must respond to the request with the HTTP Status Code 200. HTTP responses with Status Codes other than 200 will be interpreted as the WebHook call having failed, with retries being attempted until a response featuring a HTTP Status Code of 200 is received or the retry period expires.
Note: There is a possibility that multiple WebHook calls for the same action may be seen by the Merchant's server. For this reason, it is important that WebHook request contents are checked for uniqueness prior to updating data.
Note: China UnionPay transactions will always have a response code of "P". You will need to poll MerchantSuite using the 2 Party Search Transaction method to obtain the result. China UnionPay only returns a response for approved transactions. If the transaction is not completed and approved within 2 hours then a response code of "3" - "TIMED_OUT" will be returned.
Originating IP addresses
WebHook calls originate from specified IP addresses. Please refer to the Firewall Configuration section under References
Consuming a WebHook call
All WebHook calls are HTTP POST methods containing a JSON payload. The contents of the payload depend on the action that caused the WebHook call to be made, as per the following table:
Request Type:
Payload:
- Process Transaction
- APIResponse and TxnResp (see section 3 Party Redirect)
- Add Token
- APIResponse and TokenResp (see section AuthKey Add)
- Update Token
- APIResponse and TokenResp (see section AuthKey Update)
Example WebHook Request Triggered by Process Transaction operation
POST http://yourmerchantwebsite.com/txnWebHook HTTP/1.1
Content-Type: application/json; charset=utf-8
Host: merchant.com
Content-Length: 827
Expect: 100-continue
Proxy-Connection: Keep-Alive
{
"Action" : "payment",
"Amount" : 19900,
"AmountSurcharge" : 0,
"Authentication3DSResponse" : null,
"AuthoriseID" : "380662",
"BankAccountDetails" : null,
"BankResponseCode" : "00",
"CVNResult" : {
"CVNResultCode" : "Unsupported"
},
"CardDetails" : {
"CardHolderName" : "John Smith",
"ExpiryDate" : "0521",
"MaskedCardNumber" : "512345...346"
},
"CardType" : "MC",
"Currency" : null,
"InternalNote" : "test merchant ref",
"Is3DS" : false,
"IsCVNPresent" : true,
"MembershipID" : "MS123456",
"OriginalTxnNumber" : null,
"ProcessedDateTime" : "2014-12-12T12:21:00.8300000",
"RRN" : "434612380662",
"ReceiptNumber" : "49316511178",
"Reference1" : "test reference1",
"Reference2" : "test reference2",
"Reference3" : "test reference3",
"ResponseCode" : "0",
"ResponseText" : "Approved",
"PaymentReason" : null,
"SettlementDate" : "20141212",
"Source" : "api",
"StoreCard" : false,
"SubType" : "single",
"TxnNumber" : "1178",
"Type" : "internet"
}
3D Secure
3D Secure 2.0 helps prevent fraud for eCommerce and online payments. Customers are quickly verified so they get a smoother, more secure payment experience. You get increased protection against disputes and chargebacks relating to fraud. To understand more about 3D Secure 2.0 and how it works, please check it here.
How to enable 3D Secure on the BPOINT Hosted Payment Page
To enable 3D Secure 2.0 on your BPOINT Hosted Payment Page, please contact your Relationship Manager or our Merchant Support Helpdesk on 1800 230 177 (option 1, 3, 1) Monday to Friday 9am to 5pm (AEST).
How to enable 3D Secure on the BPOINT API
To enable 3D Secure 2.0 on the BPOINT API, please contact your Relationship Manager or our Merchant Support Helpdesk on 1800 230 177 (option 1, 3, 1) Monday to Friday 9am to 5pm (AEST).
You could be asked to provide your Merchant ID, Merchant technical contact SPOC email ID, API version, and API method being used.
To help you understand about the availability of 3D Secure 2.0 for each API payment method in API v2, please refer to the table below. An API upgrade might be needed in order to obtain 3D Secure 2.0 on certain payment method(s).
Additional requirements
Where possible for an integration, please ensure Email address and Cardholder name are provided to prevent a Challenge by 3D Secure.
Payment method | 3D Secure 2.0 availability |
---|---|
2 Party Payment | No |
3 Party Redirect | Yes |
3 Party Iframe | No |
Webform | Yes |
JavaScript - Simple | Yes |
JavaScript - Advanced | Yes |
Plugins
References
API Response Codes
A list of the api response codes.
Response Code | Description |
---|---|
0 |
Success |
1 |
Invalid credentials |
2 |
Invalid permissions |
3 |
User not found |
100 |
Invalid field: original amount |
101 |
Invalid field: action |
102 |
Invalid field: type |
103 |
Invalid field: subtype |
104 |
Invalid field: merchant number |
105 |
Invalid field: biller code |
106 |
Invalid field: Reference1 |
107 |
Invalid field: Reference2 |
108 |
Invalid field: Reference3 |
109 |
Invalid field: currency |
110 |
Invalid field: amount |
111 |
Invalid field: merchant reference |
112 |
Invalid field: card number |
113 |
Invalid field: cardholder name |
114 |
Invalid field: expiry date |
115 |
Invalid field: CVN |
116 |
Invalid field: web hook URL |
117 |
Invalid field: redirection URL |
118 |
Invalid field: transaction number |
119 |
Invalid field: original transaction number |
120 |
Invalid field: receipt number |
121 |
Invalid field: settlement date |
122 |
Invalid field: masked card number |
123 |
Invalid field: Token |
124 |
Invalid field: bank account number |
125 |
Invalid field: BSB number |
126 |
Invalid field: bank account name |
127 |
Invalid field: email address |
128 |
Invalid field: store card |
131 |
Invalid field: surcharge amount |
132 |
Invalid field: country code |
133 |
Invalid field: phone number |
134 |
Invalid field: sms message |
135 |
Invalid field: wallet amount should be greater than 0 |
136 |
Invalid field: wallet reference1, should not be Null or empty |
137 |
Invalid field: amount should be greater than 0 if ShowSubmitButton setting is set to true |
138 |
Invalid field: reference1 should not be null or empty if ShowSubmitButton setting is set to true |
139 |
Hide PaymentReason flag set to true but PaymentReason not provided |
140 |
Shopify: missing required field |
141 |
Shopify: invaild signature |
142 |
Shopify: key not found |
143 |
Empty payment page base URL |
144 |
Card number not allowed for token payments |
145 |
Invalid field: return URL |
146 |
Invalid field: agent |
147 |
Invalid field: agent phone number |
201 |
Transaction not found |
202 |
Token not found |
203 |
Transaction type cannot be tokenised |
204 |
Transactions cannot be tokenised because cardholder has not given permission |
205 |
Biller code not found |
206 |
Session not found |
207 |
Invalid session |
208 |
Transaction must be approved to be tokenised |
209 |
Search returned no results |
210 |
Merchant details not found |
211 |
Merchant account settings not found |
212 |
Country code not allowed |
213 |
Could not issue secure code |
214 |
Could not verify secure code |
215 |
Invalid secure code |
216 |
Wallet not found |
217 |
Amex wallet error |
218 |
Amex wallet card data not found |
219 |
Only credit card tokens accepted |
220 |
DataVault operation not supported |
221 |
Action not applied |
300 |
Follow redirection (perform a full browser redirect with the value given in RedirectionUrl property, if you receive this response code) |
900 |
One or more sub-systems are currently unavailable |
999 |
Fatal error |
TxnResp Responses
A list of the transaction response codes.
Response Code | Bank Response Code | Response Text |
---|---|---|
0 |
00 |
Approved |
0 |
08 |
Honour with ID |
0 |
16 |
Approved, Update Track 3 |
1 |
09 |
Request in progress |
1 |
10 |
Approved for partial amount |
1 |
11 |
Approved VIP |
1 |
12 |
Invalid transaction |
1 |
13 |
Invalid amount |
1 |
17 |
Customer cancellation |
1 |
18 |
Customer dispute |
1 |
20 |
Invalid response |
1 |
21 |
No action taken |
1 |
22 |
Suspected malfunction |
1 |
23 |
Unacceptable transaction fee |
1 |
24 |
File update not supported by receiver |
1 |
26 |
Duplicate file update record, old record replaced |
1 |
27 |
File update field edit error |
1 |
28 |
File update file locked out |
1 |
29 |
File update not successful, contact acquirer |
1 |
30 |
Format error |
1 |
32 |
Completed partially |
1 |
35 |
Card acceptor contact acquirer |
1 |
37 |
Card acceptor call acquirer security |
1 |
38 |
Allowable PIN tries exceeded |
1 |
40 |
Request function not supported |
1 |
42 |
No universal account |
1 |
44 |
No investment account |
1 |
45 |
Reserved for ISO use |
1 |
46 |
Reserved for ISO use |
1 |
47 |
Reserved for ISO use |
1 |
48 |
Reserved for ISO use |
1 |
49 |
Reserved for ISO use |
1 |
50 |
Reserved for ISO use |
1 |
52 |
No cheque account |
1 |
53 |
No savings account |
1 |
55 |
Incorrect PIN |
1 |
56 |
No card record |
1 |
57 |
Transaction not permitted to cardholder |
1 |
58 |
Transaction not permitted to acquirer |
1 |
60 |
Card acceptor contact acquirer |
1 |
62 |
Restricted card |
1 |
63 |
Security violation |
1 |
64 |
Original amount incorrect |
1 |
66 |
Card acceptor call acquirer's security department |
1 |
67 |
Hard capture (requires that the card be picked up at ATM) |
1 |
69 |
Reserved for ISO use |
1 |
70 |
Reserved for ISO use |
1 |
71 |
Reserved for ISO use |
1 |
72 |
Reserved for ISO use |
1 |
73 |
Reserved for ISO use |
1 |
74 |
Reserved for ISO use |
1 |
75 |
Allowable number of PIN tries exceeded |
1 |
76 |
Reserved for private use |
1 |
77 |
Reserved for private use |
1 |
78 |
Reserved for private use |
1 |
79 |
Life cycle (Mastercard use only) |
1 |
80 |
Reserved for private use |
1 |
81 |
Reserved for private use |
1 |
82 |
Policy (Mastercard use only) |
1 |
83 |
Fraud/Security (Mastercard use only) |
1 |
84 |
Reserved for private use |
1 |
85 |
Reserved for private use |
1 |
86 |
Reserved for private use |
1 |
87 |
Reserved for private use |
1 |
88 |
Reserved for private use |
1 |
89 |
Reserved for private use |
1 |
93 |
Transaction cannot be completed, violation of law |
1 |
94 |
Duplicate transmission |
1 |
95 |
Reconcile error |
1 |
96 |
System malfunction |
1 |
97 |
Advises that reconciliation totals have been reset |
2 |
01 |
Refer to card issuer |
2 |
02 |
Refer to card issuer's special conditions |
2 |
03 |
Invalid merchant |
2 |
04 |
Pick up card |
2 |
05 |
Do not honor |
2 |
06 |
Error |
2 |
07 |
Pick up card, special condition |
2 |
14 |
Invalid card number |
2 |
15 |
No such Issuer |
2 |
19 |
Re-enter transaction |
2 |
25 |
Unable to locate record on file |
2 |
31 |
Bank not supported by switch |
2 |
34 |
Suspected fraud |
2 |
36 |
Restricted card |
2 |
39 |
No credit account |
2 |
41 |
Lost card |
2 |
43 |
Stolen card, pick up |
2 |
59 |
Suspected fraud |
2 |
61 |
Exceeds withdrawal amount limits |
2 |
65 |
Exceeds withdrawal frequency limit |
2 |
90 |
Cut-off is in process (switch ending a days business and starting the next. Transaction can be sent again in a few minutes.) |
2 |
91 |
Issuer or switch inoperative |
2 |
92 |
Financial institution or intermediate network facility cannot be found for routing |
2 |
98 |
MAC error |
2 |
99 |
Reserved for National Use |
3 |
68 |
Response received too late |
4 |
33 |
Expired card |
4 |
54 |
Expired card |
5 |
51 |
Not sufficient funds |
? |
Response Unknown | |
6 |
Transaction Declined - Error Communicating with Bank | |
7 |
Payment Server Processing Error - Typically caused by invalid input data such as an invalid card number. Processing errors can also occur | |
8 |
Transaction Declined - Transaction Type Not Supported | |
9 |
Bank Declined Transaction (Do not contact Bank) | |
A |
Transaction Aborted | |
C |
Transaction Cancelled | |
D |
Deferred Transaction | |
E |
Issuer Returned a Referral Response | |
F |
3D Secure Authentication Failed | |
I |
Card Security Code Failed | |
L |
Shopping Transaction Locked (This indicates that there is another transaction taking place using the same shopping transaction number) | |
N |
Cardholder is not enrolled in 3D Secure (Authentication Only) | |
P |
Transaction is Pending | |
R |
Retry Limits Exceeded, Transaction Not Processed | |
S |
Duplicate OrderInfo used. (This is only relevant for Payment Servers that enforce the uniqueness of this field) | |
U |
Card Security Code Failed | |
PT_E1 |
Database error. | |
PT_E2 |
Unable to encrypt card number. | |
PT_E3 |
Unable to decrypt card number. | |
PT_E4 |
Server shutdown in progress. | |
PT_E5 |
Server busy, transaction timed out in queue and was not sent to the bank. | |
PT_E6 |
Processing aborted, payment server is shutting down. | |
PT_V1 |
Invalid transaction type. | |
PT_V2 |
Invalid financial type. | |
PT_V3 |
Invalid amount. | |
PT_V4 |
Invalid card number. | |
PT_V5 |
Invalid expiry date. | |
PT_V6 |
Invalid CVN. | |
PT_V7 |
Financial transaction type not supported by gateway. | |
PT_V8 |
Reversal not supported. | |
PT_V9 |
Merchant/biller details not found. | |
PT_V10 |
Unable to retrieve merchant/biller details. | |
PT_V11 |
Cardholder not authenticated (VbV, SecureCode). | |
PT_V12 |
Error authenticating cardholder (VbV, SecureCode). | |
PT_V13 |
Invalid BSB number. | |
PT_V14 |
Invalid account number. | |
PT_V15 |
Invalid account name. | |
PT_V16 |
Payment details not provided. | |
PT_V17 |
No valid DDA found. | |
PT_V18 |
Payment failed anti fraud rule validation. | |
PT_V19 |
Refund not allowed, daily refund limit of X reached. | |
PT_V20 |
Refund not allowed, daily refund amount limit of $x.xx exceeded. | |
PT_V21 |
Transaction blocked. | |
PT_V22 |
Invalid payment method. Provided card type is not supported by browser integration. | |
PT_V23 |
Currency code of refund: X must match currency code of original transaction: Y. | |
PT_T1 |
Token payment not allowed for Internet, IVR and call centre transaction types. | |
PT_T2 |
Card payment details not found for this token. | |
PT_T3 |
Unable to decrypt card number. | |
PT_T4 |
Unable to retrieve card payment details due to system error. | |
PT_T5 |
Token payment not supported. | |
PT_T6 |
Token not yet valid. | |
PT_T7 |
Token expired. | |
PT_R1 |
Original transaction not found. | |
PT_R2 |
Original transaction was not approved. | |
PT_R3 |
Original transaction is locked. | |
PT_R4 |
Transaction already fully refunded. | |
PT_R5 |
Only $x.xx available for refund. | |
PT_R6 |
Preauth transaction already completed. | |
PT_R7 |
Unable to verify if reversal can be processed. | |
PT_R8 |
Transaction already reversed. | |
PT_R9 |
Transaction partially refunded. | |
PT_R10 |
(Only for reversals of timed out transactions) Original transaction not found. | |
PT_R11 |
(Only for reversals of timed out transactions) Multiple instances of original transaction found. | |
PT_R12 |
(Only for reversals of timed out transactions) Original transaction was not successful. | |
PT_R13 |
(Only for reversals of timed out transactions) Original transaction number not found. | |
PT_R14 |
(Only for reversals of timed out transactions) Error looking up result of original transaction. | |
PT_R15 |
Invalid amount. Reversal amount must be the same as the amount of the original transaction. | |
PT_R16 |
DE payment already rejected. | |
PT_G1 |
Gateway configuration error. | |
PT_G2 |
Unable to build gateway request. | |
PT_G3 |
Unable to connect to gateway. | |
PT_G4 |
Unable to send transaction request data. | |
PT_G5 |
Unable to get response data. | |
PT_G6 |
Unable to process transaction. | |
PT_G7 |
Unable to process, server busy. | |
PT_G8 |
Unable to parse response data. | |
PT_G9 |
PayPal gateway error. | |
PT_G10 |
Payment response details not present in PayPal response. | |
PT_G11 |
PayPal communication error. | |
PT_G12 |
Gateway error. | |
PT_G13 |
Message response timeout. |
ThreeDS Responses
Eci Responses
Code | Description |
---|---|
0 |
MasterCard - merchant is not participating in ThreeDS |
1 |
MasterCard - Cardholder is not participating in ThreeDS |
2 |
MasterCard - Cardholder authenticated |
05 |
Visa - Fully authenticated Amex - Fully authenticated |
06 |
Visa - Not authenticated (cardholder is not participating in ThreeDS) Amex - Not authenticated (cardholder is enrolled, but authentication failed) |
07 |
Visa - Note authenticated. Usually related to a system issue. Amex - Not authenticated. |
Note: The values may change depending on the locale or Issuer. |
Enrolled Responses
Code | Description |
---|---|
Y |
Yes, cardholder is enrolled |
N |
No, cardholder is not enrolled |
U |
Unavailable to check |
Status Responses
Code | Description |
---|---|
Y |
Yes, cardholder authenticated |
N |
No, cardholder was not authenticated |
A |
Attempted Authentication |
U |
Unavailable to check |
Verify Status Responses
Code | Description |
---|---|
Y |
Cardholder successfully authenticated |
M |
Cardholder is not enrolled, but the Issuer attempted processing |
E |
Cardholder is not enrolled |
F |
Request format error |
N |
Verification failed |
S |
The signature on the response received from the Issuer could not be validated |
P |
Error receiving input from Issuer |
I |
Internal error |
U |
Verification was unable to be completed. This can be caused by network or system failures |
T |
The cardholder session timed out and the browser did not return from the Issuer's ThreeDS site |
A |
Merchant authentication failed |
D |
Communication error |
C |
Card type not supported |
Verify Type Responses
Code | Description |
---|---|
3DS |
ThreeDS |
SPA |
Secure Payment Authentication from MasterCard |
Firewall Configuration
For connections initiated by our servers (WebHook callbacks), all connections are initiated from the following IP addresses:
- 203.195.127.4 (Production)
- 202.166.187.3 (Production)
- 103.91.167.3 (UAT)
For WebHook calls, only requests to HTTP and HTTPS services (on ports 80 and 443 respectively) will be attempted.
Currency List
A list of the ISO 4217 currencies
ISO 4217 code | Currency Name |
---|---|
ALL |
Albanian Lek |
DZD |
Algerian Dinar |
ARS |
Argentine Peso |
AUD |
Australian Dollar |
BSD |
Bahamian Dollar |
BHD |
Bahraini Dinar |
BDT |
Bangladeshi Taka |
AMD |
Armenian Dram |
BBD |
Barbados Dollar |
BMD |
Bermudian Dollar |
BTN |
Bhutanese Ngultrum |
BOB |
Boliviano |
BWP |
Botswana Pula |
BZD |
Belize Dollar |
SBD |
Solomon Islands Dollar |
BND |
Brunei Dollar |
MMK |
Myanmar Kyat |
BIF |
Burundi Franc |
KHR |
Cambodian Riel |
CAD |
Canadian Dollar |
CVE |
Cape Verde Escudo |
KYD |
Cayman Islands Dollar |
LKR |
Sri Lanka Rupee |
CLP |
Chilean Peso |
CNY |
Yuan Renminbi |
KMF |
Comoros Franc |
CRC |
Costa Rican Colon |
HRK |
Croatian Kuna |
CUP |
Cuban Peso |
CZK |
Czech Koruna |
DKK |
Danish Krone |
DOP |
Dominican Peso |
ETB |
Ethiopian Birr |
ERN |
Eritrean Nakfa |
FKP |
Falkland Islands Pound |
FJD |
Fiji Dollar |
DJF |
Djibouti Franc |
GMD |
Gambian Dalasi |
GIP |
Gibraltar Pound |
GTQ |
Guatemalan Quetzal |
GNF |
Guinea Franc |
GYD |
Guyana Dollar |
HTG |
Haitian Gourde |
HNL |
Honduran Lempira |
HKD |
Hong Kong Dollar |
HUF |
Hungarian Forint |
ISK |
Iceland Krona |
INR |
Indian Rupee |
IDR |
Indonesian Rupiah |
IRR |
Iranian Rial |
IQD |
Iraqi Dinar |
ILS |
Israeli New Shekel |
JMD |
Jamaican Dollar |
JPY |
Japanese Yen |
KZT |
Kazakhstan Tenge |
JOD |
Jordanian Dinar |
KES |
Kenyan Shilling |
KPW |
North Korean Won |
KRW |
Korean Won |
KWD |
Kuwaiti Dinar |
KGS |
Kyrgyzstani Som |
LAK |
Lao Kip |
LBP |
Lebanese Pound |
LSL |
Lesotho Loti |
LRD |
Liberian Dollar |
LYD |
Libyan Dinar |
MOP |
Macau Pataca |
MWK |
Malawi Kwacha |
MYR |
Malaysian Ringgit |
MVR |
Maldive Rufiyaa |
MRO |
Mauritanian Ouguiya |
MUR |
Mauritius Rupee |
MXN |
Mexican Nuevo Peso |
MNT |
Mongolian Tugrik |
MDL |
Moldovan Leu |
MAD |
Moroccan Dirham |
OMR |
Omani Rial |
NAD |
Namibian Dollar |
NPR |
Nepalese Rupee |
ANG |
Netherlands Antillean guilder |
AWG |
Aruban Guilder |
VUV |
Vanuatu Vatu |
NZD |
New Zealand Dollar |
NIO |
Nicaraguan Cordoba Oro |
NGN |
Nigerian Naira |
NOK |
Norwegian Krone |
PKR |
Pakistan Rupee |
PAB |
Panamanian Balboa |
PGK |
Papua New Guinea Kina |
PYG |
Paraguay Guarani |
PEN |
Peruvian Nuevo Sol |
PHP |
Philippine Peso |
QAR |
Qatari Rial |
RUB |
Russian Ruble |
RWF |
Rwanda Franc |
SHP |
St. Helena Pound |
STD |
Dobra |
SAR |
Saudi Riyal |
SCR |
Seychelles Rupee |
SLL |
Sierra Leone Leone |
SGD |
Singapore Dollar |
VND |
Vietnamese Dong |
SOS |
Somali Shilling |
ZAR |
South African Rand |
SSP |
South Sudan Pound |
SZL |
Swaziland Lilangeni |
SEK |
Swedish Krona |
CHF |
Swiss Franc |
SYP |
Syrian Pound |
THB |
Thai Baht |
TOP |
Tongan Paanga |
TTD |
Trinidad and Tobago Dollar |
AED |
Arab Emirates Dirham |
TND |
Tunisian Dollar |
UGX |
Uganda Shilling |
MKD |
Denar |
EGP |
Egyptian Pound |
GBP |
Pound sterling |
TZS |
Tanzanian Shilling |
USD |
US Dollar |
UYU |
Uruguayan Peso |
UZS |
Uzbekistan Sum |
WST |
Samoan Tala |
YER |
Yemeni Rial |
TWD |
New Taiwan dollar |
CUC |
Cuban convertible peso |
ZWL |
Zimbabwean Dollar |
TMT |
Turkmenistani manat |
GHS |
Ghanaian cedi |
VEF |
Venezuelan bolívar |
SDG |
Sudanese pound |
RSD |
Serbian dinar |
MZN |
Mozambican metical |
AZN |
Azerbaijani manat |
RON |
Romanian new leu |
TRY |
Turkish lira |
XAF |
CFA franc BEAC |
XCD |
East Caribbean dollar |
XOF |
Communauté Financière Africaine (BCEAO) Franc |
XPF |
Comptoirs Franç ais du Pacifique (CFP) Franc |
XDR |
International Monetary Fund (IMF) Special Drawing Rights |
ZMW |
Zambia Kwacha |
SRD |
Suriname Dollar |
MGA |
Malagasy Ariary |
AFN |
Afghan Afghani |
TJS |
Tajikistani Somoni |
AOA |
Angolan Kwanza |
BYR |
Belarusian Ruble |
BGN |
Bulgarian lev |
CDF |
Congolese Franc |
BAM |
Bosnia and Herzegovina Convertible Marka |
EUR |
Euro |
UAH |
Ukrainian Hryvnia |
GEL |
Georgian Lari |
PLN |
Poland Zloty |
BRL |
Brazil Real |
Test Mode Transactions
Whilst integrating or otherwise testing, transactions can be performed in test mode for all payment types. Test transactions are visible and searchable in the backoffice but do not impact actual settlement, and can be differentiated by inspecting the IsTestTxn flag in the TxnResp object returned by the payment call (2-party), ResultKey or WebHook call (3-party).
Specific responses can be obtained for test mode transactions to test the various scenarios likely to be encountered whilst processing payments.
Test cards
Card Type: | Card Number: |
---|---|
MasterCard | 5123456789012346 |
MasterCard 2 Series | 2720010040360012 |
Visa | 4987654321098769 |
American Express | 345678901234564 |
Diners | 30123456789019 |
JCB | 3530111333300000 |
Simulating bank response codes
While performing test mode transactions, specific parameters can be provided to obtain specific simulated bank response codes (see section TxnResp Responses).
Response codes between 00 and 99 can be obtained in one of two ways:
-
A normally formatted, future-dated expiry date can be provided, in which case the response code will be the same as the last two digits of the provided transaction amount. For example, with an expiry date of 1121 (11/21) and an amount of 12011 ($120.11), a bank response code of 11 will be returned.
Specifying a CVN of 987 will result in the bank response code of 05 being returned for all amounts and standard expiry dates.
- A specially selected expiry date of the form 99XX (99/XX) can be provided, in which case the XX value will form the response code. For example, submitting a transaction with an expiry date of 9945 will result in a bank response code of 45 being returned
Simulating CVN Responses
The following CVN values can be submitted to obtain the listed simulated CVN responses responses:
CVN: | CVN Response: | Bank Response Code: |
---|---|---|
987 | N | 05, regardless of amount or expiry date |
876 | P | Determined by amount or expiry date (see section Simulating bank response codes) |
765 | U | Determined by amount or expiry date (see section Simulating bank response codes) |
All others | M | Determined by amount or expiry date (see section Simulating bank response codes) |
CVN responses:
Simulating timeouts
To simulate a timeout, an amount of 11199 ($111.99) can be specified. This will result in a 50 second delay before a PT_G5 response code is returned.