developer:soap:howto

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
developer:soap:howto [2008/08/14 10:44]
vladg updated wsdl link
developer:soap:howto [2009/07/27 10:33] (current)
tem
Line 1: Line 1:
-====== How To ======+====== How To Guides ​======
  
-This is a simple class example which shows how to set up the WSDL link and create "​$token"​ and "​$client"​. +The following guides give specific setup instuctions/​background information on using Soap with some of the more common programming languagesIf you are using a language not listed below, ​please ​feel free to contact us for assistance. The Soap interface can be used with any programming language that is able to communicate with an HTTPS connection.  
-For questions ​please ​email devsupport@usaepay.com + 
-<code php> +  * [[developer:​soap:​howto:​php|PHP 5 (Built-in SoapClient)]] 
-<?php  +  * [[developer:​soap:​howto:​pearsoap| PHP 5 (Pear Library)]] 
- class TokenClientExample {+  * [[developer:​soap:​howto:​vb|Visual Basic (.Net)]] 
 +  * [[developer:​soap:​howto:​csharp|C# ​ (.Net)]]
  
- public $client; // initialize client 
- public $token;// initialize token 
-  
- function setUp{ 
- $client=self::​getClient();​ //Using this class 
- $token=self::​getToken(); ​  //​Using this class 
- } 
-  
- static function getClient(){ 
- //for live server use '​www'​ for test server use '​sandbox'​ 
- $wsdl='​https://​www.usaepay.com/​soap/​gate/​131C979E/​usaepay.wsdl';​ 
-  
- return new SoapClient($wsdl,​array("​trace"​=>​1,"​exceptions"​=>​1));​ 
- //Must have Php5 compiled with --enable-soap 
- //​Otherwise use pear soap. For more info please visit: http://​pear.php.net/​package/​SOAP 
- } 
  
- static function getToken(){ 
- // Creating a ueSecurityToken 
-  
- $sourcekey = '​yQbOFkmykeygoeshere3Lc9PH1l14';//​Place your merchant console generated source key 
- $pin = '​1234';​ //Input the PIN set in the source editor for your source key 
-  
- // generate random seed value 
- $seed=mktime() . rand(); 
-  
- // make hash value using sha1 function 
- $clear= $sourcekey . $seed . $pin; 
- $hash=sha1($clear);​ 
-  
- // assembly ueSecurityToken as an array 
- // (php5 will correct the type for us) 
- $tok=array( 
- '​SourceKey'​=>​$sourcekey,​ 
- '​PinHash'​=>​array( 
- '​Type'​=>'​sha1',​ 
- '​Seed'​=>​$seed,​ 
- '​HashValue'​=>​$hash 
- ), 
- '​ClientIP'​=>'​192.168.0.1'​ 
- ); 
- return $tok; 
- } 
-} 
-?> 
-</​code>​ 
developer/soap/howto.txt · Last modified: 2009/07/27 10:33 by tem

Page Tools