opscms-opay-plugin
v1.3.0
Published
Accept wallet and card payments through OPay Checkout for an OpsCMS platform.
Maintainers
Readme
opscms-opay-plugin
Accept payments through OPay. A payment plugin for the OpsCMS platform, built with opscms-sdk.
- A payment provider (
opay): starts a payment for an order, confirms it by asking OPay directly over its own API (the customer's return and OPay's notification only prompt that check), and marks the order paid or failed once. The platform's E-Commerce does the rest. - Its own settings table,
opay-settings, one row per site, for admins of the site only: its switch, test or live mode, the address in use, the currency, the platform owner's address override, the webhook address to give OPay, and the keys. Secrets are encrypted under the site's key and shown masked.
A site sets a merchant id, a public key and a secret key under Payments, OPay settings. OPay has a sandbox host and a live host; Test mode uses the sandbox. Confirm the country and host with OPay's sandbox before going live.
Install
From the admin: Plugins → Install from npm → opscms-opay-plugin. The platform creates the plugin's table (its one migration), lists the plugin with its
logo, and restarts to start it. Removing the plugin drops its table and the keys in it (a site's orders and payment ledger belong to the platform
and are never touched).
The platform currently carries this plugin in its own code under the same key; install the package only after that copy has been removed.
Needs
payload ^3 and opscms-sdk ^0.1.3 (the platform provides both), and the platform's E-Commerce plugin.
Develop
npm install
npm run typecheck && npm test && npm run build && npm pack --dry-runopscms-sdk is linked from a sibling checkout (file:../opscms-sdk) until it is published.
