Trial and regular products in the same shopping cart
Overview
2Checkout supports scenarios in which you sell one or more regular products and offer one or more free/paid trials (with payment details - mandatory) in the same shopping cart to your customers.
Availability
All 2Checkout accounts.
Requirements
Products for which you're offering evaluation versions must meet the following criteria:
- They must be free or paid trials for which you're collecting payment details from customers by using the Request payment details and customize your trial option.
- They must support electronic delivery as the shipping class.
- They can only be standalone offerings, not bundles.
- They cannot match any of the regular products added to cart (Note: Customers won't be able to access the trial and purchase the regular version of a product using the same shopping cart session).
Scenarios covered
- One product and one paid/free trial (with payment details) in the same cart;
- Multiple products and one paid/free trial (with payment details) in the same cart;
- One product and multiple paid/free trials (with payment details) in the same cart;
- Multiple products and multiple paid/free trials (with payment details) in the same cart.
Use checkout.php trial links
Using the Sales Links area of the 2Checkout Control Panel, you can generate trial links such as the one below, which points to the trial.php page:
https://secure.2checkout.com/order/trial.php?PRODS=5566778&PAY_TYPE=CCVISAMC&PRICES5566778[USD]=0&TPERIOD=30&PHASH=sha256.1f24f5c938adf4c125ddfe67242d958a
You need to build your own trial links, pointing to the checkout.php page, instead of trial.php, and use them to create mixt regular product and trial links.
checkout.php trial links | trial.php trial links |
---|---|
Build links using checkout.php | Trial links generated automatically use trial.php |
Trial period is defined in the link using the TPERIOD parameter as such: TPERIOD=30 | Trial period is defined in the link using the TPERIOD parameter as such: TPERIOD=30 |
HASH signature needs to be generated manually | HASH signature is generated automatically along with the link |
Parameters required
Parameter | Info | Mandatory |
---|---|---|
Secret Key |
The secret key is communicated to you when your account with 2Checkout is opened. You can always retrieve the secret key information from the "Account settings" section in the Control Panel (https://secure.2checkout.com/cpanel/account_settings.php). The secret key is listed in the Instant Payment Notification area (scroll down toward the bottom of the page). The secret key is required to calculate the HMAC_SHA signature. A HMAC_SHA signature is calculated and applied to the request, using a BASE STRING in tandem with the SECRET KEY generated by 2Checkout (view secret key). |
YES |
PRODS |
Product IDs for which the order will be processed, separated by comma (,), with no blanks. Example: PRODS=1234567,1234568. Each product added / imported into the 2Checkout platform is automatically assigned a system generated unique numeric (int) identifier. Example: Product ID = 1234567. In the Control Panel, click to edit a product, and select the Information tab. The Product ID of the item you're editing is available at the top of the General area under Information. Note: Product IDs are different than Product Codes, also available in this area, but which you control. |
YES |
PRICES[Product ID][Currency] | Required parameter to set the price for product default currency. For example, for a product with the 2Checkout product ID: 123456, the currency EUR, and the price 99.99, this parameter would look like: PRICES123456[EUR]=99.99. If not sent for other billing currencies, 2Checkout will convert based on the submitted default price. | YES (only for trials) |
TPERIOD[Product ID] |
Trial period must be at least 7 days. For example enter TPERIOD[Product ID]=7 for a 7-day trial, or TPERIOD[Product ID]=30 for a 30-day evaluation period. Needs to be used as in the following example: TPERIOD1234567=7, with 1234567 representing the product ID. Note: For trial only flow use TPERIOD instead of TPERIOD[Product ID]. |
YES |
PHASH | Required HMAC_SHA signature in order to prevent the request from being exploited. | YES |
Build a checkout.php trial Buy Link
For this example, let's assume that we need a trial link for the evaluation version of a product with the ID 5566778. The trial is free and the evaluation period is 30 days. We'll use the parameters listed above.
As already mentioned, system-generated trial links via the Sales Links area of the 2Checkout Control Panel work only for scenarios in which the trial is also the only item in the shopping cart, but not for mixt regular product and trial scenarios. This is why links as the one below should not be used.
https://secure.2checkout.com/order/trial.php?PRODS=5566778&PAY_TYPE=CCVISAMC&PRICES5566778[USD]=0&TPERIOD=30&PHASH=sha256.1f24f5c938adf4c125ddfe67242d958a
Instead, you need to build another type of trial link, pointing to checkout.php, and using the PRODS, PRICES[Product ID][Currency], TPERIOD and PHASH parameters. In this specific case:
- PRODS=5566778
- PRICES5566778[USD]=0
- TPERIOD=30
- Using the parameters above, you get the following sequence PRODS=5566778&PRICES5566778[USD]=0&TPERIOD=30.
-
Next, you need to prefix (prepend) the length of the character sequence to calculate the hash, namely 45. The resulting BASE STRING is 45PRODS=5566778&PRICES5566778[USD]=0&TPERIOD=30.
In case of using the QTY parameter in the buy-link, this key-value string should also be included in the hash (example: QTY=1). In this case, the resulting BASE STRING would be: 51PRODS=5566778&QTY=1&PRICES5566778[USD]=0&TPERIOD=30. - For the purpose of this demo, let's assume that your secret key is SECRET_KEY.
- Use the secret key and the base string to calculate the HMAC-SHA HASH. The result (valid exclusively for this example) should be:
- f2fdbc766c6dd162f6a3fd63a05a9a173052e0eabd45fb4d0b129669a99d4e8a (SHA2)
- 04fe358d6aadd01f1e4cefdf73853efeb231007182f8e71108ab8fd5b7d0dc3d (SHA3)
-
Build your complete link, adding the following elements together for:
-
SHA2:
- https://secure.2checkout.com/order/checkout.php?
- PRODS=5566778&PRICES5566778[USD]=0&TPERIOD=30
- f2fdbc766c6dd162f6a3fd63a05a9a173052e0eabd45fb4d0b129669a99d4e8a
As such:
https://secure.2checkout.com/order/checkout.php?PRODS=5566778&PRICES5566778[USD]=0&TPERIOD=30&PHASH=sha256.f2fdbc766c6dd162f6a3fd63a05a9a173052e0eabd45fb4d0b129669a99d4e8a
-
SHA3:
- https://secure.2checkout.com/order/checkout.php?
- PRODS=5566778&PRICES5566778[USD]=0&TPERIOD=30
- 04fe358d6aadd01f1e4cefdf73853efeb231007182f8e71108ab8fd5b7d0dc3d
As such:
https://secure.2checkout.com/order/checkout.php?PRODS=5566778&PRICES5566778[USD]=0&TPERIOD=30&PHASH=sha3-256.04fe358d6aadd01f1e4cefdf73853efeb231007182f8e71108ab8fd5b7d0dc3d
Use this link in the process described below, under the Alternative work flow section.
-
Build mixt regular products and trial Buy Links
Mixt Buy Links containing both regular products and trials have to be created manually, and need to paint users directly to Checkout.
Let's assume that you generated two build links, one for a regular product with ID 1234567 and a trial for a different product with the ID 5566778, just as in the examples below:
https://secure.2checkout.com/order/checkout.php?PRODS=1234567&CART=1&CARD=2
https://secure.2checkout.com/order/trial.php?PRODS=5566778&PAY_TYPE=CCVISAMC&PRICES5566778[USD]=0&TPERIOD=30&PHASH=sha256.ae929a5009ca5737d50c5f929d34650c
The steps required to build a mixt regular product and trial Buy Link are detailed below:
- Make sure that the mandatory information necessary to build the link is available, namely, the secret key for your 2Checkout account (necessary for the hash calculation), and the following parameters: PRODS, PRICES[Product ID][Currency] (along with its corresponding value, in this case the price of the trial version, that can be zero (0)), and TPERIOD[Product ID] (along with its corresponding value, in this case the duration of the evaluation period in days).
- You'll build the link from the https://secure.2checkout.com/order/checkout.php?, or https://secure.YourStore.com/order/checkout.php? in case you're using a custom domain.
- In this particular example, here is the list of parameters with their respective values:
- PRODS=1234567,5566778
- PRICES5566778 [USD]=0
- TPERIOD5566778=30
-
Using the parameters above, you get the following sequence PRODS=1234567,5566778&PRICES5566778[USD]=0&TPERIOD5566778=30. Next, you need to prefix (prepend) the length of the character sequence to calculate the hash, namely 60. The resulting BASE STRING is 60PRODS=1234567,5566778&PRICES5566778[USD]=0&TPERIOD5566778=30.
In case of using the QTY parameter in the buylink, this key-value string should also be included in the hash (example: QTY=1,1). In this case, the resulting BASE STRING would be: 68PRODS=1234567,5566778&QTY=1,1&PRICES5566778[USD]=0&TPERIOD5566778=30. - For the purpose of this demo, let's assume that your secret key is SECRET_KEY.
- Use the secret key and the base string to calculate the HMAC-SHA HASH. The result (valid exclusively for this example) should be:
- 849c5a6ff5e453600225ee675bd27037f81383c24769a2152eb4bf8e1a4bc6a9 (SHA2)
- a815a304725c54ea0eac2fd7214f654bb8b6cd1ce2245ee65769d765745f3f7a (SHA3)
- Build your complete link, adding the following elements together for:
-
SHA2
- https://secure.2checkout.com/order/checkout.php?
- PRODS=1234567,5566778&PRICES5566778[USD]=0&TPERIOD5566778=30
- 849c5a6ff5e453600225ee675bd27037f81383c24769a2152eb4bf8e1a4bc6a9
As such:
https://secure.2checkout.com/order/checkout.php?PRODS=1234567,5566778&PRICES5566778[USD]=0&TPERIOD5566778=30&PHASH=sha256.849c5a6ff5e453600225ee675bd27037f81383c24769a2152eb4bf8e1a4bc6a9
-
SHA3
- https://secure.2checkout.com/order/checkout.php?
- PRODS=1234567,5566778&PRICES5566778[USD]=0&TPERIOD5566778=30
- a815a304725c54ea0eac2fd7214f654bb8b6cd1ce2245ee65769d765745f3f7a
As such:
https://secure.2checkout.com/order/checkout.php?PRODS=1234567,5566778&PRICES5566778[USD]=0&TPERIOD5566778=30&PHASH=sha3-256.a815a304725c54ea0eac2fd7214f654bb8b6cd1ce2245ee65769d765745f3f7a
-
Alternative workflow
To allow your customers to buy one or multiple products while also accessing free/paid trials in the same shopping cart (during the same browser session) follow these steps:
- Generate the buy link for the regular product(s). Use the links on the purchase call to action on your online shop, such as the Buy buttons.
-
Build the trial links as per the example above. Use the links on the call to actions designed to enable access to trials on your online shop, such as the Download trial buttons.
Make sure your trial links use checkout.php and NOT trial.php, otherwise this alternative workflow would fail. Use this link in the process described under the Build a checkout.php trial Buy Link section. - Shoppers will click on the buy link for a regular product and add it to the cart.
- Shoppers continue the purchase process and click on the link to download a trial.
- The trial gets added to the same shopping cart as the regular product, provided that the browser session is still valid.
- Shoppers go through the steps of the purchase process to acquire the regular product as well as access the trial added to cart.
Limitations
The following scenario is not supported: both the regular and the trial versions of a product added to the same shopping cart. Customers can buy a product or access its evaluation version, but not both simultaneously in the same cart.
Scenarios:
- Product A and Trial for Product A in the same cart
- Customers add Product A to cart;
- Customers add Trial for Product A to cart during the same browser session;
- Result: Trial for Product A replaces Product A in the cart. Customers can access Trial for Product A but will need to buy Product A in a different shopping cart / via a new browser session.
- Trial for Product A and Product A in the same cart
- Customers add Trial for Product A to cart;
- Customers add Product A to cart during the same browser session;
- Result: Product A replaces Trial for Product A in the cart. Customers can buy Product A but will need to access Trial for Product A in a different shopping cart / via a new browser session.
Promotions/discounts
Discount coupons for Regular and Multi-product promotions used by shoppers acquiring a regular product and accessing a trial in the same shopping cart will only impact the trial when the evaluation period comes to an end and it's converted to a full product. Essentially, discounts are offered to shoppers for the first transaction marking the conversion of the trial to a regular product, equivalent to a new purchase, and not when the trial is first accessed. If, following the evaluation period the trial is not converted to a regular subscription, no discount is offered.
Order promotions will discount the total value of the initial order containing both regular products and trials. Order promotion discounts will no longer impact the transaction associated with the conversion of the trial to a full product.
Payment methods
Shoppers that access trials while concomitantly purchasing regular products will be able to use a number of payment methods supporting recurring billing such as credit/debit cards, PayPal and DirectDebit. Trials are set to auto-renew by default, and customers can opt out of a purchase during the evaluation period in order to not be billed for the trial conversion to a regular subscription.
Auto-renewal
The auto-renewal option doesn't impact trials, which are set to auto-renew by default. You can manually cancel new subscription purchases before trial ends.
Up-selling and cross-selling campaigns
Up-selling and Cross-selling campaigns will be triggered only for the regular products added to cart, but not for the trials of such offerings.