Below is an HTML form that can be used to test payment collection functionality using Direct Post with credit card or ACH payment methods. It can also be used as a starting point for a User Self-Service page for collecting payments.
Pre-requisites
- You must configure at least one set of configuration parameters for Direct Post.
- You must create an account with a balance due (e.g. register a new account with an "external payment method").
- Copy and save the HTML form on this page.
- Pop open the HTML code at the bottom of this page by mousing over the upper-right-hand corner of the code box and clicking the code logo
.
- In the resulting window that pops up, copy the HTML at the bottom of this article, from "<!DOCTYPE" down to "</HTML>", and paste it into a text editor such as Notepad.
- Save that file as "directPost.html." Double-clicking directPost.html will load a page that looks like the following, but in a single column (rather than the 3 shown).
You will fill out and submit this form to test your Direct Post functionality:
- Pop open the HTML code at the bottom of this page by mousing over the upper-right-hand corner of the code box and clicking the code logo
Using This Form
Below are instructions for filling out the form to test a simple use case:
There is a newly-registered account with a single Master Plan. The Billing Group associated with the plan is associated with an "external payment method," so no payment collection was attempted when the account was created via create_acct_complete_m.
As a result of submitting this form per the below instructions, the balance due on the invoice will be collected (depending on your Payment settings); and, the credit card specified will replace the "external payment method" as the primary payment method for the Billing Group.
- Client Number is found under Configuration > Integrations > Web Servivce API.
- Mode is the name of the Direct Post configuration that you created.
- Session ID is the return of a call to set_session_m using the new account's Account Number.
- full_invoice_no is the invoice number of the invoice resulting from the new account's registration.
- Click the Pay by Credit Card radio button. A test credit card number is pre-filled. This credit card will become the primary payment method for the new account's existing Billing Group.
- Fill in the Billing Information. This information will be associated with the new account's existing Billing Group.
- Click Submit. A success or error messages will be appended to the Direct Post Redirect URL in a query string.
Direct Post HTML Test Form
The JavaScript referenced at the bottom, which pre-populates the Direct Post URL, can be used for testing, and can also be used in the Production environment. It is necessary for PCI compliance. Below that, you can specify the environment to which you are making the Direct Post call.