Home / ... / Payment as a Service / Getting Started / Sample Programs

Sample Programs


Table of Contents  [ Hide]

The following sample codes provide examples of how to use the API in different languages. The API only responds to secure (https) sites. The site that posts any data to the API has to be hosted on a secure site.

PHP

The following are a few sample codes for using the API in PHP.  To develop the account information is needed.  Without an account the following code will not work as the GUID, account number, etc. require a valid account.

Form Samples

The following forms are developed in PHP:

Click to download the following examples: PaaS-Sample_PHP_Forms.zip

 Example 001

In the above example, identified as Rent Payment, an amount entered will trigger a convenience fee to be added to the total. The convenience fee is a percentage of the total amount to be paid. The item purchased (paid for) will be identified by the Property Office text box.

The form may be used by removing AccountGuid and AccountID and making them hidden fields.

Example 002

In the above example a donation form allows the patron to make a donation through a radio button. Recurring payment as well as email subscription is also part of the form.

The API allows for integration of Constant Contact and MailChimp (individually or used in combination) into a form. To enable any or both of these services follow the steps listed below:

  • Login to the administrative system
  •  Click on Account Info (top right hand side)
  •  Click on 3rd Party
  •  Enter the Constant Contact & MailChimp information through the appropriate tabs.

   For added security it is recommended that a catalog page is created with 3rd party option enabled for Constant Contact & MailChimp. Using the WID will remove the requirement of UserID & Password for these sites to be added to the XML. Through a checkout page the notification email and receipt header may also be customized through the admin.

Example 003

In the above example the idea of a shopping cart is presented. Items may be added and removed from the basket with additional amounts added prior to making a payment. Recurring donation as well as eNewsletter is also included.

This sample was developed in PHP and is an integrated module in the SugarCRM. The module serves as a virtual terminal inside the CRM package.

Posting Method

Flash

The following is a sample code for using the API in Flash. Examples are provided for both Flex & standard Flash.

Notice of special feature:  

  • OperationBase64Encode 

An additional operation was added to resolve problems with those developers using Flash. Flash developers were experiencing problem using the SOAP service. In general Flash changes all the left brackets (>) in the XML to the equivalent HTML code (<). Based on our research the issue is a general problem with Flash & SOAP as reported by other developers in various forums.



     RSS of this page