Pay By Credit Card

Please enter your required invoice details:

[insert_php]
#******************************************************************************
#* Name : PxPay_Sample_Curl.php
#* Description : Direct Payment Solutions Payment Express PxPay PHP cURL Sample
#* Copyright : Direct Payment Solutions 2009(c)
#* Date : 2009-10-21
#* References : http://www.paymentexpress.com/technical_resources/ecommerce_hosted/pxpay.html
#*@version : 1.0
#* Author : Thomas Treadwell
#******************************************************************************

# This file is a sample demonstrating integration with the PxPay interface using PHP with the cURL extension installed.
#Inlcude PxPay objects
include (“/home/ccnzsite/public_html/PxPay.php”);

$PxPay_Url = “https://sec.windcave.com/pxaccess/pxpay.aspx”;
$PxPay_Userid = “ChorusCallNZ2”; #Important! Update with your UserId
$PxPay_Key = “0eb7751ca9fc0485edcb37132e1f49ab4b75ca7ae3b80e73a04b2922c2a31e4b”; #Important! Update with your Key

#
# MAIN
#

$pxpay = new PxPay_Curl( $PxPay_Url, $PxPay_Userid, $PxPay_Key );

if (isset($_REQUEST[“result”]))
{
# this is a redirection from the payments page.
print_result($pxpay);
}
elseif (isset($_POST[“submit”])) #isset($_REQUEST[“Submit”])
{
# this is a post back — redirect to payments page.
redirect_form($pxpay);
}
else
{
# this is a fresh request — display the purchase form.
print_form();
}

#******************************************************************************
# This function receives information back from the payments page,
# and displays it to the user.
#******************************************************************************
function print_result($pxpay)
{
$enc_hex = $_REQUEST[“result”];
#getResponse method in PxPay object returns PxPayResponse object
#which encapsulates all the response data
$rsp = $pxpay->getResponse($enc_hex);

# the following are the fields available in the PxPayResponse object
$Success = $rsp->getSuccess(); # =1 when request succeeds
$AmountSettlement = $rsp->getAmountSettlement();
$AuthCode = $rsp->getAuthCode(); # from bank
$CardName = $rsp->getCardName(); # e.g. “Visa”
$CardNumber = $rsp->getCardNumber(); # Truncated card number
$DateExpiry = $rsp->getDateExpiry(); # in mmyy format
$DpsBillingId = $rsp->getDpsBillingId();
$BillingId = $rsp->getBillingId();
$CardHolderName = $rsp->getCardHolderName();
$DpsTxnRef = $rsp->getDpsTxnRef();
$TxnType = $rsp->getTxnType();
$TxnData1 = $rsp->getTxnData1();
$TxnData2 = $rsp->getTxnData2();
$TxnData3 = $rsp->getTxnData3();
$SurchargeOrg = $rsp->getTxnData2()*0.03;
$SurchargeRounded = number_format((float)$SurchargeOrg, 2, ‘.’, ”);
$CurrencySettlement= $rsp->getCurrencySettlement();
$ClientInfo = $rsp->getClientInfo(); # The IP address of the user who submitted the transaction
$TxnId = $rsp->getTxnId();
$CurrencyInput = $rsp->getCurrencyInput();
$EmailAddress = $rsp->getEmailAddress();
$MerchantReference = $rsp->getMerchantReference();
$ResponseText = $rsp->getResponseText();
$TxnMac = $rsp->getTxnMac(); # An indication as to the uniqueness of a card used in relation to others

if ($rsp->getSuccess() == “1”)
{
$result = “The transaction was successful.”;

# Sending invoices/updating order status within database etc.

if (!isProcessed($TxnId))
{
# Send emails, generate invoices, update order status etc.
}

}
else
{
$result = “The transaction was declined.”;
}

print <<

Chorus Call New Zealand Payment Result


Chorus Call New Zealand
Tax Invoice Receipt

NZBN: 94 290 411 323 19
Suite 8074, 17B Farnham Street
Parnell, Auckland 1052, New Zealand
Ph: 0800 453 630 Email: nzsupport@choruscall.com


Print The Receipt

$result
Company Name: $TxnData1
Accoutn Number: $TxnData3
Invoice Number(s): $MerchantReference
Total (Inc. GST): $TxnData2
Surcharge (3%): $SurchargeRounded
Total Charge: $AmountSettlement
Please call us if you need any assistance on 0800 453 630
or Email nzsupport@choruscall.com



HTMLEOF;
}

#******************************************************************************
# Database lookup to check the status of the order or shopping cart
#******************************************************************************

function isProcessed($TxnId)
{
# Check database if order relating to TxnId has alread been processed
return false;
}

