developer:soap-1.4:objects:uesecuritytoken

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
developer:soap-1.4:objects:uesecuritytoken [2010/08/23 09:44]
irina
developer:soap-1.4:objects:uesecuritytoken [2013/05/28 16:26]
charlie [PHP 5]
Line 43: Line 43:
 <code php> <code php>
 <?php <?php
-class TokenClientExample { 
  
-    public $client; ​// initialize client +// Creating a ueSecurityToken
-    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)); +$sourcekey ​'​Your_source_key_here'​; //Input your merchant console generated source key 
-        ​//Must have Php5 compiled with --enable-soap +$pin = '​1234'; ​//Input the PIN set in the source editor for your source key
-        //​Otherwise use pear soap. For more info please visit: http://​pear.php.net/​package/​SOAP +
-    } +
- +
-    static function getToken(){ +
-        ​// Creating a ueSecurityToken+
         ​         ​
-        $sourcekey = '​yQbOFkmykeygoeshere3Lc9PH1l14';​  +// generate random seed value 
-//Input your merchant console generated source key +$seed=mktime() . rand();
-        $pin '​1234'​//Input the PIN set in the source editor for your source key+
         ​         ​
-        ​// generate random seed value +// make hash value using sha1 function 
-        $seed=mktime() . rand();+$clear= $sourcekey . $seed . $pin; 
 +$hash=sha1($clear);
         ​         ​
-        // make hash value using sha1 function +// assembly ueSecurityToken as an array 
-        $clear= $sourcekey . $seed . $pin; +// (php5 will correct the type for us) 
-        $hash=sha1($clear);​ +$token=array( 
-         + '​SourceKey'​=>​$sourcekey,​ 
-        ​// assembly ueSecurityToken as an array + '​PinHash'​=>​array( 
-        // (php5 will correct the type for us) +  '​Type'​=>'​sha1',​ 
-        $tok=array( +  '​Seed'​=>​$seed,​ 
-         ​'​SourceKey'​=>​$sourcekey,​ +  '​HashValue'​=>​$hash 
-         ​'​PinHash'​=>​array( + ), 
-            '​Type'​=>'​sha1',​ + '​ClientIP'​=>'​192.168.0.1'​ 
-            '​Seed'​=>​$seed,​ +);
-            '​HashValue'​=>​$hash +
-            ), +
-         ​'​ClientIP'​=>'​192.168.0.1'​ +
-        ); +
-        return $tok; +
-    } +
-}+
 ?> ?>
 </​code>​ </​code>​
Line 99: Line 76:
  
 // Creating a ueSecurityToken // Creating a ueSecurityToken
-$sourcekey = 'yQbOFkjD8wwlkZ3AhY248k3Lc9PH1l14';+$sourcekey = 'Your_source_key_here';
 $pin = '​1234';​ $pin = '​1234';​
  
Line 144: Line 121:
  
   ' The source key and pin are created by the merchant ​   ' The source key and pin are created by the merchant ​
-  sourcekey = "e42SYc86C4uvlvyP62ow54Kv93SZsJVm"+  sourcekey = "Your_source_key_here"
   pin = "​1234"​   pin = "​1234"​
  
Line 193: Line 170:
  
             // SourceKey and Pin (created in merchant console)             // SourceKey and Pin (created in merchant console)
-            token.SourceKey = "O79****************************c8"; ​+            token.SourceKey = "Your_source_key_here"; ​
                        
             string pin = "​1234";​             string pin = "​1234";​
Line 223: Line 200:
   pin = '​yourpin';​   pin = '​yourpin';​
   Token = structnew ();   Token = structnew ();
-  Token.SourceKey = 'yoursourcekey here';+  Token.SourceKey = 'Your_source_key_here';
   Token.PinHash = structnew();​   Token.PinHash = structnew();​
   Token.PinHash.Type = '​md5';​   Token.PinHash.Type = '​md5';​
developer/soap-1.4/objects/uesecuritytoken.txt · Last modified: 2013/05/28 16:26 by charlie

Page Tools