Welcome to Zuora Product Documentation

Explore our rich library of product information

REST API approach

Use the REST API to create and tokenize Planet Datatrans credit card payment methods in Zuora.

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 FieldTypeDescription
accountKey string Zuora internal ID of the customer account that will own the payment method.
cardHolderInfoobjectContainer for cardholder information. The nested cardHolderName field is required.
cardMaskNumber string The masked card number.
cardNumberstringThe 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.
tokenizeboolean

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