Sign Up Sign in Blog Support

CashSender Shopping Cart Buttons

Create Shopping Cart buttons using the CashSender website
Advanced Options of Shopping Cart buttons
Create HTML code for Shopping Cart buttons manually
Add To Cart button variables reference
Sample HTML Code

Overview

The CashSender Shopping Cart allows your user to select multiple items from your website and pay for them in a single payment. With the "Add to Cart" and "View Cart" buttons, you can add a free Shopping Cart to your website very quickly.

The "Add to Cart" and "View Cart" buttons can be created using the Shopping Cart button creation tool on the website or you can manually write the HTML code for the buttons.

Create Shopping Cart buttons using the CashSender website

You can access the Shopping Cart button creation tool under the Seller Tools tab.

Item Details - The details will be shown to your customer in the shopping cart (except weight information):

  1. Item Name/Services: Name of the item or service being purchased
  2. Item ID/number: Optional. A unique ID you might use to identify the item being purchased
  3. Price and Currency: Amount of the payment
  4. Weight: Optional. The weight is not displayed to your customer, it is only used for calculating shipping, if you are using the shipping calculator with weight method

Button Style - You can use one of the preset buttons provided by CashSender, or your own custom image of the button by providing the URL of the image.

Button Encryption - With encryption enabled, the item price and details are encrypted and cannot be altered, it offers the best protection against fraudulent alteration. However, you will not be able to directly modify the HTML code of the button. Note: You should always verify the payment amount regardless whether your button is encrypted or not.

Shipping - Note that if you enabled the override function of the shipping calculator, the shipping setting of button will not be used.

  1. N/A: No shipping cost
  2. Flat Rate: A flat shipping cost is applied to each unit of the item.
  3. Percentage: Shipping cost is calculated as a percentage of the price.
  4. Shipping Calculator: Shipping is calculated using the settings of the Shipping Calculations under your profile.

Tax

  1. N/A: No tax is applied to the purchase
  2. Percentage: Tax is calculated as a percentage of the price.
  3. Tax Calculator: Tax is calculated using the Sales Tax settings under your profile, based on the shipping address of the purchase.

Shipping Taxable - If enabled, the tax settings above is applied to the shipping cost. This is ignored if the shipping calculator is used.

Advanced Options of Shopping Cart buttons

Clicking the "Add More Options" button in the Shopping Cart button creation tool reveals additional settings for the shopping cart buttons.

Option Fields - If you are selling different variants of the item (such as different sizes), you can add up to two option fields to the button using the button creation tool. The information in the option fields will appear in the invoice of the purchase. Please note that option fields are not encrypted.

  1. Option Field Type: Drop-Down menu is best used for a preset of options such as sizes. Text field can be used additional notes.
  2. Option Name: Name of the option.
  3. Drop Down Menu Choice: Enter the different options in the drop down menu.

An example where you are selling T-shirts with different sizes and customized text:

Button created:

Payment Success and Cancellation Redirection - Redirect your customers back to your website after they successfully check out or cancel the payment. By default, your customer stays on the CashSender website after checkout.

View Cart Button Style - You can use one of the preset buttons provided by CashSender, or your own custom image of the button by providing the URL of the image.

Email address to receive payment - By default the payment is addressed to your primary email. You can select a different email address for the payment to be addressed to, which is especially useful if you are operating different businesses under the same CashSender account.

Create HTML code for Shopping Cart buttons manually

You can also create your own Shopping Cart buttons manually or programmatically by your web application. Some settings are not assessible by the Shopping Cart button creation tool and must be added manually with HTML code.

The Shopping Cart button must follow the below specification:

  • The form must be sent to the URL https://www.cashsender.com/?cmd=buy (if you are using the sandbox, use https://sandbox.cashsender.com/?cmd=buy).
  • POST and GET methods could be used, but POST is recommended.
  • Add to Cart button: It must contains a hidden input with name "stage" and value "add to cart".
  • View Cart button: It must contains a hidden input with name "stage" and value "view cart".
  • Input value should be UTF-8 encoded.

Add To Cart button variables reference

Below table lists the variables for the setting of the Add to Cart button, you will most likely put them as hidden inputs in a form.

Variable name Description Specification Required
stage Must contain the value "add to cart" Must contain the value "add to cart" Required
email Email address this payment is addressed to. Should be a confirmed email address you registered with your CashSender account. Valid email address (max 255 characters). Required
name Name, description of the item/service Text (max 128 characters) Required
item_id An ID you assigned to the item/service Text (max 128 characters) Optional
price Price of the item Decimal number Required
discount Discount of the item (in percentage) Integer (0 - 100) Optional
currency Currency to be charged ISO 4217 currency code (3 letters) Required
weight Weight of the item Number. Default: 0 Optional
weight_unit Unit of the weight of the item 1 = kg
2 = pound
Optional
shipping Shipping Option (with no quantity option) 0 = No shipping (default)
1 = Flat rate
2 = Percentage of price
3 = Use shipping calculator

Note: Shipping option has no effect if the shipping calculator setting "Override shipping settings in shopping cart or pay now button" is enabled.

Optional
shipping_flat Shipping flat rate Decimal number Required if shipping=1
shipping_percent Shipping rate in percentage of price Number Required if shipping=2
tax Tax Option 0 = No tax (default)
2 = Percentage of price
3 = Use tax calculator
Optional
tax_percent Tax rate in percentage Number Required if tax=2
shipping_taxable Is shipping taxable 0 = No (default)
1 = Yes

Note: This setting is ignored if the shipping calculator is used (if shipping=3 or the override feature is enabled).
Optional
option_1 Option Field 1 Value Text (max 255 characters) Required if option_name_1 is present
option_name_1 Name of Option Field 1 Text (max 128 characters) Required if option_1 is present
option_2 Option Field 2 Value Text (max 255 characters) Required if option_name_2 is present
option_name_2 Name of Option Field 2 Text (max 128 characters) Required if option_2 is present
option_3 Option Field 3 Value Text (max 255 characters) Required if option_name_3 is present
option_name_3 Name of Option Field 3 Text (max 128 characters) Required if option_3 is present
option_4 Option Field 4 Value Text (max 255 characters) Required if option_name_4 is present
option_name_4 Name of Option Field 4 Text (max 128 characters) Required if option_4 is present
success_url URL to redirect user after payment was successfully made Valid URL (max 128 characters) Optional
cancel_url URL to redirect user after payment was cancelled Valid URL (max 128 characters) Optional
ipn_url URL for IPN listener

If this is specified, IPN URL setting in profile is ignored for the product
Valid URL (max 128 characters) Optional
invoice_id A unique ID assigned to the invoice of the payment.

The ID is recorded under your CashSender account, and payment with duplicate invoice_id is blocked if blocking is enabled in your payment receiving preferences is (found under My Account => Profile => Payment Receiving Preferences).
Text (max 255 characters) Optional
discount_ipn Show discount details in IPN?

If enabled, item price before discount is shown in IPN, and separate parameters "item_discount_n" is shown to indicate the effect of the discount.

If disabled, item price after discount is shown in IPN. The IPN will be identical as if the item is listed at the lower discounted price.
0 = No (Default)
1 = Yes

If multiple items have different "discount_ipn" values (0 and 1), it will enable the discount detail in IPN (discount_ipn = "1")
Optional
ref_1 Reference passback variable 1. Only useful if using IPN Text (max 255 characters) Optional
ref_2 Reference passback variable 2. Only useful if using IPN Text (max 255 characters) Optional

Sample HTML Code of Add to Cart Button

Sample HTML Code of View Cart Button