Difference between revisions of "API/Services/CreatePayment"

From Emersion
Jump to: navigation, search
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
'''Purpose '''
 
'''Purpose '''
  
Take payment out of customer account on instant payment.
+
Take a payment for a customer using the preferred automated payment method set on the customer's account.  
  
 
'''Inputs'''
 
'''Inputs'''
<soapenv:Header/>
+
 
 +
  <soapenv:Header>
 
   <soapenv:Body>
 
   <soapenv:Body>
 
       <ser:PaymentRequest>
 
       <ser:PaymentRequest>
Line 10: Line 11:
 
             <!--Optional:-->
 
             <!--Optional:-->
 
             <ser:Invoices>
 
             <ser:Invoices>
            <!--1 or more repetitions:-->
+
            <!--1 or more repetitions:-->
            <ser:Invoice id="441449" amount_to_be_allocated="70"></ser:Invoice>
+
              <ser:Invoice id="441449" amount_to_be_allocated="70"></ser:Invoice>
    <ser:Invoice id="370659" amount_to_be_allocated="30"></ser:Invoice>
+
              <ser:Invoice id="370659" amount_to_be_allocated="30"></ser:Invoice>
 
             </ser:Invoices>
 
             </ser:Invoices>
 
         </ser:Payment>
 
         </ser:Payment>
 
       </ser:PaymentRequest>
 
       </ser:PaymentRequest>
 
   </soapenv:Body>
 
   </soapenv:Body>
 +
  </soapenv:Header>
  
  
Line 23: Line 25:
 
In Payment tag:
 
In Payment tag:
  
o Required attribute
+
Required attribute
  
account_id = Type positive integer
+
* account_id = Type positive integer
  
token = Type String
+
* token = Type String
  
amount = Type decimal and value must be greater than zero
+
* amount = Type decimal and value must be greater than zero
  
o Optional attribute
+
** Optional attribute
  
Payment_vanity_date format dd/mm/YYYY HH:II:SS
+
* 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.
 
Invoices tag is optional but if the Invoices tag exists there must be at least 1 invoice tag inside invoices tag.
<ser:Invoices>
+
<ser:Invoices>
 
     <!--1 or more repetitions:-->
 
     <!--1 or more repetitions:-->
 
     <ser:Invoice id="441449" amount_to_be_allocated="70"></ser:Invoice>
 
     <ser:Invoice id="441449" amount_to_be_allocated="70"></ser:Invoice>
 
     <ser:Invoice id="370659" amount_to_be_allocated="30"></ser:Invoice>
 
     <ser:Invoice id="370659" amount_to_be_allocated="30"></ser:Invoice>
</ser:Invoices>
+
</ser:Invoices>
  
 
Note: Total Payment amount must be the same as total overall Invoice amount_to_be_allocated.
 
Note: Total Payment amount must be the same as total overall Invoice amount_to_be_allocated.
Line 54: Line 56:
  
 
'''Description'''
 
'''Description'''
 +
 
Attribute
 
Attribute
 +
 
payment_id = Emersion Payment ID.
 
payment_id = Emersion Payment ID.
 +
 
result_code_id = Payment status :
 
result_code_id = Payment status :
10 Initial
+
* 10 Initial
30 Processing
+
* 30 Processing
40 Pending
+
* 40 Pending
60 Uncleared
+
* 60 Uncleared
70 Precompleted
+
* 70 Precompleted
80 Prefailed
+
* 80 Prefailed
100 Successful
+
* 100 Successful
110 Failed
+
* 110 Failed
120 Void
+
* 120 Void
 
response_message = String text description of the payment.
 
response_message = String text description of the payment.
 
receipt_number = payment receipt number.
 
receipt_number = payment receipt number.

Latest revision as of 14:14, 21 December 2016

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."]