Create payment methods on Paystack
This payment gateway integration can be requested through the Specialized Payment Connections service at an additional cost.
To create Credit Card payment methods on Paystack, use the hosted payment page approach:
You can implement a hosted payment page through the Payment Pages 2.0 solution to support the following payment flows:
- Create and save a card payment method
- Process a one-time payment without saving the payment method
- Process the first payment and save the payment method for subsequent recurring payments
After the payment method is successfully created, the gateway returns two additional tokens that are also stored for the payment method in Zuora. These tokens will be used to process recurring transactions.
Zuora UI field | Paystack field |
---|---|
Token ID | Authorization Code |
Second Token ID | Email ID |
In the Electronic Payment Methods section of the customer account page, you can retrieve the Second Token ID.
Complete the following tasks to implement a Payment Page 2.0 to support one-time payment flows:
- Prepare for the integration.
- Set up a Payment Page 2.0.
- Request a signature for the Payment Page from Zuora.
- Set up your client code to integrate the Payment Page into your web page.
- Implement the callback response.
You can find detailed instructions in the following sections.
Step 1. Prepare for the integration
- Real-Time Reconciliation must be enabled. For information, see Real-Time Reconciliation on Paystack.
- In the integration, you can specify either the authorization amount or invoices when setting up your client code. To support these use cases, complete the following configuration:
- To support processing authorization amounts, the following features must be enabled:
- Validate Client-Side HPM Parameters
Follow the instructions in Validating client-side HPM parameters to enable it. - Either Credit Balance or Invoice Settlement
- Validate Client-Side HPM Parameters
- To support processing invoices, the following requirements must be met:
- Validating Client-Side HPM Parameters must be enabled.
- The invoices must be posted before they are paid through the one-time payment.
- To support processing authorization amounts, the following features must be enabled:
- To understand the implementation procedure of Payment Pages 2.0 in Zuora, review Payment Pages 2.0 implementation overview.
Step 2. Set up a Payment Page 2.0
- Set up a Payment Page 2.0 by following the instructions in Configure Credit Card Type Payment Pages 2.0. Make sure Enable 3D Secure 2.0 is selected in the Security Information section.
- Optionally, preview the Payment Page.
- Optionally, translate and localize the Payment Page.
- Optionally, update the CSS for the Payment Page.
Step 3. Request a signature for the hosted page from Zuora
Follow the instructions in Request a signature for the Payment Page from Zuora. Because the Client-side HPM Parameter Validation feature is enabled, Zuora will validate the additional fields in the request by comparing them with the values specified in the digital signature.
Here are two request examples for the Generate RSA signature REST API operation.
{ "uri":"https://sandbox.na.zuora.com/apps/PublicHostedPageLite.do", "method":"POST", "pageId":"test000045b3bf9d0145b3c6812b0000", "paymentGateway":"Paystack", "authorizationAmount":"100", "currency":"ZAR", "accountId":"test808145b3bf9d0145b3c6812b0000" }
{ "uri":"https://sandbox.na.zuora.com/apps/PublicHostedPageLite.do", "method":"POST", "pageId":"test000045b3bf9d0145b3c6812b0008", "paymentGateway":"Paystack", "accountId":"test808145b3bf9d0145b3c6812b0000" }
Step 4. Set up your client code
Follow the instructions in Integrate Payment Pages 2.0. When rendering the Payment Page, specify the following required parameters in the Z.render
or Z.renderWithErrorHandler
function. For other optional parameters, see Client Parameters for Payment Pages 2.0.
Parameter | Type | Description |
---|---|---|
doPayment |
boolean |
Default:
If it is To implement a one-time payment flow, |
storePaymentMethod |
boolean |
Default:
|
field_accountId |
string |
Zuora customer account ID. The payment method will be created for this specified account. Example: |
authorizationAmount |
number |
Required for authorization amount processing The amount of the one-time payment that will be sent to the gateway. For more information about this parameter, see Client parameters for Payment Pages 2.0. |
field_currency |
string |
Required for authorization amount processing The currency of the one-time payment amount. For more information about this parameter, see Client parameters for Payment Pages 2.0. |
documents | array |
Required for invoice processing An array of invoices to be paid in this transaction, containing the following fields:
|
Here is an example for authorization amount processing:
var params = { doPayment:"true", storePaymentMethod:"true", field_accountId:"testc0f87596f2f301759c29443622fa", authorizationAmount:"99", field_currency:"ZAR" };
Step 5. Implement callback response
For more information, see Advanced Integration of Payment Pages 2.0.