addStoredPaymentDetails()

StoredPaymentDetails addStoredPaymentDetails(string usn, PaymentDetails paymentDetails)

This method adds the stored payment details provided to the given account and returns the stored version, including stored payment ID.

Note that only one set of stored payment details per account is currently supported. If stored details already exist you must either delete them before calling this method or update them by calling updateStoredPaymentDetails()

Parameters

usn
Format: string
Purpose: Specifies the USN of the account to add the payment details.
paymentDetails
Format: PaymentDetails XML
Purpose: Defines a PaymentDetails XML document that specifies the payment details to add.

Example: A PaymentDetails XML document

This example shows a PaymentDetails XML document to add a new Visa card to an account.

<PaymentDetails xmlns="http://xml.inomial.com/smile/2.xsd" xmlns="http://ws.inomial.com/smile.2">
  <PaymentType>visa</PaymentType>
  <AccountName>Test User</AccountName>
  <AccountNumber>4111111111111111</AccountNumber>
  <ExpiryDate>2020-12</ExpiryDate>
</PaymentDetails>

Example: A PaymentDetails XML document with a token

This example shows a PaymentDetails XML document to add a new Visa card to an account with a token.

<PaymentDetails xmlns="http://xml.inomial.com/smile/2.xsd"> 
  <PaymentType>visa</PaymentType>
  <AccountName>John Citizen</AccountName>
  <Token hint="4222 ... 22">166570E5-D68F-4EEE-AF0F-4EEEED5FF493</Token>
  <ExpiryDate>2020-12</ExpiryDate>
</PaymentDetails>

Results

This method returns a StoredPaymentDetails XML document containing the stored 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 stored payment details.

<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>
  <AccountNumber Disclosure="Hint">4111  11</AccountNumber>
  <ExpiryDate Disclosure="Full">12/2020</ExpiryDate>
  <PaymentType>
    <PaymentTypeCode>visa</PaymentTypeCode>
    <Name>Visa</Name>
    <Currency>AUD</Currency>
    <Surcharge/>
    <FieldLabels>
      <Name>Card holder</Name>
      <Number>Card number</Number>
      <ExpiryDate>Expiry</ExpiryDate>
    </FieldLabels>
  </PaymentType>
</StoredPaymentDetails>

Faults

NoSuchItemException

This fault is returned when the account does not exist.

InvalidRequestException

This fault is returned when payment details are invalid or missing.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.AddStoredPaymentDetailsList usn filename 
usn
Purpose: Specifies the USN of the account to add the payment details.
filename
Purpose: Defines the filename of the PaymentDetails XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.