API Reference

Intro

The Hosted Payment Page (HPP) integration method provides web developers with a quick integration to the online Payment Gateway and full payment page functionality for processing online card payments.

How it Works

To process an online payment using the HPP, your website needs to send a simple 'Purchase Request' to our payment gateway to initiate the transaction, and Mint completes the rest of the process. The shopper will be returned to the merchant's website with the results of the online payment request. This service is hosted on the Mint’s Payment Servers, which are fully PCI DSS certified and secure, so the merchant is not required to have their own SSL certificate.



Integration with Merchant Website

Company Token

Company Token is a very important concept and must be provided while initiating the payment. This token uniquely identifies the merchant within the Mint’s payment system.

The Mechanics

Interacting with the HPP can be done in two ways:

  1. HTTP POST Request (preferred):

    • The input parameters (see table below) will be passed as hidden parameters of the HTTP request.
    • The URL of POST request will look like https://hpp-uatsb.mintpayments.net/<companyToken>
  2. HTTP GET Request:

    • In this case, the URL would need to contain all the necessary parameters in a form of https://hpp-uatsb.mintpayments.net/<CompanyToken>[email protected]&amount=10000&reference1=REF-1234&reference2=INV-1234&redirectUrlMerchant=https://integratedposdev.mintpayments.net/hpp/confirm/beginTransaction

There are also two ways of providing payment parameters for the payment transaction:

  • Passing payment parameters (internal reference, invoice number, amount, etc.) while making the call. In that case, the values will be auto-populated on the HPP on behalf of the user.
  • Simply call the HPP with no values. In that case, the user would need to enter the payment details directly into the HPP.

Input Parameters

All input parameters are strings.

Choosing how to pass parameters to the HPP fully depends on the level of integration that needs to be achieved. If your system generates the internal references and/or invoice numbers and you don't want the customer to be able to override them, then the values should be passed to the HPP.

Visual fields on HPPKey (in the HTTP request)NotesExample
Payment AmountamountAmount in cents. E.g. 10000 means $100.0010000
Email Receipt toemailEmail address to where a payment receipt will be sent. Mostly customer’s email address[email protected]
Customer Referencereference1Merchant internal customer referenceREF-1234
Invoice No.reference2Merchant internal invoice numberINV-1234
N/ArequestHashOptional for ensuring data integrity.2GajOzeYI3PVB4S84Ni4d+tYX4ya06dxYhsSdgyOvNA=
N/AredirectUrlMerchantThis value is not shown on the HPP. This URL will be redirected to upon completion of the payment. If left out, no redirection will happenhttps://customer.net/hpp/confirm/transaction
N/AredirectTargetControls the way the confirmation page will be displayed. Only relevant if ‘redirectUrlMerchant’ passed_blank, _self, _parent, _top, framename
N/AstoreCardPermissionIf true, the system will tokenize the card and return the token in the responsetrue/false
N/AvirtualTerminalModeFlag passed in with the request which will process the transaction as MOTO preventing improper handling of 3DStrue/false

Output Parameters

NameNotesExample
transactionStatusDescribes the outcome of the payment transactionapproved/failed/declined
receiptNumberTransaction’s reference number967017495762308097
totalTransactionAmountThe total amount of the transaction processed. This might include surcharges on top of the transaction amount if the merchant chooses to apply the surcharge101.1
errorMessageDetailed explanation of the root cause if the transaction didn’t succeed‘Your payment could not be completed at this time’, ‘The daily sales limit for this company has been reached’
responseHashOptional for ensuring data integrity.2GajOzeYI3PVB4S84Ni4d+tYX4ya06dxYhsSdgyOvNA=
cardCurrency3-letter code of the currency of the cardNZD, AUD
cardNumberObfuscated credit card number411111**1111
cardExpiryExpiry date of the card03/22
cardBrandThe flavor of the credit cardvisa/master/amex
reference1The same as the input parameter reference1
reference2The same as the input parameter reference2
cardTokenWill contain the token of the credit card used for the last payment transactionab123456-abc4-123a-ab12-a12bb34c5def

Credit Card Tokenization

The HPP allows tokenizing credit card details upon payment. If the input parameter ‘storeCardPermission’ is set to true, the system will return the card token. This might come in handy for customers who wish to use a hybrid solution of Mint’s HPP/API integration:

  • Use the HPP in a fully Mint-managed PCI compliant environment to do a one-off payment and create a card token. You can safely store the card’s token on your system without any PCI-related concerns.
  • Subsequent calls to Mint’s payment system can go via Mint’s mPay API using the previously tokenized card.

Verification Value for HPP

Request/Response verification is optional. If the merchant wishes to use it, Mint will share a secret key used to calculate the verification code.

Mint’s HPP mechanism allows the customer to verify that the payment response came from Mint’s system. Vice versa, Mint is able to verify the origin of the payment request really comes from the merchant.

The concept for verification is the same for request/response. The merchant (for request) or Mint (for response) will generate the code and the other party will calculate the code on the other end. Matching values of the code guarantee the request/response came from the trusted origin.

The verification code is simply a hash value out of the secret key and text:

  • secret key = gD5YvCaCF5ojCXaHI2hV2xFpZ
  • text = 12345678:1200
  • hash = Base64(hmacSHA256(secret key, text))
  • e.g., 2GajOzeYI3PVB4S84Ni4d+tYX4ya06dxYhsSdgyOvNA=

Java Snippet to Generate Hash Value

private String createHash(String hmacSecretKey, String data) throws InvalidKeyException, NoSuchAlgorithmException {
    javax.crypto.Mac macService = javax.crypto.Mac.getInstance("HmacSHA256");
    javax.crypto.spec.SecretKeySpec secretKeySpec = new javax.crypto.spec.SecretKeySpec(hmacSecretKey.getBytes(), "HmacSHA256");
    macService.init(secretKeySpec);
    return org.apache.commons.codec.binary.Base64.encodeBase64String(macService.doFinal(data.getBytes()));
}