LiqPay callback
const url = 'https://beta-api.plune.ai/v1/billing/webhooks/liqpay';const options = { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: new URLSearchParams({ data: 'eyJ2ZXJzaW9uIjo3LCJvcmRlcl9pZCI6IjAwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMCIsInN0YXR1cyI6InN1Y2Nlc3MifQ==', signature: 'Zm9yZ2VkLWV4YW1wbGUtc2lnbmF0dXJlLW5vdC12YWxpZA==' })};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://beta-api.plune.ai/v1/billing/webhooks/liqpay \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data data=eyJ2ZXJzaW9uIjo3LCJvcmRlcl9pZCI6IjAwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMCIsInN0YXR1cyI6InN1Y2Nlc3MifQ== \ --data signature=Zm9yZ2VkLWV4YW1wbGUtc2lnbmF0dXJlLW5vdC12YWxpZA==Called by LiqPay, not by a person or a CI (https://www.liqpay.ua/uk/doc/api/callback). No session and no token: the form’s signature is base64(sha3-256(private_key + data + private_key)) over its data (base64 of the JSON), checked before data is read; a sha1 signature of the same string passes too, as the docs’ code samples sign. A verified callback is stored once (its order, LiqPay’s payment, its status and time) and applied to the tier by the worker; a repeat delivery answers 200 and changes nothing. While LIQPAY_PUBLIC_KEY or LIQPAY_PRIVATE_KEY is unset on the server the route answers 503 provider_not_configured and stores nothing. The body is held to 512 KiB.
Request Body required
Section titled “Request Body required ”object
Example
data=eyJ2ZXJzaW9uIjo3LCJvcmRlcl9pZCI6IjAwMDAwMDAwLTAwMDAtNDAwMC04MDAwLTAwMDAwMDAwMDAwMCIsInN0YXR1cyI6InN1Y2Nlc3MifQ%3D%3D&signature=Zm9yZ2VkLWV4YW1wbGUtc2lnbmF0dXJlLW5vdC12YWxpZA%3D%3DResponses
Section titled “ Responses ”The event is stored (stored), or the same delivery was already (duplicate). Sent only after the write committed.
object
Example
{ "outcome": "stored"}The signature is right but data is not a payment of this shop
object
Example generated
{ "error": "example"}The signature is missing or does not match; the body is empty
The body is over 512 KiB
object
Example generated
{ "error": "example"}LIQPAY_PUBLIC_KEY or LIQPAY_PRIVATE_KEY is not set on this server (code: provider_not_configured)
object
Example generated
{ "error": "example"}