Download the PHP package sol-parts/payum-novapay without Composer
On this page you can find all versions of the php package sol-parts/payum-novapay. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sol-parts/payum-novapay
More information about sol-parts/payum-novapay
Files in sol-parts/payum-novapay
Package payum-novapay
Short Description Payum gateway for NovaPay eCommerce acquiring: hosted checkout, hold payments and refunds
License MIT
Homepage https://sol.parts
Informations about the package payum-novapay
Payum NovaPay
Provides NovaPay eCommerce acquiring (the payment service of the Nova Poshta group) integration for Payum: hosted checkout with instant debit or two-stage hold payments, and refunds.
Supported operations:
Capture— create a payment session (/session+/payment) and redirect the customer to the NovaPay payment page (url).Authorize— same flow withuse_hold=true: the funds are locked on the customer's card and the store settles the payment later.DoCapture(the shared request fromsol-parts/payum-contracts, when installed) — settle a held payment via/complete-hold, full or partial amount.Cancel— reversal of a held payment via/void: the lock on the customer's funds is released. For a not-yet-paid session it is a no-op — the session simply expires on its own.Refund— refund of a paid session via/void, full session amount.Notify— the postback is treated as a sync trigger: the state is re-fetched from the NovaPay API (/get-status), so a forged callback can at most trigger an extra sync. The only exception is session expiry, see the caveats below.Sync— re-fetch the session state via/get-status.GetStatus— maps NovaPay session statuses to Payum ones (see the table below).
Payment flow
Authorize creates a hold payment: the money is locked instead of charged
until the store settles or releases it:
While a session is still payable (created / processing / failed) the capture flow
does not create a new one: the returning customer is redirected back to the
same NovaPay payment page (url) until the session is paid or expires.
Status mapping
| Session status | Payum status |
|---|---|
created, processing |
pending |
holded, hold_confirmed, processing_hold_completion |
authorized — the funds are locked, the store settles via DoCapture |
paid |
captured |
processing_void |
pending |
voided |
refunded — covers both a released hold and a refunded payment; the host application distinguishes them by the previous transaction state |
failed |
unknown — a failed attempt, not a failed session: the session stays payable, so the transaction state is left as is and a later paid of the same session still captures it |
expired |
expired |
Installation
Usage with PayumBuilder
Usage with Symfony PayumBundle
Register the gateway factory:
Configure a gateway:
Options
| Option | Required | Description |
|---|---|---|
merchant_id |
yes | Merchant identifier issued by NovaPay, sent both in the request body and as the merchant_id header. |
merchant_private_key |
yes | PEM-encoded RSA private key of the merchant. Every request body is signed with RSA-SHA256 and the base64 signature is sent as the x-sign header. |
sandbox |
no (default true) |
true targets the sandbox endpoint (api-qecom.novapay.ua), false — production (api-ecom.novapay.ua). |
Payment details
ConvertPaymentAction fills amount — in hryvnias (major units), as the
NovaPay API expects, converting from the minor-unit total of the payment —
and external_id with the payment number.
The only client field NovaPay requires is client_phone (E.164, +380…);
client_first_name, client_last_name, client_patronymic and
client_email are optional. The gateway passes them through from the payment
details supplied by the host application, best-effort: see the caveat about
rejected optional fields below.
The gateway attaches success_url / fail_url to the long-lived after-URL
token and callback_url to a notify token. NovaPay bakes these URLs into the
session permanently and reuses the session on payment retries, which is
exactly why the redirect target must survive repeated visits.
Caveats
amountis in major units (hryvnias with kopecks as the fraction), unlike most card gateways working in minor units. The partialamountofDoCaptureis in major units too./voidis a single endpoint for both reversal of a hold and refund of a paid session. The gateway always voids the full session amount; partial refunds viaoperations[]are not implemented.- NovaPay refunds a paid session only until 23:59 of the payment day. Later returns have to be settled outside the acquiring API.
- A failed payment attempt does not kill the session: it stays payable until it expires, and the capture flow redirects the returning customer back to the same payment page for another attempt.
- The postback signature is not verified: the state is re-fetched via
/get-statusunder the merchant credentials, and the notify URL itself carries an unguessable Payum token. - A session lives 30 days. Once it expires unpaid, NovaPay sends an
expiredpostback, but/get-statusno longer returns the session and answers with a "not found" error (NotFoundError/SessionNotFoundError). Only in this case the postback body is used: when it reportsexpiredfor the very session the API cannot find, and the last known status is stillcreated/processing/failed, the session is markedexpired. Any other "not found" — on a paid or held session, or without a matchingexpiredpostback — is raised as is, since an expired payment cannot be revived. - Successful
/voidand/complete-holdcalls may answer with an empty body or JSONnull— the gateway treats both as "accepted, no structured body". - Error responses are reported with the HTTP status code and a truncated body
snippet — balancer errors (429, 5xx) answer with HTML, not JSON. When the
body is a NovaPay error envelope (
{uuid, type, errors: [{message, code, path}]}for validation,{uuid, type, error, code}for processing) the error is raised asSolParts\PayumNovaPay\Exception\NovaPayApiException— aPayum\Core\Exception\LogicExceptionexposingtype,errorsanderrorCode— so a consumer can branch on the envelope without parsing the message. - Optional client attributes are best-effort. When
/sessionanswers with a validation error whoseerrors[].pathpoints only atclient_first_name,client_last_name,client_patronymicorclient_email, the session is created again without the rejected fields, repeating while the gateway keeps rejecting further optional fields (at most one pass per field): NovaPay validates them more strictly than a typical checkout form does (a mistyped email domain is enough), and an optional attribute must not cost the customer the payment. A failed/sessionleaves no session behind, so the retry duplicates nothing. The names of the dropped fields are recorded in the payment details asdropped_fields, so the merchant can tell why NovaPay has no email for that session. Validation errors touching anything else — and every non-validation error — are raised as is.
License
Released under the MIT License.
All versions of payum-novapay with dependencies
ext-json Version *
ext-mbstring Version *
ext-openssl Version *
payum/core Version ^1.7
php-http/discovery Version ^1.14
psr/http-factory Version ^1.0
psr/http-message Version ^1.1|^2.0