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.

link icon Sign in to Pockyt
  • 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)

  • 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:

  1. Please update you openpay.js to the latest version. This integration is available for v0.2.8 and above.

  2. In your openpay.js instance, add useRedirectFlow: true to your submit params

    formInstance.generalSubmit('pockyt-paypal', {
      defaultFieldValues: {...},
      useRedirectFlow: true,
    });
    

  3. 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',
  4. The customer will be redirected to success_url on payment success, and to return_url on payment failure or cancellation, along with a catt query parameter. For the above example.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.

  5. For security reasons, you will need to validate this ID to get the results:
    REST

    GET /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