Implement one-time payment flows on Stripe v2
You can configure and integrate a Payment Page 2.0 to support processing one-time payments for the following payment methods on the Stripe v2 payment gateway integration:
- Credit Card
- Credit Card Reference Transaction
You can also take advantage of the flow to create a payment method, process a one-time payment, and store the payment method for processing subsequent recurring payments. You need to pass in additional client parameters in the Z.render
function to support the use case of authorization amount processing or invoice processing.
Complete the following tasks to implement a Payment Page 2.0 to support one-time payment flows:
- Review prerequisites.
- 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 to your web page.
- Implement the callback response.
If you want to implement payment flows for processing local payments in INR in India, see Implement one-time payment flows for processing payments in India. The implementation is different from what is described in this article.
Step 1. Review prerequisites
- 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
Submit a request at Zuora Global Support to enable the feature.
- 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 the invoices are paid through the one-time payment.
Step 2. Set up a Payment Page 2.0
- To understand the implementation procedure of Payment Pages 2.0 in Zuora, review Payment Pages 2.0 implementation overview.
- Set up a Credit Card or Credit Card Reference Payment Page 2.0 for your needs:
- To set up a Credit Card Payment Page 2.0, follow 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.
- To set up a Credit Card Reference Payment Page 2.0, follow the instructions in Configure Credit Card Reference Payment Pages 2.0 for Stripe v2. 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":"test808145b3bf9d0145b3c6812b0008", "paymentGateway":"Stripe2", "authroizationAmount":"100", "currency":"USD", "accountId":"test808145b3bf9d0145b3c6812b0008" }
{ "uri":"https://sandbox.na.zuora.com/apps/PublicHostedPageLite.do", "method":"POST", "pageId":"test808145b3bf9d0145b3c6812b0008", "paymentGateway":"Stripe2", "accountId":"test808145b3bf9d0145b3c6812b0008" }
Step 4. Set up your client code
Follow the instructions in Integrate Payment Pages 2.0. When rendering the Payment Page form, specify the following additional parameters in the Z.render
function to support the use case of authorization amount processing or invoice processing.
Parameter | Applicable use case | Description |
---|---|---|
doPayment |
Both |
Required Type: boolean Default:
If it is To implement standalone one-time or recurring payment flows, |
storePaymentMethod |
Both |
Type: boolean Default:
|
field_accountId |
Both |
Required The payment method will be created for the specified account. For more information about this parameter, see Client parameters for Payment Pages 2.0. |
authorizationAmount |
Authorization amount processing |
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 |
Authorization amount processing |
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 | Invoice processing |
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:"false", field_accountId:"testc0f87596f2f301759c29443622fa", authorizationAmount:"99", field_currency:"USD" };
Here is an example for invoice processing.
var params = { doPayment:"true", storePaymentMethod:"true", field_accountId:"testc0f87596f2f301759c29443622fa", documents:"[{\"type\": \"invoice\", \"ref\": \"INV0000001\"}, {\"type\": \"invoice\", \"ref\": \"INV0000002\"}]" };
Step 5. Implement callback response
See Advanced Integration of Payment Pages 2.0 for more information.