Calling our Web Service
 
You can try out our test Web Service. Use https://www.scnet.com.au/ipayby/ipaybyws
The SOAP envelope should be formatted like the following
 
 
The below example shows how a typical SOAP envelope should be formatted.
 

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://service.ipay.scnet/">
<env:Header/>
<env:Body>
<ns1:performTransaction>
<arg0>SCNet_Cert6</arg0>
<arg1>testSCNet</arg1>
<arg2>4444333322221111</arg2>
<arg3>1111</arg3>
<arg4>666</arg4>
<arg5>99.00</arg5>
<arg6>Mr. John Citizen</arg6>
<arg7>AUD</arg7>
<arg8>123</arg8>
</ns1:performTransaction>
</env:Body>
</env:Envelope>


PHP EXAMPLE
 
The below example shows a simple PHP call to the Web Service
 
<?php
//A Simple Helloworld Example to perform a
//PHP SOAP enabled call to the Payment Gateway

$params->arg0 = 'SCNet_Cert6'; //Merchant Id
$params->arg1 = 'testSCNet'; //password
$params->arg2 = '4444333322221111'; //Card Number
$params->arg3 = '1111'; //Expiry
$params->arg4 = '111'; //CVC
$params->arg5 = '12.00'; //Amount
$params->arg6 = 'Mr John Citizen'; //Cardholder optional
$params->arg7 = 'AUD'; //Currency
$params->arg8 = '100'; //InvoiceId optional

$client = new soapClient("https://www.scnet.com.au/ipayby/ipaybyws?WSDL",array('location' => 'https://www.scnet.com.au/ipayby/ipaybyws'));

$soap_response = $client->performTransaction($params);
print("\n<br><pre>");
print_r("The Transaction Summary is listed below....");
print("</pre><br>\n");

echo("\n<br><pre>");
echo("Order Number: " . $soap_response->return->orderNumber);
echo("<br>");
echo("Summary Response: " . $soap_response->return->summaryResponseCode);
echo("<br>");
echo("Response Code: " . $soap_response->return->responseCode);
echo("<br>");
echo("Response Text: " . $soap_response->return->responseText);
echo("<br>");
echo("Amount: " . $soap_response->return->amount);
echo("<br>");
echo("Auth ID: " . $soap_response->return->authId);
echo("<br>");
echo("RRN: " . $soap_response->return->RRN);
echo("<br>");
echo("Settlement Date: " . $soap_response->return->settlementDate);
echo("<br>");
echo("Transaction Type: " . $soap_response->return->transactionType);
echo("</pre><br>\n");
?>

 
.NET EXAMPLE
 
The below example shows a simple .NET call to the Web Service
 
protected void btnSubmit_Click(object sender, EventArgs e)
{
au.com.scnet.www.IpayByWS ipayByWS = new au.com.scnet.www.IpayByWS();
au.com.scnet.www.performTransaction performTransactionDetails = new au.com.scnet.www.performTransaction();
performTransactionDetails.arg0 = "SCNet_Cert6";
performTransactionDetails.arg1 = "testSCNet";
performTransactionDetails.arg2 = "4444333322221111";
performTransactionDetails.arg3 = "1111";
performTransactionDetails.arg4 = "666";
performTransactionDetails.arg5 = Convert.ToDecimal("12.00");
performTransactionDetails.arg5Specified = true;
performTransactionDetails.arg6 = "Mr John Citizen";
performTransactionDetails.arg7 = "AUD";
performTransactionDetails.arg8 = "1234567";
performTransactionDetails.arg9 = "Joe.Bloggs@company.com";
performTransactionDetails.arg10 = "John.Citizen@personalmail.com";
performTransactionDetails.arg11 = "Purchase of Sporting Equipment";
performTransactionDetails.arg12 = "2 x Golf Balls, 3 x tennis racquets”;
performTransactionDetails.arg13 = "John Citizen”;
performTransactionDetails.arg14 = "123 Smith St, Lygon";
performTransactionDetails.arg15 = "North Shore";
performTransactionDetails.arg17 = "234234234";
au.com.scnet.www.performTransactionResponse response = ipayByWS.performTransaction(performTransactionDetails);

if (response.@return.summaryResponseCode.Equals("Approved"))
{
_lblResult.Text = "Thank you. Your order has been submitted. You will receive a confirmation email shortly.";
}
else if (response.@return.summaryResponseCode.Equals("Declined"))
{
if(response.@return.responseCode.Equals("51"))
{
_lblResult.Text = "Unfortunately your order was not submitted due to insufficient funds.";
}
else if (response.@return.responseCode.Equals("33") || response.@return.responseCode.Equals("54"))
{
_lblResult.Text = "Unfortunately your order was not submitted due to an expired credit card.";
}
else
{
_lblResult.Text = "Unfortunately your order was not submitted due to an internal error. Please try again later.";
}
}
}

 
 
 
 

