Knowledge Center

Knowledge Center > Commerce > Hosted Commerce Pages > Payment Pages 2.0 > Link Payment Methods from Payment Pages to Accounts

Link Payment Methods from Payment Pages to Accounts

There are two ways to associate a payment method to a Zuora account:

  • Use the Subscribe API call to link a payment method to a newly created Zuora account
  • Add a newly created payment method to an existing Zuora account

A payment method must be tied to a Zuora account using the methods below. A "standalone" payment method will be deleted if it is not associated with a Zuora account within a defined lifespan. As of release R188, the defined time limit is 240 hours.

Use the Payment Method in a Subscribe API Call

The payment method id is returned from a successful Payment Page submission in the RefId parameter. Enter the ID for the payment method object in a subscribe call when you create a new subscription.  

For example, within the subscribe call you would have:

<ns1:PaymentMethod>
   <ns2:Id>[RefID returned from Zuora]</ns2:Id>
</ns1:PaymentMethod>

How Zuora uses the ID depends on whether you are calling subscribe on a new or existing account:

  • For a new account, if you pass in a payment method ID, Zuora associates the newly created account with this payment method ID. This payment method is set as the default for the account and therefore will be used for subsequent payments on the account.
  • For an existing account, if you pass in a payment method ID, Zuora associates the payment method with the account, and the payment method is used for this payment. However, this payment method is not be set as the default for the account, so the newly created payment method will not be applied to subsequent payments.

Using the subscribe call is the only way to link a Payment Page's payment method to a newly created Zuora account. You cannot create a payment method with the Payment Page and then update the AccountID in the payment method object via the API.

If the payment method ID is not submitted in the subscribe call or the ID is invalid, Zuora does not attempt to validate that the rest of the fields are available, including credit card number and cardholder name, to create a payment method in the call.

Create a Payment Method for an Existing Account

To create or add a payment method to an existing account, use the field_accountId parameter. See Payment Pages Client Parameters for Payment Pages 2.0 for information about using the parameter.

For example, to add a payment method to a customer account having the account id, 4028e69633f7e23b0133fc473bf141a5, you would assign the account id to the field_accountId parameter as below:

var params = {
    tenantId:"123",
    id:"ff80808145b3bf9d0145b3c6812b0008",
    token:"qJ52b1iCyPXyZTcuQbfZa2qmKhD4qBGz",
    signature:"MjJmYjBmNTY3ZWI3ZjcyZTRmMjZlZWVhMTJhZDhiYWI1ZjUyMGRkNQ==",
    style:"overlay",
    key:"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC59DglWlsd82ooSVYyXoniF5rln3edz+5tdPLVBXXPDVXDCI9w7sneaj+XQs5LFaHZby117XzE8CFmoskVd2tsGLvXr83gEQ7eCXUrY0NDBFlAs0t+ChkB18VXG2DBbeUCI2poZJpCbpQm4rSvqUeY+8H/+/Stf4hXFWVPEEWyjwIDQAB",
    submitEnabled:"true",
    locale:"fr_FR",
    url:"https://www.zuora.com/apps/PublicHostedPageLite.do",
    paymentGateway:"DefaultGateway",
    field_accountId=4028e69633f7e23b0133fc473bf141a5
};

The newly created payment method will not be made default on the account. You need to use the Zuora API to update the account to set this payment method as default.

You must use the Zuora API to update card expiration dates and retrieve, display, and delete credit card information.

Last modified
15:42, 28 Jul 2016

Tags

Classifications

(not set)