saveCards
Save a collection cards
Description
Tokenizes a collection of credit cards.
Syntax
CreditCardToken saveCards ( ueSecurityToken Token, CreditCardData CreditCards )
Arguments
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
CreditCardData | CreditCards | Array of credit card data objects. |
Return Value
Name | Description |
---|---|
CreditCardToken | Returns an array of card token objects |
Examples
PHP
For directions on how to set up the WSDL link, create "$token" and "$client", go to PHP Soap How-to.
<?php
try {
$Cards = array();
$Cards[] = array(
'CardNumber' => '4444555566667779',
'CardExpiration' => '1015',
);
$Cards[] = array(
'CardNumber' => '5555444433332226',
'CardExpiration' => '0216',
);
$tokens=$client->saveCards($token, $Cards);
}
catch (SoapFault $e) {
die("saveCards failed :" .$e->getMessage());
}
?>
XML
Request:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:newtek" 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:saveCards>
<Token xsi:type="ns1:ueSecurityToken">
<ClientIP xsi:type="xsd:string">192.168.0.1</ClientIP>
<PinHash xsi:type="ns1:ueHash">
<HashValue xsi:type="xsd:string">30253a800ca37f11c46df86be585b1d882887120</HashValue>
<Seed xsi:type="xsd:string">13656302101510261731</Seed>
<Type xsi:type="xsd:string">sha1</Type>
</PinHash>
<SourceKey xsi:type="xsd:string">_Ss7g8t6UW9b1Py6474F5Z1A8fmo22x2</SourceKey>
</Token>
<CreditCards SOAP-ENC:arrayType="ns1:CreditCardData[3]" xsi:type="ns1:CreditCardDataArray">
<item xsi:type="ns1:CreditCardData">
<AvsStreet xsi:type="xsd:string">298 State st</AvsStreet>
<AvsZip xsi:type="xsd:string">12210</AvsZip>
<CardExpiration xsi:type="xsd:string">0214</CardExpiration>
<CardNumber xsi:type="xsd:string">4444555566667779</CardNumber>
</item>
<item xsi:type="ns1:CreditCardData">
<AvsStreet xsi:type="xsd:string">298 State st</AvsStreet>
<AvsZip xsi:type="xsd:string">12210</AvsZip>
<CardExpiration xsi:type="xsd:string">0216</CardExpiration>
<CardNumber xsi:type="xsd:string">5555444433332226</CardNumber>
</item>
<item xsi:type="ns1:CreditCardData">
<AvsStreet xsi:type="xsd:string">298 State st</AvsStreet>
<AvsZip xsi:type="xsd:string">12210</AvsZip>
<CardExpiration xsi:type="xsd:string">1015</CardExpiration>
<CardNumber xsi:type="xsd:string">371122223332225</CardNumber>
</item>
</CreditCards>
</ns1:saveCards>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="urn:newtek"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:saveCardsResponse>
<saveCardsReturn SOAP-ENC:arrayType="ns1:CreditCardToken[3]" xsi:type="ns1:CreditCardTokenArray">
<item xsi:type="ns1:CreditCardToken">
<CardRef xsi:type="xsd:string">o58j-duhc-57nk-jlc3</CardRef>
<CardExpiration xsi:type="xsd:string">2014-02</CardExpiration>
<CardNumber xsi:type="xsd:string">XXXXXXXXXXXX7779</CardNumber>
<CardType xsi:type="xsd:string">Visa</CardType>
</item>
<item xsi:type="ns1:CreditCardToken">
<CardRef xsi:type="xsd:string">lu8p-ftcm-foxs-ehw7</CardRef>
<CardExpiration xsi:type="xsd:string">2016-02</CardExpiration>
<CardNumber xsi:type="xsd:string">XXXXXXXXXXXX2226</CardNumber>
<CardType xsi:type="xsd:string">Master</CardType>
</item>
<item xsi:type="ns1:CreditCardToken">
<CardRef xsi:type="xsd:string">29lz-vz21-fk5c-93t7</CardRef>
<CardExpiration xsi:type="xsd:string">2015-10</CardExpiration>
<CardNumber xsi:type="xsd:string">XXXXXXXXXXX2225</CardNumber>
<CardType xsi:type="xsd:string">AmEx</CardType>
</item>
</saveCardsReturn>
</ns1:saveCardsResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>