Calling the XML Background Servlet


To use the XML servlet you must set up an XML stream to the servlet. This option enables you to seamlessly call our payment engine without leaving your own secure site. You can also imbed AJAX calls with this option.
The Demo URL is:
https://www.scnet.com.au/ipayby/PaymentServletXML

The XML document should be formatted like the below example: Note that invoiceid and adminemail must be populated.

<?xml version="1.0"?>
<PAYMENTREQUESTS>
<REQUEST>
<TYPE>Capture</TYPE>
<GATE>SCNet_Cert6</GATE>
<CCNUMBER>4444333322221111</CCNUMBER>
<CCEXPIRY>1111</CCEXPIRY>
<CCCVC>666</CCCVC>
<INVOICEID>266</INVOICEID>
<CURRENCY>AUD</CURRENCY>
<AMOUNT>20.00</AMOUNT>
<ADMINEMAIL>you@company.com.au</ADMINEMAIL>
</REQUEST>
</PAYMENTREQUESTS>

Note: Several payments can be performed at once.

The XML response from the servlet will be as such:

<PAYMENTRESPONSES>
<PAYMENTRESPONSE>
<RECEIPTNO>266-630086388279572</RECEIPTNO>
<SUMMARYCODE>Approved</SUMMARYCODE>
<RESPONSECODE>00</RESPONSECODE>
<RESPONSETEXT>Approved</RESPONSETEXT>
<AMOUNT>100</AMOUNT>
<RRN>FVrvIouVf3</RRN>
<SETTLEMENT_DATE>Mon Jun 30 00:00:00 WST 2008</SETTLEMENT_DATE>
<AUTHID>RMd0</AUTHID>
<TYPE>1</TYPE>
<XID>5383640</XID>
</PAYMENTRESPONSE>
</PAYMENTRESPONSES>

 
 
 
 

Calling the AJAX XML Background Servlet

One of the biggest problems encounted when using AJAX (XMLDOM) is the cross site (domain) scripting problem - Firefox in particular will not allow it. This will always be a problem if you intend to never leave your site, but want to process the payment on our site. We have solved this problem for you by providing a unique solution involving a combination of XMLDOC and Javascript procesing on our server. The following example illustrates this.

We have a demonstration page here, which you can see the power of background AJAX processing.

You can also create your own page using this example for testing, or contact us for more example code.

-----------CUT HERE -----------------------------------------------------------------

<HTML><h1>Example SCNet Payment Servlet AJAX Call</h1>
<head>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<script src="https://www.scnet.com.au/ipayby/psjs.js"></script>
<script>
function returnXML(xmldoc) {
alert("ReceiptNo " + xmldoc.getElementsByTagName('RECEIPTNO')[0].firstChild.data + "\nResponseCode " + xmldoc.getElementsByTagName('RESPONSECODE')[0].firstChild.data + "\nResponseText " + xmldoc.getElementsByTagName('RESPONSETEXT')[0].firstChild.data + "\nAmount " + xmldoc.getElementsByTagName('AMOUNT')[0].firstChild.data + "\nRRN " + xmldoc.getElementsByTagName('RRN')[0].firstChild.data + "\nSettlement_date " + xmldoc.getElementsByTagName('SETTLEMENT_DATE')[0].firstChild.data + "\nAuthID " + xmldoc.getElementsByTagName('AUTHID')[0].firstChild.data + "\nType " + xmldoc.getElementsByTagName('TYPE')[0].firstChild.data + "\nXID " + xmldoc.getElementsByTagName('XID')[0].firstChild.data
);
}
</script>
</head>
<body>
<input type="button" value="Click" onClick="doPayment('amount=30.00&ccnumber=4444333322221111&ccexpiry=0807&cccvc=666&adminemail=you@some.com.au');">
</body>
</HTML>

-----------CUT HERE -----------------------------------------------------------------