API/Services/CreatePayment

From Emersion
Jump to: navigation, search

Purpose

Take a payment for a customer using the preferred automated payment method set on the customer's account.

Inputs

 <soapenv:Header>
  <soapenv:Body>
     <ser:PaymentRequest>
        <ser:Payment account_id="511596" token="305889725747721480112620601729009174294547589547C" payment_vanity_date="18/06/2014" amount="100">
           <ser:Invoices>
              <ser:Invoice id="441449" amount_to_be_allocated="70"></ser:Invoice>
              <ser:Invoice id="370659" amount_to_be_allocated="30"></ser:Invoice>
           </ser:Invoices>
        </ser:Payment>
     </ser:PaymentRequest>
  </soapenv:Body>
 </soapenv:Header>


Description

In Payment tag:

Required attribute

  • account_id = Type positive integer
  • token = Type String
  • amount = Type decimal and value must be greater than zero
    • Optional attribute
  • Payment_vanity_date format dd/mm/YYYY HH:II:SS

Invoices tag is optional but if the Invoices tag exists there must be at least 1 invoice tag inside invoices tag.

<ser:Invoices>
    <ser:Invoice id="441449" amount_to_be_allocated="70"></ser:Invoice>
    <ser:Invoice id="370659" amount_to_be_allocated="30"></ser:Invoice>
</ser:Invoices>

Note: Total Payment amount must be the same as total overall Invoice amount_to_be_allocated.


Output

 <SOAP-ENV:Body>
     <ns1:PaymentResponse>
     <ns1:Payment payment_id="457416" result_code_id="00" response_message="TRANSACTION APPROVED" receipt_number="1760554"/>
     </ns1:PaymentResponse>
  </SOAP-ENV:Body>


Description

Attribute

payment_id = Emersion Payment ID.

result_code_id = Payment status :

  • 10 Initial
  • 30 Processing
  • 40 Pending
  • 60 Uncleared
  • 70 Precompleted
  • 80 Prefailed
  • 100 Successful
  • 110 Failed
  • 120 Void

response_message = String text description of the payment. receipt_number = payment receipt number.


Error String

162. Required payment property

163. Payment amount must be greater that zero

164. Invalid payment date input

165. Invalid account ID ['.$payment->account_id.']

166. Required payment token

167. Invalid payment token

168. Required 'Invoice' element and property

169. Total payment amount and invoice amount does not match

170. Error occur while processing payment. Please try it again in a few minutes.

171. Invoice amount to be allocated must be greater that zero

172. Invalid Invoice ID [".$invoice->id."]