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. 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)
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)
{{platform.PaymentReason}} string Ignored if provided in "Create AuthKey" request
CardDetails
{{platform.Reference}}1 string Ignored if provided in "Create AuthKey" request
{{platform.Reference}}2 string Ignored if provided in "Create AuthKey" request
{{platform.Reference}}3 string Ignored if provided in "Create AuthKey" request
EmailAddress string Ignored if provided in "Create AuthKey" request.
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.

{{platform.InternalNote}} string Reference that is for internal use only. Ignored if provided in "Create AuthKey" request
StoreCard boolean Flag to indicate whether the cardholder agrees to save their card details. This flag allows merchant to create a {{platform.TokenLower}} from the card details used to process the transaction.
FraudScreeningDeviceFingerprint string Machine fingerprint for fraud screening.

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 ({{platform.BaseUrl}}/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 {{platform.BaseUrl}}/txns/processiframetxn/{authKey} HTTP/1.1
Authorization: {{platform.Base64Authorisation}}
Content-Type: application/json; charset=utf-8
Host: {{domain}}
Content-Length: 292
Expect: 100-continue
Connection: Keep-Alive

{
  "TxnReq" : {
    "Amount" : "101.00",
    "AmountOriginal" : "100.00",
    "AmountSurcharge" : "1.00",
    "Currency" : "AUD",
    "{{platform.InternalNote}}" : "test merchant reference",
    "{{platform.Reference}}1" : "Transaction {{platform.Reference}} 1",
    "{{platform.Reference}}2" : "Transaction {{platform.Reference}} 2",
    "{{platform.Reference}}3" : "Transaction {{platform.Reference}} 3",
    "{{platform.PaymentReason}}" : "00Example00",
    "StoreCard" : false,
    "EmailAddress" : "user@test.com",
    "CardDetails" : {
        "CardHolderName" : "John Smith"
    },
    "FraudScreeningDeviceFingerprint" : "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
  }
}
include ("./API/{{platform.NAMESPACE}}.php");

{{platform.NAMESPACE}}\URLDirectory::setBaseURL("reserved","{{platform.BaseUrl}}");

$credentials = new {{platform.NAMESPACE}}\Credentials("APIUserName", "Passw0rd", "{{platform.Example_Membership_Id}}", {{platform.NAMESPACE}}\Mode::Live);

$cardDetails = new {{platform.NAMESPACE}}\AuthKeyCardDetails();
$cardDetails->setCardHolderName("John Smith");
$cardDetails->setExpiryDateMonth("07");
$cardDetails->setExpiryDateYear("20");

$txnWithAuth = new {{platform.NAMESPACE}}\TransactionWithAuthKey();
$txnWithAuth->setAmount("101.00");
$txnWithAuth->setAmountOriginal("100.00");
$txnWithAuth->setAmountSurcharge("1.00");
$txnWithAuth->setCardDetails($cardDetails);
$txnWithAuth->setCurrency("AUD");
$txnWithAuth->set{{platform.Reference}}1("Transaction {{platform.Reference}} 1");
$txnWithAuth->set{{platform.Reference}}2("Transaction {{platform.Reference}} 2");
$txnWithAuth->set{{platform.Reference}}3("Transaction {{platform.Reference}} 3");
$txnWithAuth->setEmailAddress("user@test.com");
$txnWithAuth->setStoreCard(false);
$txnWithAuth->set{{platform.PaymentReason}}("00Example00");
$txnWithAuth->set{{platform.InternalNote}}("test merchant reference");
$txnWithAuth->setFraudScreeningDeviceFingerprint("0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=");

$processIframeTxn = new {{platform.NAMESPACE}}\ProcessIframeTxn("df998fea-f309-4e6e-9629-7149799dc028");
$processIframeTxn->setCredentials($credentials);
$processIframeTxn->setProcessTransactionWithAuthKey($txnWithAuth);

$response = $processIframeTxn->submit();
from {{platform.NAMESPACE}}.Requests import Credentials, TransactionWithAuthKeyRequest,\
ProcessIframeTxnRequest

from {{platform.NAMESPACE}}.Utils import AuthKeyCardDetails

credentials = Credentials("APIUserName", "Passw0rd", "{{platform.Example_Membership_Id}}")

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.{{platform.ReferenceLower}}1 = "Transaction {{platform.Reference}} 1"
txn_with_auth.{{platform.ReferenceLower}}2 = "Transaction {{platform.Reference}} 2"
txn_with_auth.{{platform.ReferenceLower}}3 = "Transaction {{platform.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.{{platform.Internal_Note}} = "test merchant reference"
txn_with_auth.{{platform.Payment_ReasonLower}} = "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 = "{{platform.BaseUrl}}"
request.process_transaction_with_auth_key_request = txn_with_auth

response = request.submit()
require_relative "API/{{platform.NAMESPACE}}"

cred = {{platform.NAMESPACE}}::Credentials.new("APIUserName", "Passw0rd", "{{platform.Example_Membership_Id}}")

card_details = {{platform.NAMESPACE}}::AuthKeyCardDetails.new()
card_details.card_holder_name = "a name"
card_details.expiry_date_month = "07"
card_details.expiry_date_year = "20"

txn_with_auth = {{platform.NAMESPACE}}::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.{{platform.Internal_Note}} = "test merchant reference"
txn_with_auth.{{platform.Payment_ReasonLower}} = "00Example00"
txn_with_auth.store_card = false
txn_with_auth.fraud_screening_device_fingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="

req = {{platform.NAMESPACE}}::ProcessIframeTxnRequest.new("df998fea-f309-4e6e-9629-7149799dc028")
req.base_url = "{{platform.BaseUrl}}"
req.credentials = cred
req.proess_transaction_with_auth_key_request = txn_with_auth

response = req.submit()
import com.{{platform.NAMESPACE}}.api.*;

Credentials credentials = new Credentials("APIUserName", "Passw0rd", "{{platform.Example_Membership_Id}}");
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.set{{platform.Reference}}1("Transaction {{platform.Reference}} 1");
txnWithAuth.set{{platform.Reference}}2("Transaction {{platform.Reference}} 2");
txnWithAuth.set{{platform.Reference}}3("Transaction {{platform.Reference}} 3");
txnWithAuth.setCardDetails(cardDetails);
txnWithAuth.set{{platform.PaymentReason}}("00Example00");
txnWithAuth.set{{platform.InternalNote}}("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("{{platform.BaseUrl}}");
req.setProcessTxnWithAuthKeyReq(processTxnAuthReq);

ProcessTxnWithAuthKeyResp resp;
resp = s.submit(req);
use {{platform.NAMESPACE}}::API;
use Data::Inspect qw(p);

${{platform.NAMESPACE}}::Sender::base_url = "{{platform.BaseUrl}}";

my $cred = {{platform.NAMESPACE}}::Credentials->new(
    username => 'APIUserName', 
    password => 'Passw0rd', 
    {{platform.Membership_Id}} => "{{platform.Example_Membership_Id}}"
);

my $authCardDetails = {{platform.NAMESPACE}}::AuthKeyCardDetails->new(
    card_holder_name => "A name",
    expiry_date_month => "07",
    expiry_date_year => "20"
);

my $authkeytxnreq = {{platform.NAMESPACE}}::TransactionRequestWithAuthKey->new(
    auth_card_details => $authCardDetails,
    amount => "101.00",
    amount_original => "100.00",
    amount_surcharge => "1.00",
    currency => "AUD",
    {{platform.ReferenceLower}}1 => "Transaction {{platform.Reference}} 1",
    {{platform.ReferenceLower}}2 => "Transaction {{platform.Reference}} 2",
    {{platform.ReferenceLower}}3 => "Transaction {{platform.Reference}} 3",
    {{platform.Internal_Note}} => "test merchant reference",
    {{platform.Payment_ReasonLower}} => "00Example00",
    store_card => 0,
    email_address => "user@test.com",
    fraud_screening_device_fignerprint => "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk="
);
 
my $processtTxnWithAuthReq = {{platform.NAMESPACE}}::ProcessTxnWithAuthKeyRequest->new(
    txn_request_with_auth_key => $authkeytxnreq
);

my $req = {{platform.NAMESPACE}}::ProcessIframeTxnRequest->new(
    credentials => $cred
    process_txn_with_auth_key_request => $processtTxnWithAuthReq,
    auth_key => "df998fea-f309-4e6e-9629-7149799dc028"
);

$result = $req->submit();
using {{platform.NAMESPACE}}.API.Client;
using API.Client.Common;
using API.Client.Common.Helpers;

var txnClient = ClientFactory.
GetClientInstance<TxnClient>(new JsonWebClientHelper(),
"{{platform.BaseUrl}}",
"APIUserName",
"{{platform.Example_Membership_Id}}",
"Passw0rd",
null);

var apiReq = new ProcessTxnWithAuthKeyReq
{
    TxnReq = new TxnRequestWithAuthKey
    {
        Amount = "101.00",
        AmountOriginal = "100.00",
        AmountSurcharge = "1.00",
        {{platform.PaymentReason}} = "00Example00",
        CardDetails = new CreditCardDetailsWith2PartExpiryDate
        {
            CardHolderName = "A name",
            ExpiryDateMonth = "07",
            ExpiryDateYear = "20"
        },
        {{platform.Reference}}1 = "Transaction {{platform.Reference}} 1",
        {{platform.Reference}}2 = "Transaction {{platform.Reference}} 2",
        {{platform.Reference}}3 = "Transaction {{platform.Reference}} 3",
        Currency = "AUD",
        EmailAddress = "user@test.com",
        FraudScreeningDeviceFingerprint = "0400l1oURA1kJHkN<1900 characters removed>+ZKFOkdULYCXsUu0Oxk=",
        {{platform.InternalNote}} = "test merchant reference",
        StoreCard = false
    }
};

var response = txnClient.ProcessIframeTxn("df998fea-f309-4e6e-9629-7149799dc028",apiReq);
var {{platform.NAMESPACE}} = require("./{{platform.NAMESPACE}}_API/index.js");
var api = new {{platform.NAMESPACE}}();

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",
    {{platform.InternalNote}} : "test merchant reference",
    {{platform.Reference}}1 : "Transaction {{platform.Reference}} 1",
    {{platform.Reference}}2 : "Transaction {{platform.Reference}} 2",
    {{platform.Reference}}3 : "Transaction {{platform.Reference}} 3",
    {{platform.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", 
    {{platform.MembershipId}} : "{{platform.Example_Membership_Id}}"
});

req.baseUrl("{{platform.BaseUrl}}");

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>{{platform.Reference}}1:</label>
    <input id="{{platform.Reference}}1" name="{{platform.Reference}}1" type="text"/>
</div>
<div>
    <label>{{platform.Reference}}2:</label>
    <input id="{{platform.Reference}}2" name="{{platform.Reference}}2" type="text"/>
</div>
<div>
    <label>{{platform.Reference}}3:</label>
    <input id="{{platform.Reference}}3" name="{{platform.Reference}}3" 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="{{platform.BaseUrl}}/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 = "{{platform.BaseUrl}}/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.{{platform.PaymentReason}} = "{{platform.PaymentReason}}"
    model.TxnReq.{{platform.InternalNote}} = "{{platform.InternalNote}}"
    model.TxnReq.{{platform.Reference}}1 = $("#{{platform.Reference}}1").val();
    model.TxnReq.{{platform.Reference}}2 = $("#{{platform.Reference}}2").val();
    model.TxnReq.{{platform.Reference}}3 = $("#{{platform.Reference}}3").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>