Skip to content

Instantly share code, notes, and snippets.

@dancameron
Created October 25, 2012 04:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dancameron/3950466 to your computer and use it in GitHub Desktop.
Save dancameron/3950466 to your computer and use it in GitHub Desktop.
eWay Tokenized SOAP Client
$client = new SoapClient(
"https://www.eway.com.au/gateway/ManagedPaymentService/test/managedcreditcardpayment.asmx?WSDL",
array( 'soap_version' => SOAP_1_2, 'trace' => 1, 'exceptions' => 1 ) );
$header_data = new stdClass;
$header_data->eWAYCustomerID = '9876543211000';
$header_data->Username = 'test@eway.com.au';
$header_data->Password = 'test123';
$header = new SoapHeader( "https://www.eway.com.au/gateway/managedpayment", "eWAYHeader", $header_data, FALSE );
$client->__setSoapHeaders( $header );
try {
$result = $client->CreateCustomer($customerinfo);
var_dump($result);
die;
} catch ( SoapFault $fault ) {
echo $fault->faultstring;
echo "<br/>REQUEST:\n<textarea rows='10' cols='60'>" . $client->__getLastRequest() . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment