Pockyt
Enable Pockyt as one of your payment service providers in OpenPay.
Enable credit card paymentsCopied!
To enable secure communication between OpenPay and your Pockyt account, make sure to configure your merchant number, store number, and API token in OpenPay.

-
From the navigation bar, go to Developers > Tokens
-
Copy down your Merchant Account number, Store Account number, and Pockyt Token (you will need to add these to OpenPay)

-
Head over to your payment processors page to add a new processor
-
Select Pockyt, and enter your Merchant number, Store number, and API Token
-
Specify your environment type

-
Toggle on credit card as a payment method

Enable PayPal*Copied!
The redirect mode for PayPal needs a few more changes to your code:
-
Please update you openpay.js to the latest version. This integration is available for
v0.2.8
and above. -
In your openpay.js instance, add
useRedirectFlow: true
to your submit paramsformInstance.generalSubmit('pockyt-paypal', { defaultFieldValues: {...}, useRedirectFlow: true, });
-
In your server, when creating the checkout session, set the success and return urls:
# ... other create_checkout_session params success_url='http://www.example.com/success', return_url='http://www.example.com/fail',
... other create_checkout_session params 'success_url': 'http://www.example.com/success', 'return_url': 'http://www.example.com/fail',
-
The customer will be redirected to
success_url
on payment success, and toreturn_url
on payment failure or cancellation, along with acatt
query parameter. For the aboveexample.com
case, the exact redirect URLs are as follows:-
Success:
http://www.example.com/success?catt=catt_<env>_<uuid>
-
Failure:
http://www.example.com/fail?catt=catt_<env>_<uuid>
-
Where
catt_<env>_<uuid>
is the checkout attempt ID.
-
-
For security reasons, you will need to validate this ID to get the results:
RESTGET /checkout/checkout_attempts/validate/catt_<env>_<uuid>
-
On success, this will return a checkout success response with this structure:
{ "invoice_urls": [ "https://invoice_url_1", "https://invoice_url_2" ], "subscription_ids": [ "subscription_dev_iBK8mTz3ybEpvBz5", "subscription_dev_3bkONFPlYtD9J4do" ], "customer_id": "cus_dev_Qn91vQt1OdnIeKim" }
-
On error, this will return an error with the following error messages:
-
Checkout attempt is not successful (...)
-
Checkout attempt not found
-
-
*Make sure you enable PayPal as a payment method in your Pockyt payment processor settings
