Skip to main content

Create payment methods on Planet

Zuora

Create payment methods on Planet

This payment gateway integration can be requested through the Specialized Payment Connections service at an additional cost.

To create Credit Card payment methods on Planet Datatrans, use one of the following approaches:

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

During payment method validation and creation, Datatrans returns the cardOnFile ID in processing webhook events, which Zuora stores as the Token ID. 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 Datatrans field
Token ID cardOnFile ID
Second Token ID Merchant Reference Number
Third Token ID Gateway Transaction Reference ID

In the Electronic Payment Methods section of the customer account page, you can retrieve Second Token ID and Third Token ID.

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

  1. Prepare for the integration.
  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.

You can find detailed instructions in the following sections.

Step 1. Prepare for the integration

Step 2. Set up a Payment Page 2.0

  1. 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.
  2. Optionally, preview the Payment Page.
  3. Optionally, translate and localize the Payment Page.
  4. 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":"Planet",
   "authroizationAmount":"100",
   "currency":"USD",
   "accountId":"test808145b3bf9d0145b3c6812b0000"
}
{
   "uri":"https://sandbox.na.zuora.com/apps/PublicHostedPageLite.do",
   "method":"POST",
   "pageId":"test000045b3bf9d0145b3c6812b0008",
   "paymentGateway":"Planet",
   "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: 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. 

To implement a one-time payment flow, doPayment must be true.

storePaymentMethod

boolean

Default: true

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

false indicates that the payment method will not be stored in Zuora. End customers need to be brought back to session to authenticate the payment.

field_accountId

string

Zuora customer account ID. The payment method will be created for this specified account.

Example: 8a90e5e48f2eade6018f2ed19133003a

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:"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.

REST API approach

Prerequisite

Contact Planet Datatrans to enable the support for plain cards.

Create payment methods

You can create Credit Card payment methods by using the REST API operations for creating payment methods, such as Create a payment method. In your request, pass in the following required fields.

Required Field Type Description

accountKey

string

Zuora internal ID of the customer account that will own the payment method.

cardHolderInfo object Container for cardholder information. The nested cardHolderName field is required.

cardMaskNumber

string

The masked card number.

cardNumber string The card number.

cardType

string

The type of the credit card.

expirationMonth

integer

One or two-digit expiration month (1-12) of the credit card.

expirationYear

integer

Four-digit expiration year of the credit card.

tokenize boolean

Default: false

Specify true to tokenize the payment method with the card information.

tokens

object

The container for the token information. Pass in your existing token information through the following nested fields:

  • gatewayType

    Type: string

    The type of payment gateway to generate the token. This field is case-sensitive. Specify Planet in this field. 

  • tokenId

    Type: string

    Specify the value of SCA Transaction Reference Id returned from Datatrans.

    SCA Transaction Reference Id will be stored in Zuora. When processing payments, tokenId containing SCA Transaction Reference Id will be mapped to card.cardOnFile.id in the Datatrans Authorize a transaction API. Note that the cardOnFile feature needs to be enabled on the merchant configuration in Datatrans.

  • secondTokenId

    Type: string

    Pass in the second token of the payment method if available.

  • thirdTokenId

    Type: string

    Pass in the third token of the payment method if available.

type

string

The type of the payment method. Specify CreditCard in this field.

Here is an example of the API request for creating a tokenized Credit Card payment method:

{
    "accountKey": "8ad08e669299aa0a01929f0ac6af4748",
    "cardHolderInfo": {
        "addressLine1": "123 test street",
        "addressLine2": "",
        "cardHolderName": "Amy Lawrence",
        "city": "Fremont",
        "country": "USA",
        "email": "amy@testaddress.com",
        "phone": "4155551234",
        "state": "California",
        "zipCode": "94020"
    },
    "cardNumber": "4111111111111111",
    "cardMaskNumber": "************1234",
    "expirationMonth": "06",
    "expirationYear": "2025",
    "cardType": "Visa",
    "type": "CreditCard",
    "tokenize": true,
    "tokens": {
        "gatewayType": "Planet",
        "tokenId": "4111111111590001318379"
    }
}

For other optional fields, see Create a payment method.

For tokenized payment methods, you must validate them in Zuora so that payments made with these payment methods are successful. To validate tokenized payment methods, enable the following settings on the gateway instance configuration page:

  • Verify new payment method
  • Verify updated payment method