Loading...
 

Dynamic Pricing User Guide


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.

Overview

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:
https://bill.ccbill.com/jpost/signup.cgi

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.

Defaults

Dynamic Pricing includes the following default settings. Changes to these settings may be available. Please contact Merchant Support for more information.
  • Minimum Price. $2.95
  • Maximum Price. $100 (initial AND/OR recurring)
  • Minimum Period. 3 days
  • Recurring Periods Allowed. 30 Days, 60 Days, 90 Days.

Variables

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:
  • clientAccnum. An integer value representing the 6-digit merchant account number.
  • clientSubacc. An integer value representing the 4-digit merchant subaccount number.
  • formName. The name of the form.
  • formPrice. A decimal value representing the initial price.
  • formPeriod. An integer representing the length, in days, of the initial billing period.
  • currencyCode. An integer representing the 3-digit currency code that will be used for the transaction.
  • formDigest. An MD5 Hex Digest based on the above values; this is explained further in the next section.
The following variables are required for recurring transactions only. Omitting these variables will result in a single billing transaction:
  • formRecurringPrice. A decimal value representing the recurring billing price.
  • formRecurringPeriod. An integer representing the number of days between each rebill.
  • formRebills. An integer representing the total times the subscription will rebill. Passing a value of 99 will cause the subscription to rebill indefinitely.

Generating the MD5 Hash

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:
  • Contact merchant support and receive the salt value, OR
  • Create your own salt value (up to 32 alphanumeric characters) and provide it to merchant support.
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.

Code Examples

The following example shows the data being passed through the URL string:
https://bill.ccbill.com/jpost/signup.cgi?clientAccnum=900100&clientSubacc=0000&formName=75cc&formPrice=18.00&formPeriod=10&formRecurringPrice=25.00&formRecurringPeriod=30&currencyCode=840&formRebills=1&formDigest=14258aa803845b8ce6916ebba4015e91

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>

Postback

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:
  • subscriptionId. The unique subscription ID number for the subscription.
  • 1. This value is simply the number 1 (one), used to show the transaction was approved.
  • salt. The same value for salt mentioned in the Generating the MD5 Hash section above.
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:
  • denialId. The unique denial ID number for the subscription.
  • 0. This value is simply the number 0 (zero), used to show the transaction was denied.
  • salt. The same value for salt mentioned in the Generating the MD5 Hash section above.
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.

v.3 12.30.2014