validatePayment()

PaymentDetailsValidationResponse validatePayment(
 PaymentDetailsValidationRequest paymentDetailsValidationRequest)

This method passes credit card details to an upstream payment gateway for validation. Before you use this method, contact Inomial and your upstream provider to help you configure your payment system.

Parameters

paymentDetailsValidationRequest
Format: PaymentDetailsValidationRequest XML
Purpose: Defines a PaymentDetailsValidationRequest XML document that specifies the payment details to validate. These details may vary between providers.

Example: Validate a payment

This example requests validation for a Mastercard. The fields in this document vary depending on your Smile configuration and upstream provider. The <Object> elements are configurable and let you provide any required data to your provider.

<PaymentDetailsValidationRequest xmlns="http://xml.inomial.com/smile/2.xsd">
  <PaymentDetails>  
    <PaymentType>Mastercard</PaymentType>
    <AccountName>John Citizen</AccountName>
    <AccountNumber>4111 1111 1111 1111</AccountNumber>
    <ExpiryDate>2001-10</ExpiryDate>
    <CVV>813</CVV>
    <PaymentAmount>17.23</PaymentAmount>
    <Properties>
      <Object/>
    </Properties>
  </PaymentDetails>
  <Properties>
    <Object/>    
  </Properties>
</PaymentDetailsValidationRequest>   

Results

This method returns the verification result and may return a validation message with additional details. The method response varies between providers.

There are no messages defined by this method.

Example: A returned PaymentDetailsValidationResponse document

This example shows a failed payment validation. The validation message varies between providers; we recommend that your code parse only the validation result.

<PaymentDetailsValidationResponse xmlns="http://xml.inomial.com/smile/2.xsd">
  <Valid>false</Valid>
  <ValidationMessage>The credit card has expired</ValidationMessage>
</PaymentDetailsValidationResponse>   

Faults

PaymentDetailsValidationException

This fault is returned when the payment details could not be validated.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.ValidatePaymentDetails filename
filename
Purpose: Defines the filename of the PaymentDetailsValidationRequest XML document.
Note: For more information about the Java client and the options it accepts, see Java client syntax.