Provide a Callback Page

Knowledge Center > Billing and Payments > Hosted Payment Pages > Hosted Checkout Pages > Create Checkout Pages on Your Website > Provide a Callback Page

Provide a Callback Page

Zuora Hosted Checkout Pages are no longer under active development. Customers should use Payment Pages 2.0 for their secure payment acceptance requirements.



After the hosted page has been submitted, Zuora will send a callback response to the Return URL as configured. The Return URL is responsible for processing the resulting parameters of when Zuora tries to create a subscription.

Return URL Parameters

When a subscription is successfully created, the parameter "success=true" will be added to the end of the Return URL response.  For example, a success response from Zuora would look like:

The parameters returned to the Return URL depends on the parameters you selected when you were creating or editing the Checkout page.  For example, in the screenshot below, the merchant has chosen to have :

Screen shot 2012-03-20 at 1.52.15 PM.png

Using the example above, a success response from Zuora would look like:

For unsuccessful hosted page submissions, parameters, successerrorCode, and errorMessage, will be returned: is some error message

Process Return URL Parameters

The callback page should perform something similar to the following when it is loaded. This is required because of cross-domain restrictions for iFrames.

function callback() {
        if (param("success") == true) parent.hp_cback_success(param("subscription_id"));
        else parent.hp_cback_fail(param("errorCode"), param("errorMessage"));
<body onload="callback();"/>

Zuora recommends that you use the callback page as a simple proxy for transmitting the data from Zuora to your subscription form. You should implement two JavaScript methods in on the subscription page: One to handle success and one to handle failures. They should look similar to the following:

function hp_cback_success(ref_id) {
        document.HostedPaymentMethodPageForm.paymentMethodId.value = ref_id;

function hp_cback_fail(errorCode, errorMessage) {
//display an error message

What's Next

Next, Verify the Callback Response.

Last modified



(not set)