MOR API card payment add

From Kolmisoft Wiki
Revision as of 08:39, 20 August 2013 by Tester2 (talk | contribs)
Jump to navigationJump to search

Description

MOR API adds payment to the Calling Card.

Usage

  • From MOR X4 call: /api/card_payment_add.
  • Methods: POST, GET (if allowed, not recomended).



Parameters

  • number - Calling Card number. Required.
  • amount - default 0.
  • currency - if not specified - system's default.
  • description - description of the payment that is visible in Payments list.
  • u - username for authentication. Required.
  • hash - SHA1 hash constructed using number, amount, currency, description and API_Secret_Key ( More described in Constructing hash). Required.



Request

We have card number 1111111001, API Secret Key = 456789 and want to add 5 EUR to the card.

We send:

HTML POST: http://<SERVER_IP>/billing/api/card_payment_add?u=username&number=1111111001&amount=5&currency=EUR&description=text&hash=d6ce58f8a1ea56ff075c16c45b3e1714298a14d7

NOTE that username is not included in hash

Returns

Success

<?xml version="1.0" encoding="UTF-8"?>
<page>
  <status>
    <success>Calling Card balance successfully updated</success>
  </status>
  <calling_card_group>
    <name>Test_cardgroup</name>
  </calling_card_group>
  <calling_card>
    <number>1111111001</number>
  </calling_card>
  <add_payment>
    <currency>EUR</currency>
    <amount_with_tax>5</amount_with_tax>
    <details>
      <current_balance>30.3946220484454</current_balance>
      <converted_to>USD</converted_to>
      <exchange_rate>0.73853104</exchange_rate>
      <amount_with_tax>6.770196145</amount_with_tax>
      <amount_without_tax>6.770196145</amount_without_tax>
      <new_balance>37.1648181934454</new_balance>
      <description>text</description>
    </details>
  </add_payment>
</page>




Errors

  • <error>Access Denied</error> - such user was not found.
  • <error>Incorrect hash</error> - hash is incorrect.
  • <error>Calling Card was not found</error> - such Calling Card does not exist or user is not authorised to use this API or specific card belongs to another user.
  • <error>Currency disabled</error> - you can not use disabled/not enabled currencies.
  • <error>Feature Disabled</error> - you need to enable API payments in API settings.



See also