#******************************************************************************
# This function prints a blank purchase form.
#******************************************************************************
function print_form()
{
print << function SurchargeCalculation() { var x = document.getElementById(“InvTotal”).value; x=x.replace(/\,/g,”); var num = parseFloat(x); if (num >= 0) { document.getElementById(“AmountInput”).value = (num *1.03).toFixed(2); document.getElementById(“Surcharge”).value = (num *0.03).toFixed(2); document.getElementById(“InvTotal”).value=num.toFixed(2); } else{ alert(‘Please enter the correct total amount on your invoice. eg. 1234.56’); document.getElementById(“InvTotal”).value = 0.00; document.getElementById(“AmountInput”).value = 0.00; document.getElementById(“Surcharge”).value = 0.00; } } function validate() { if(document.paymentForm.ComName.value==””) { alert( “Please provide your Company Name” ); document.paymentForm.ComName.focus(); return false; } if(document.paymentForm.InvNum.value==””) { alert( “Please provide your Invoice Number(s)” ); document.paymentForm.InvNum.focus(); return false; } if(document.paymentForm.AccNum.value==””) { alert(“Please provide your Account Number” ); document.paymentForm.AccNum.focus(); return false; } if(document.paymentForm.InvTotal.value ==””) { alert(“Please provide your Total on invoice(s)” ); document.paymentForm.InvTotal.focus(); return false; } return( true ); }

Company Name:

Invoice Number(s):[tippy img=”https://www.choruscall.co.nz/wp-content/uploads/2017/02/info.png”]Located upper Left on Invoice.
If paying multiple invoices, please separate each with a comma ( , ) Maximum of four (4) allowed.
[/tippy]

Account Number:[tippy img=”https://www.choruscall.co.nz/wp-content/uploads/2017/02/info.png”]Located upper Left on Invoice. Maximum of four (4) allowed.
[/tippy]

Total on Invoice(s) (Inc. GST):[tippy img=”https://www.choruscall.co.nz/wp-content/uploads/2017/02/info.png”]Total amount Inc. GST
[/tippy]
$  
Credit Card Surcharge*:
$  
Total Charge:
$  

Secure Payment via Commonwealth BankChorus Call New Zealand uses a secured payment gateway via Payment Express.


*Please Note: A 3% surcharge, Inc. GST, is applied to all Credit Card payments. Please use alternative payment methods to avoid this bank processing fee.

HTMLEOF;
}

#******************************************************************************
# This function formats data into a request and redirects to the
# Payments Page.
#******************************************************************************
function redirect_form($pxpay)
{

$request = new PxPayRequest();

$http_host = getenv(“HTTP_HOST”);
$request_uri = getenv(“SCRIPT_NAME”);
$server_url = “https://$http_host”;
#$script_url = “$server_url/$request_uri”; //using this code before PHP version 4.3.4
#$script_url = “$server_url$request_uri”; //Using this code after PHP version 4.3.4
$script_url = (version_compare(PHP_VERSION, “4.3.4”, “>=”)) ?”$server_url$request_uri” : “$server_url/$request_uri”;
$script_url = $script_url . “/payment/receipt”;

# the following variables are read from the form

$ComName = $_REQUEST[“ComName”];
$MerchantReference = $_REQUEST[“InvNum”];
$AccNum = $_REQUEST[“AccNum”];
$InvTotal = $_REQUEST[“InvTotal”];
$Surcharge = $_REQUEST[“Surcharge”];
$AmountInput = $_REQUEST[“AmountInput”];

#Generate a unique identifier for the transaction
$TxnId = uniqid(“ID”);

#Set PxPay properties

$request->setMerchantReference($MerchantReference);
$request->setAmountInput($AmountInput);
$request->setTxnData1($ComName);
$request->setTxnData2($InvTotal);
$request->setTxnData3($AccNum);
$request->setTxnType(“Purchase”);
$request->setCurrencyInput(“NZD”);
$request->setUrlFail($script_url); # can be a dedicated failure page
$request->setUrlSuccess($script_url); # can be a dedicated success page
$request->setTxnId($TxnId);

#The following properties are not used in this case
# $request->setEnableAddBillCard($EnableAddBillCard);
# $request->setBillingId($BillingId);
# $request->setOpt($Opt);

#Call makeRequest function to obtain input XML
$request_string = $pxpay->makeRequest($request);

#Obtain output XML
$response = new MifMessage($request_string);

#Parse output XML
$url = $response->get_element_text(“URI”);
$valid = $response->get_attribute(“valid”);

#Redirect to payment page
header(“Location: “.$url);
}
[/insert_php]

Pay By Deposit

Bank:
ANZ Bank: Devonport Branch

Address:
6 Victoria Road
Devonport, Auckland

BSB Number:
01-0137

Account Number:
0093420-00

S.W.I.F.T. Code:
ANZBNZ22

Pay By Post

Post To:
Chorus Call New Zealand

Suite 8074
17B Farnham Street
Parnell
Auckland 1052
New Zealand

Invoice Questions?

Please Click below to Live Chat with us, email: nzsupport@choruscall.com

Or call us on 0800 453 630.

All accounts are subject to our Terms and Conditions

Thank you for choosing Chorus Call as your complete conferencing service provider.