updateStoredPaymentDetails()
StoredPaymentDetails updateStoredPaymentDetails(string usn, string storedPaymentDetailsId, PaymentDetails paymentDetails)
This method updates the stored payment details on a given account and returns the updated payment details.
Parameters
- usn
- Format: string
- storedPaymentDetailsId
- Format: string
- paymentDetails
- Format: PaymentDetails XML
Example: A PaymentDetails XML document
This example shows a PaymentDetails XML document to change the payment method to a Mastercard.
<PaymentDetails xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
<PaymentType>mastercard</PaymentType>
<AccountName>Test User</AccountName>
<AccountNumber>5111222233334444</AccountNumber>
<ExpiryDate>2022-12</ExpiryDate>
</PaymentDetails>
Results
This method returns a StoredPaymentDetails XML document containing the updated payment details.
There are no messages defined by this method.
Example: A returned StoredPaymentDetails XML document
This example shows a StoredPaymentDetails XML document with the updated payment details. The Mastercard number is fully concealed.
<StoredPaymentDetails xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
<StoredPaymentDetailsId>d63d836e-55e2-4d0e-82b3-d148b368f712</StoredPaymentDetailsId>
<AccountName Disclosure="Full">Test User</AccountName>
<ExpiryDate Disclosure="Full">12/2022</ExpiryDate>
<PaymentType>
<PaymentTypeCode>mastercard</PaymentTypeCode>
<Name>Mastercard</Name>
<Currency>AUD</Currency>
<Surcharge/>
<FieldLabels>
<Name>Card holder</Name>
<Number>Card number</Number>
<ExpiryDate>Expiry</ExpiryDate>
</FieldLabels>
</PaymentType>
</StoredPaymentDetails>
Faults
NoSuchItemExceptionThis fault is returned when there is no account with the USN specified, or no payment details with the storedPaymentDetailsId exists.
InvalidRequestExceptionThis fault is returned when payment details are invalid or missing, or the USN and stored payment details ID do not correspond.
Java client syntax
java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.UpdateStoredPaymentDetailsList usn storedPaymentDetailsId filename
- usn
- Purpose: Specifies the USN of the account to update.
- storedPaymentDetailsId
- Purpose: Specifies the ID of the stored payment details to update.
- filename
- Purpose: Defines the filename of the PaymentDetails XML document.