Skip to main content

Implement one-time payment flows on Fat Zebra

Zuora

Implement one-time payment flows on Fat Zebra

You can implement a hosted payment page through the Payment Pages 2.0 solution to support the following flows on Fat Zebra:

  • 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

When validating and creating the payment method, Zuora requests a token from the gateway using the card number. This token is saved in Zuora and will be used to process recurring payments.

Complete the following tasks to implement a Payment Page 2.0 to support the payment flows:

  1. Review prerequisites.
  2. Set up a Payment Page 2.0.
  3. Request a signature for the Payment Page from Zuora.
  4. Set up your client code to integrate the Payment Page to your web page.
  5. Implement the callback response.

Step 1. Review prerequisites

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:

Step 2. Set up a Payment Page 2.0

  1. To understand the implementation procedure of Payment Pages 2.0 in Zuora, review Payment Pages 2.0 implementation overview.
  2. 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.
  3. Optionally, preview the Payment Page.
  4. Optionally, translate and localize the Payment Page.
  5. 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":"Fat Zebra",
   "authroizationAmount":"100",
   "currency":"AUD",
   "accountId":"test808145b3bf9d0145b3c6812b0008"
}
{
   "uri":"https://sandbox.na.zuora.com/apps/PublicHostedPageLite.do",
   "method":"POST",
   "pageId":"test808145b3bf9d0145b3c6812b0008",
   "paymentGateway":"Fat Zebra",
   "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 or Z.renderWithErrorHandler function to support the use case of authorization amount processing or invoice processing.

Parameter Type Description

doPayment

boolean

Default: false

true indicates that the Payment Page will create a payment method as well as process the one-time payment transaction.

If it is false or not specified, the Payment Page will only create a payment method. 

storePaymentMethod

boolean

Default: true

true indicates that the payment method will be stored in Zuora and will be used in subsequent recurring payments.

false indicates that the payment method will not be stored in Zuora.

field_accountId

string

 Zuora customer account ID, such as 8a90e5e48f2eade6018f2ed19133003a. The payment method will be created for this specified account.

For more information about this parameter, see Client parameters for Payment Pages 2.0.

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:

  • type - The value must be invoice.
  • ref - The value must be the invoice number, such as INV0000001.

Here is an example for authorization amount processing.

var params = {
    doPayment:"true",
    storePaymentMethod:"true",
    field_accountId:"testc0f87596f2f301759c2944360000",
    authorizationAmount:"99",
    field_currency:"AUD"
};

Here is an example for invoice processing.

var params = {
    doPayment:"true",
    storePaymentMethod:"true",
    field_accountId:"testc0f87596f2f301759c2944360000",
    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.