Difference between revisions of "MOR API payment create"

From Kolmisoft Wiki
Jump to navigationJump to search
(Created page with ''This functionality is available from MOR 12'' MOR API Payment creation <br><br> ---- <br><br> * Call: /api/create_payment * Methods: POST, GET(if allowed, n…')
 
Line 13: Line 13:
* Methods: POST, GET(if allowed, not recomended)
* Methods: POST, GET(if allowed, not recomended)
* Params:
* Params:
** user_id - User ID in MOR database, whose financial statement we want to see. '''Required''.
** user_id - User ID in MOR database, whose financial statement we want to see. '''Required'''.
** p_currency - Currency code.'''Required''.
** p_currency - Currency code.'''Required'''.
** paymenttype - payment getaway name. '''Optional'''.
** paymenttype - payment getaway name. '''Optional'''.
** tax_in_amount - [0/1] default 0.  '''Optional'''.
** tax_in_amount - [0/1] default 0.  '''Optional'''.
** amount - amount. '''Required''.
** amount - amount. '''Required'''.
** transaction - transaction ID.  '''Optional'''.
** transaction - transaction ID.  '''Optional'''.
** payer_email - payer email.  '''Optional'''.
** payer_email - payer email.  '''Optional'''.

Revision as of 10:30, 25 January 2012

'This functionality is available from MOR 12


MOR API

Payment creation






  • Call: /api/create_payment
  • Methods: POST, GET(if allowed, not recomended)
  • Params:
    • user_id - User ID in MOR database, whose financial statement we want to see. Required.
    • p_currency - Currency code.Required.
    • paymenttype - payment getaway name. Optional.
    • tax_in_amount - [0/1] default 0. Optional.
    • amount - amount. Required.
    • transaction - transaction ID. Optional.
    • payer_email - payer email. Optional.
    • u - username to login. Required.
    • p - password to login. Required.
    • hash - SHA1 hash constructed using user_id and API_Secret_Key ( More described in Constructing hash). Required.
  • Returns:
    • Success
      • <response>
      • <status>ok</status>
      • <payment currency="...">
      • <payment_id>...</payment_id>
      • <tax>...</tax>
      • <amount>...</amount>
      • <gross>...</gross>
      • </payment>
      • </response>
    • Errors:
      • <error>Bad login</error> - User supplied bad login or password.
      • <error>Incorrect hash</error> - Hash was not correct. Check API_Secret_Key and order or params while concatenating hash_string.
      • <error>No currency</error> - Currency not found in system.
      • <error>Payment was not saved</error>
        • <message>Error message</message>




  • Example:
    • We have user_id = 123, API Secret Key = 456789
    • Hash string to be converted: "123456789"
    • We might send:
      • //api/create_payment?user_id=123&p_currency=EUR&paymenttype=Myname&tax_in_amount=1&amount=100&transaction=2S5sdf77&payer_email=bla&u=admin&p=admin&hash=351285420532f2162adacb536e5f63c6a3365612

* Note that username and password are not included in hash