Knowledge Center

Knowledge Center > Zuora CPQ > Hosted Commerce Pages > Hosted Payment Method Pages 1.0 > Create Hosted Payment Pages on Your Website > Sample Code for Hosted Payment Method Pages

Sample Code for Hosted Payment Method Pages

Overview

This section contains sample code for implementing Hosted Payment Method pages.

Zuora Global Support does not troubleshoot content from GitHub. The sample code is as an example of code that has worked for previous implementations and was created by both Zuora and non-Zuora authors. You must customize the sample code for use with your system. Send any comments and feedback to dev-support+hpm1@zuora.com.

Sample Demo Project

The sample code attached in this section will produce a simple demo project of the Hosted Payment Method pages. The project dynamically generates the iFrame URL, embeds the iFrame onto a webpage, and provides a link to refresh the iFrame and a link that displays the iFrame URL.

You will need to modify four input values in each of the projects to make it display your Hosted Payment Method pages:

  • ID (Page)
  • Tenant ID
  • API Security Key
  • Domain URL (the domain that iFrame is hosted, e.g. apisandbox.zuora.com)

Each sample code project also contains a callback file that contains logic to do the callback validation.  You will need to modify one input (API Security Key) on this file in order to make the demo project work.

If you properly modify the inputs above, then the demo project should display the following simple display of the Hosted Payment Method pages:

Screen shot 2012-02-08 at 11.56.13 AM.png

Below are the languages for which sample code for this demo project is available.

PHP

  1. Open the PHP demo project.
  2. Modify the​ subscription.php file with the four input values listed above.

Java

  1. Open the Java demo project.
  2. Modify the subscription.jsp file with the four input values listed above.

Ruby

  1. Open the Ruby demo project.
  2. Modify the payment_controller.rb file with the four input values listed above.

.NET

  1. Open the .NET demo project.
  2. Modify the subscription.aspx.cs file with the four input values listed above.
Last modified

Tags

Classifications

(not set)