Skip to main content

Test Payment Charge

POST /charges/test

Description

Test the application of a payment charge formula on a specified amount.

Parameters

None

Request Body

NameTypeDescription
amountnumberAmount to test the charge formula on (Required)
chargeFormulasarrayArray of charge formulas to test (Required)

Charge Formula

The chargeFormula is a string that represents the formula for calculating charges. It can include variables (A for amount, P for percentage), constants (C), operators (* for multiplication, + for addition, - for subtraction), comparators (< for less than, > for greater than), and delimiters (|).

Examples of possible charge formula terms:

  • 5C (constant 5)
  • 4P*A (4 percent of amount)
  • 5.6P*A (5.6 percent of amount)
  • 4P*10C (4 percent multiplied by constant 10)
  • 39C*A (39 times constant multiplied by amount)
  • 20C+A (20 times constant plus amount)
  • 39C-A (39 times constant minus amount)

Example

{
"amount": 100,
"chargeFormulas": [
"1.4P*A",
"5.6P*10C"
]
}

Response Code: 200 - OK

Description

Test payment charge successful.

Response Field

FieldTypeDescription
statusbooleanIndicates the overall success of the operation.
statusCodeintegerRepresents the specific status code for the response.
messagestringProvides additional information about the response.
dataobjectContains the main data payload of the response.
errorsarrayAn array containing error details if issues occurred.
- messagestringDescribes the error.
- descriptiveMessagestringProvides a more detailed and descriptive message about the error.

Example

xmlCopy code
<response>
<status>true</status>
<statusCode>0</statusCode>
<message>string</message>
<data></data>
<errors>
<error>
<message>string</message>
<descriptiveMessage>string</descriptiveMessage>
</error>
</errors>
</response>

Method: POST

>http://20.87.230.105/platform/wallets/charges/test

Headers

Content-TypeValue
apiKey{{apiKey}}

🔑 Authentication bearer

ParamvalueType
token{{accessCode}}string

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request POST \ 
--url /charges/test \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!