Integration

Four operations

A payment integration is smaller than it looks. These four cover it; everything else is the detail of one of them.

Operations

POST /paymentsCreate a payment and get the link to the payment page
GET /payments/{id}Read the payment: status, amount, method, timestamps
POST /payments/{id}/refundRefund, in full or in part
POST your callbackUrlWe notify you of a status change, signed

The base address of the sandbox and of the live gateway is issued together with your keys. The examples below use $MP_API_BASE for it.

Creating a payment

amountString, two decimals. The customer is charged exactly this.
currencyGEL, USD or EUR, by agreement
orderIdYour order number. Unique on your side, we return it in every answer.
descriptionWhat the customer sees on the page
callbackUrlWhere we send the status. HTTPS, reachable from the internet.
returnUrlWhere the customer goes after the page

Statuses

createdThe page exists, nobody has paid yet
pendingThe payment is with the bank, the answer has not arrived
paidMoney captured. Only now release the goods.
failedRefused. The reason comes with it.
expiredThe page ran out of time, nothing was charged
refundedReturned, fully or partly

Two rules that save the most time

  • The customer coming back to your returnUrl is not proof of payment. It only means the browser came back. Proof is the status you read from us.
  • Never trust an amount that came from the browser. Create the payment on your server, from your own order.

The full specification

Exact field names, every error code, the callback signature scheme and the test cards come with sandbox access, so that what you read always matches what the gateway actually answers.