convertPaymentMethodToToken

Tokenize a customer payment method.

Syntax

(ueSecurityToken Token, string CustNum, string MethodID

Arguments

Type Name Description
ueSecurityToken Token Merchant security token: used to identify merchant and validate transaction.
string CustNum Customer Number (Read Only)
string Method ID ID of payment method. This property is ignored when adding a new payment method but required if updating an existing method. (Read Only)

Return Value

Name Description
CreditCardToken Returns object containing card token data (including card ref)

Examples

PHP

For directions on how to set up the WSDL link, create "$token" and "$client", go to PHP Soap How-to.

try {
// Set CustNum to the customer of payment method attached to the payment method
$CustNum="78129790";

// Set Method ID to the Reference Method ID
$MethodID="2399";

$Result = $client->convertPaymentMethodToToken($token,$CustNum,$MethodID);
}

catch(SoapFault $e) {

  echo "SoapFault: " .$e->getMessage(); print_r($e);
  echo "\n\nRequest: " . $tran->__getLastRequest();
  echo "\n\nResponse: " . $tran->__getLastResponse();
}

XML

Request:

<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:usaepay" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
         <ns1:convertPaymentMethodToToken>
            <Token xsi:type="ns1:ueSecurityToken">
               <ClientIP xsi:type="xsd:string">123.123.123.123</ClientIP>
               <PinHash xsi:type="ns1:ueHash">
                  <HashValue xsi:type="xsd:string">56c5a10ea6e3de7c39752aea69978d8f2aa558ddbc250d74e45ea5d3d18e6067</HashValue>
                  <Seed xsi:type="xsd:string">15390142301755682699sadfpouhasodf8uh</Seed>
                  <Type xsi:type="xsd:string">sha256</Type>
               </PinHash>
               <SourceKey xsi:type="xsd:string">chwl7EPgI56G8X76a0ME509Vc2z3BGge</SourceKey>
            </Token>
            <CustNum xsi:type="xsd:string">78129790</CustNum>
            <MethodID xsi:type="xsd:string">2399</MethodID>
         </ns1:convertPaymentMethodToToken>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

Response:

<?xml version="1.0" encoding="UTF-8"?>
   <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:usaepay" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <SOAP-ENV:Body>
         <ns1:convertPaymentMethodToTokenResponse>
            <convertPaymentMethodToTokenReturn xsi:type="ns1:CreditCardToken">
               <CardRef xsi:type="xsd:string">aqj5-lx82-hbsw-7kb6</CardRef>
               <CardExpiration xsi:type="xsd:string">2020-12</CardExpiration>
               <CardNumber xsi:type="xsd:string">XXXXXXXXXXXX7779</CardNumber>
               <CardType xsi:type="xsd:string">VI</CardType>
            </convertPaymentMethodToTokenReturn>
         </ns1:convertPaymentMethodToTokenResponse>
      </SOAP-ENV:Body>
   </SOAP-ENV:Envelope>

Change Log

Version Change
1.7 Added Method.