This document is provided as a technical resource to CCBill merchants. It is intended for programmers, technicians, and others with advanced coding skills. Some prior knowledge of the MD5 hashing algorithm is required.
Dynamic Pricing allows you to create new pricing options dynamically by passing variables into the signup form. This can be done using hidden HTML form fields or by including the variables into the URL string. To enhance security, an MD5 Hex Digest is used to validate the input of the new price.
Single billing and recurring billing subscriptions can be created using Dynamic Pricing, with the passed-in variables defining the pricing structure. Variable values will be passed to this script:
Variables are explained in detail in the next section.
Please note that if Dynamic Pricing is enabled on the subaccount level, ALL signup forms on that subaccount must use Dynamic Pricing in order to function correctly. This includes forms created on the subaccount prior to Dynamic Pricing being enabled.
If Dynamic Pricing is enabled only on a particular form and not the entire subaccount, other forms on that subaccount will not be required to use Dynamic Pricing.
Dynamic Pricing includes the following default settings. Changes to these settings may be available. Please contact Merchant Support for more information.
The set of variables passed into the form will depend on the type of transaction. The following variables are required for both single and recurring transactions:
The following variables are required for recurring transactions only. Omitting these variables will result in a single billing transaction:
The formDigest value is a hex-encoded MD5 hash, calculated using a combination of the above fields and a salt value. The salt value is used by CCBill to verify the hash and can be obtained in one of two ways:
Using your preferred MD5 hash generation tool and the Hex encoding method, you will need to create an MD5 Hex Digest using certain variable values. Values should be concatenated into one single string with no spaces prior to hashing.
For single billing transactions, use the following values in the order they are listed:
formPrice formPeriod currencyCode salt
For recurring transactions, use the following values in the order they are listed:
formPrice formPeriod formRecurringPrice formRecurringPeriod formRebills currencyCode salt
The resulting MD5 hash will be used as the value for the formDigest variable. This value can be statically hard-coded into a page or generated “on the fly” using a custom script.
Note that the values for clientAccnum, clientSubacc, and formName are not used when creating the MD5 hash for either transaction type.
The following example shows the data being passed through the URL string:
This URL string would be used as a link to the signup form.
Variables can also be passed using hidden fields in an HTML form. The following example shows possible code for a button that will take the consumer to the signup form:
<form id="myForm" method="post" action="https://bill.ccbill.com/jpost/signup.cgi"> <input type="hidden" name="clientAccnum" value="900100"> <input type="hidden" name="clientSubacc” value="0000"> <input type="hidden" name="formName” value="75cc"> <input type="hidden" name="formPrice” value="18.00"> <input type="hidden" name="formPeriod” value="10"> <input type="hidden" name="formRecurringPrice" value="25.00"> <input type="hidden" name="formRecurringPeriod" value="30"> <input type="hidden" name="currencyCode" value="840"> <input type="hidden" name="formRebills" value="1"> <input type="hidden" name="formDigest" value="14251aa803845b1ce6916ebba4015e91"> <input type="submit" value="Join Now!"> </form>
Dynamic Pricing requests will return the responseDigestvalue using the Background Post system. This value is an MD5 hash of transaction results which can be used to verify that the response was received properly by CCBill.
The value for responseDigest will contain an MD5 hash of the following values for approved transactions, concatenated into a single string:
These values will be sent to the Approval Post URL.
The value for responseDigest will contain an MD5 hash of the following values for denied transactions, concatenated into a single string:
These values will be sent to the Denial Post URL.
For more information on Background Post, including the use of Approval/Denial Post URLs, consult the Background Post User’s Guide.