This method allows you to update an existing payment method for a customer.
Updates the existing payment method. PaymentMethod.MethodID is used to determine which payment method to update.
See also runCustomerTransaction, enableCustomer, disableCustomer, deleteCustomer, searchCustomerID, getCustomer, searchCustomers, getCustomerHistory, addCustomer, deleteCustomerPaymentMethod, updateCustomer, quickUpdateCustomer
integer updateCustomerPaymentMethod ( ueSecurityToken Token,PaymentMethod PaymentMethod, boolean Verify )
Type | Name | Description |
---|---|---|
ueSecurityToken | Token | Merchant security token: used to identify merchant and validate transaction. |
PaymentMethod | PaymentMethod | Includes method name, description, ID, and expiration date. |
boolean | Verify | If set to true, an AuthOnly verification of the credit card validity will be run. (See above.) |
boolean | Returns true if payment method is updated successfully. |
For directions on how to set up the WSDL link, create “$token” and “$client”, go to PHP Soap How-to.
<?php try { $PaymentMethod=array( 'MethodID' => '375', 'MethodName'=>'', 'CardNumber'=>'XXXXXXXXXXXX7779', 'CardExpiration'=>'2013-02', 'CardType'=>'', 'CardCode'=>'', 'AvsStreet'=>'', 'AvsZip'=>'', 'CardPresent'=>'', 'MagStripe'=>'', 'TermType'=>'', 'MagSupport'=>'', 'XID'=>'', 'CAVV'=>'', 'ECI'=>'', 'InternalCardAuth'=>'', 'Pares'=>'', 'SecondarySort'=>0, ); $Verify=false; $res=$client->updateCustomerPaymentMethod($token,$PaymentMethod,$Verify); $this->assertTrue($res>0, 'Positive PaymentMethodID'); print_r($res); } catch(SoapFault $e) { echo "\n\nResponse: " . $tran->__getLastResponse(); die("soap fault: " .$e->getMessage()); echo "SoapFault: " .$e->getMessage(); print_r($e); echo "\n\nRequest: " . $tran->__getLastRequest(); } ?>
Dim method As usaepay.PaymentMethod = New usaepay.PaymentMethod method.MethodID = "39" method.MethodName = "My different" method.CardExpiration = "1212" method.CardNumber = "4444555566667779" Dim verify As Boolean verify = True Dim response As Boolean response = client.updateCustomerPaymentMethod(token, method, verify) MessageBox.Show(String.Concat(response))
For directions on how to set up the WSDL link and create the “token” and “client” variables, go to the C Sharp .Net Soap How-to.
usaepay.PaymentMethod method = new usaepay.PaymentMethod(); method.MethodID = "19"; method.MethodName = "My different"; method.CardExpiration = "1212"; method.CardNumber = "4444555566667779"; Boolean verify = true; Boolean response; try { response = client.updateCustomerPaymentMethod(token, method, verify); MessageBox.Show(string.Concat(response)); } catch (Exception err) { MessageBox.Show(err.Message); }
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:updateCustomerPaymentMethod> <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">ad0d6fd9b98dae47ad7055cb913fba200ed483e1</HashValue> <Seed xsi:type="xsd:string">1160851186-test</Seed> <Type xsi:type="xsd:string">sha1</Type> </PinHash> <SourceKey xsi:type="xsd:string">_B4P7C4K2w2ZCQQQXRqrxDj6agrS2NIT</SourceKey> </Token> <PaymentMethod xsi:type="ns1:PaymentMethod"> <MethodID xsi:type="xsd:integer">292</MethodID> <MethodName xsi:type="xsd:string">Work visa</MethodName> <SecondarySort xsi:type="xsd:integer">0</SecondarySort> <AvsStreet xsi:type="xsd:string">2828 vida st</AvsStreet> <AvsZip xsi:type="xsd:string">94444</AvsZip> <CardExpiration xsi:type="xsd:string">2019-02</CardExpiration> <CardNumber xsi:type="xsd:string">4000100711112227</CardNumber> </PaymentMethod> <Verify xsi:type="xsd:boolean">false</Verify> </ns1:updateCustomerPaymentMethod> </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:updateCustomerPaymentMethodResponse> <updateCustomerPaymentMethodReturn xsi:type="xsd:boolean">true</updateCustomerPaymentMethodReturn> </ns1:updateCustomerPaymentMethodResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
Version | Change |
---|---|
1.2 | Method added. |