API payment processing / DONE

Accept payments through your exchanger for other sites. Act as a payment processor

Create a request

Use the public/exchanger/order/create method

Name
Description
Type

routeId

destination id

ObjectID

partner

partner code

STRING

amount

sum

FLOAT

fromValues[0][key]

field key

ObjectID

fromValues[0][value]

field value

STRING

toValues[0][key]

field key

STRING

toValues[0][value]

field value

STRING

routeValues[0][key]

field key

ObjectID

routeValues[0][value]

field value

STRING

lang

language (eng, rus)

STRING

agreement

agreement

BOOLEAN

hideOutData

hide details

BOOLEAN

clientCallbackUrl

callback, when the application is completed, the client will see a button to return to the site, and the client will be redirected to this url ?status=success or to ?status=error

STRING

ipnUrl

URL of instant payment notification (will be called when order status changes)

STRING

ipnSecret

string to create a secure hash in ipn url

STRING

Documentation for the authorisation system can be found in your personal cabinet. More information about working with methods and additional data can be found at

IPN (Payment Request Status Change Notification)

To receive notification of a status change when a request is created, you need to provide additional parameters:

  • clientCallbackUrl - Callback URL. When the request is completed, the client will see a button to return to the website, and the client will be redirected to this URL.

  • hideOutData - Hide recipient data.

  • ipnUrl - HTTP/HTTPS URL for notifying your server.

  • ipnSecret - Random string for creating the request signature (to maintain request integrity).

  1. The request will be sent via the POST method.

  2. IPN will be sent once.

  3. IPN delivery is not guaranteed (if the server does not respond to the request, it will not be resent).

Example IPN

  • POST

  • ['Content-Type'] = 'application/x-www-form-urlencoded'\

  • orderUID :Number() - request uid

  • orderId :String(ObjectId) -request id

  • newStatus :String() - current request status

  • inAmount :String(number) - order in sum

  • outAmount :String(number) - order out sum

  • xml_from :String() - order uid

  • xml_to :String() - order uid

  • timestamp :Number() - unix time and ipn notification

  • toValues :Array([{key,name,value}]) - request details

Status list

  • new - new request

  • waitPayment - waiting for user payment

  • errorPayment - user payment error (sender’s error)

  • inProgress - in process (awaiting admin processing or request payment)

  • inProgressPayout - queued for payout (payment successfully received) (if automatic payment is set in currency, it will be initiated)

  • errorPayout - payout error (error during payout)

  • hold - request frozen (application issues)

  • done - request successfully paid out

  • returned - request was paid, but not all exchange conditions and sender’s refund methods were met

  • deleted - request deleted (canceled)

Request Checksum Verification (IPN)

sha256(orderId:newStatus:inAmount:outAmount:xml_from:xml_to:timestamp:ipnSecret)

        
const stringForHash = orderId+":"+newStatus+":"+inAmount+":"+outAmount+":"+xml_from+":"+xml_to+":"+timestamp+":"+ipnSecret;
// example string for hash 5d8e6002b80b7b4cd75a6424:inProgress:2:317.42:ETH:WMZ:1571328406072:SECRET123

const hash = crypto.createHash('sha256').update(stringForHash).digest('hex')
// example hash af3acf947e6f0e0f2c267e300b8582e504dba12d1f2d058652b7414163c09f48
        
      

Payment Monitoring

  1. To monitor request status, log in, and all requests will be displayed in your dashboard;

  2. You can save the request UID and secret and manually go to the request by entering these details in the address bar.

Payment

  1. You can use /payment/ to display the payment page: // schema protocol://domain/user-lang/payment/order-uid/order-secret // example result https://www.domain.com/en/payment/1409/dGqwF2M2eBPaSN1G5ljMS1cb

  2. You can also display the link on the exchange as all clients see it, following the same schema as the first option, except replacing /payment/ with /order/.

  3. The method has parameters that allow displaying payment data or the payment form on your site, which you can use. IMPORTANT: if a prepayment method is used, you need to update the order status from waitPayment to inProgress after payment.

Last updated