1. Guides
Merchant Warrior API 2.0
  • API
    • Getting Started
    • Guides
      • Xero Connection
      • Xero Custom URL
      • wooCommerce PayID
      • Middleware
      • Hostaway
    • Direct API
      • getAccessToken
      • processCard
      • processAuth
      • processCapture
      • processBatch
      • retrieveBatch (CSV)
      • retrieveBatch (JSON Response)
      • retrieveBatch (JSON Notify)
      • refundCard
      • queryCard
      • processDDebit
      • processDDebitAuth
      • processVoid
      • verifyCard
      • queryDD
      • queryBIN
      • getSettlement
      • checkEnrollment
      • checkPARes
      • addBlacklistedCard
      • removeBlacklistedCard
      • queryBlacklistedCard
      • simulateNotify
      • getSurcharge
    • 3DS 2.0
      • Introduction
      • 3DS 2 Authentication Flows
      • Step 3 - 3DS Method Data
      • Step 5 - Challenge
      • Step 1 - getAccessToken
      • Step 2 - checkEnrollment
      • Step 4 - checkTDSAuth
      • Step 6 - checkPARes
      • Step 7 - processCard
      • Authorization Only processCard
    • PayLink
      • Introduction
      • Generate PayLink
    • PayID
      • Introduction
      • Create
      • Transaction
      • Get
      • Update
      • Status
      • List
      • Refund
    • PayTo
      • Introduction
      • Simulator
      • Certification
      • Actions and Statuses
      • Agreements
        • Agreements
        • Notifications
        • Create Agreement
        • Get Agreement
        • Amend Agreement
        • Amend Agreement Status
        • Recall Agreement Action
      • Payments
        • Payments
        • Notifications
        • Create Payment
        • Get Payment
        • Get Payment Status
        • Search Payments
    • Confirmation of Payee
      • Introduction
      • Sandbox Simulations
      • Validate
    • POS
      • Introduction
      • processPOS
      • refundPOS
      • voidPOS
      • deregisterPOS
    • Web SDK
      • Introduction
      • Usage
      • getAccessToken
      • Options
      • Initiate
      • Payframe Functionality
      • Middleware
      • addCard
    • Payframe
      • Introduction
      • Usage
      • Constructor
      • tdsCheck
      • Additional Functions
      • Styling
      • processCard
      • processAuth
    • Digital Wallets
      • Apple Pay Prerequisites
      • Google Pay Prerequisites
      • Web SDK
      • Manual Integration
      • processCard
      • addCard
      • getMerchantSession
      • decryptApplePayToken
    • Token Payments
      • Introduction
      • Key Management
      • addCard
      • removeCard
      • cardInfo
      • changeExpiry
      • processCard
      • processAuth
    • Batch
      • Introduction
      • Card Batches
      • Token Batches
      • Direct Debit Batches
    • Forter
      • Introduction
      • Testing
    • Payouts
      • Introduction
      • Sandbox Simulations
      • Notifications
      • Create Payouts
      • Get Payout Status
      • Resend Notifications
      • Get Payout Transaction Status
      • Get Payout Transaction Notify
    • Partner API
      • Introduction
      • addMerchant
      • updateMerchant
      • checkMerchant
    • Notifications
      • Notifications
  • Hosted Payment Page
    • processCard
  1. Guides

Middleware

Introduction#

Any time a request must be made to Merchant Warrior, a POST request will be made to the URL that you have set as your middleware option. Your middleware needs to support the following Merchant Warrior methods by taking the input, inserting any appropriate missing information (such as hashes) and making a request to the Merchant Warrior API using the appropriate endpoint as listed here.

Methods#

Each method displayed below shows a sample of the data that is submitted via POST to your middleware, and a sample of the output that is returned back to the Web SDK.
getMerchantSession
Input
{
    "method": "getMerchantSession",
    "endpoint": " https://base.merchantwarrior.com/",
    "accessToken": " c82f7e5988fff6a439d0f43e6",
    "validationURL": "https://apple-pay-gateway-cert.apple.com/paymentservices/startSession",
    "domainName": "your.domain.com"
}
Output
{
    "responseCode": "0",
    "responseMessage": "Operation successful",
    "merchantSession": "{\"epochTimestamp\":1640236968964,\"expiresAt\":1640240568964,\"merchantSessionIdentifier\":\"SSHAE01E8377CFE46F2939FC7455BC491BF_916523AAED1343F5BC5815E12BEE9250AFFDC1A17C46B0DE5A943F0F94927C24\",\"nonce\":\"42635849\",\"merchantIdentifier\":\"2E93A3CD36CF5AF27A2A686C3AFE2EADCB0F74FBC3F1787D50CE51B40331C74F\",\"domainName\":\"your.domain.com\",\"displayName\":\"Widgets Pty Ltd\",\"signature\":\"\",\"retries\":0}"
}
processCard
Input
{
    "method": "processCard",
    "endpoint": "https://base.merchantwarrior.com/",
    "accessToken": "c82f7e5988fff6a439d0f43e6",
    "transactionAmount": "13.00",
    "transactionCurrency": "AUD",
    "transactionProduct": "Basic Charge",
    "digitalWalletToken": "{\"data\":\"\"},\"version\":\"EC_v1\"}",
    "customerName": "Jim Bob",
    "customerCountry": "US",
    "customerState": "QLD",
    "customerCity": "Brisbane",
    "customerAddress": "345 Ann Street",
    "customerPostCode": "4000",
    "customerPhone": "61412345678"
}
Output
{
    "responseCode": "0",
    "responseMessage": "Transaction approved",
    "transactionID": "1842-6ad84688-63b0-11ec-a43d-005056b2764e",
    "authCode": "7022993835",
    "receiptNo": "007022993835",
    "authMessage": "Honour with identification",
    "authResponseCode": "08",
    "authSettledDate": "2021-12-23",
    "transactionReferenceID": {},
    "custom1": {},
    "custom2": {},
    "custom3": {},
    "customHash": "1a3c3572c764e3f4b212e90a94419ea5",
    "paymentCardNumber": "520424XXXXXX6937",
    "transactionAmount": "13.00",
    "feeAmount": "0.00",
    "cardType": "mc",
    "cardExpiryMonth": "09",
    "cardExpiryYear": "22"
}

Promise#

Alternatively, this value can be set to a Javascript function. This function accepts a single parameter, a JSON object containing a valid API request, and should return a promise containing a JSON object of the Merchant Warrior server response.
Modified at 2026-07-31 08:08:13
Previous
wooCommerce PayID
Next
Hostaway
Built with