Sign Up Sign in Blog Support

Buy Now Buttons

Create a Buy Now button using the CashSender website
Advanced Options of Buy Now buttons
Create HTML code for Buy Now buttons manually
Buy Now button variables reference
Sample HTML Code

Overview

To accept single-item purchase or a single payment, you can use the Buy Now Button. The Buy Now button can also sell more than one unit of a single item. For additional items, you can create additional Buy Now buttons.

Buy Now buttons can be created using the Buy Now Buttons creation tool on the website or you can manually write the HTML code for the Buy Now buttons.

Create a Buy Now button using the CashSender website

You can access the Buy Now button creation tool under the Seller Tools tab.

Item Details - The details will be shown to your customer when he/she clicks the Buy Now button (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 the payment regardless the price and quantity of the item. If you want to vary the shipping cost for shipment with more than one unit, use the Multiple Items Shipping option
  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 Buy Now buttons

Clicking the "Add More Options" button in the Buy Now button creation tool reveals additional settings for the buy now button.

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.

Quantity Option - Allow your customer to purchase more than one unit of the item. Please note that if you enable the quantity option and select "Flat rate" or "Percentage" as the shipping option, it is overridden by the Multiple Item Shippings below.

Multiple Items Shipipng - Applies when the quantity option is enabeld. You can enter a different shipping costs for the first unit, and after the first item.

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 Buy Now button manually

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

The buy now 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.
  • It must contains a hidden input with name "stage" and value "singleitem".
  • Input value should be UTF-8 encoded.

Buy Now button variables reference

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

Variable name Description Specification Required
stage Must contain the value "singleitem" Must contain the value "singleitem" 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.

Note: If quantity option is enabled, use the variables "first_shipping" and "after_first_shipping" or use the shipping calculator (shipping=3 or enable the override function)
Optional
shipping_flat Shipping flat rate Decimal number

Note: This is ignored if quantity option is enabled
Required if shipping=1
Ignored if quantity=1
shipping_percent Shipping rate in percentage of price Number

Note: This is ignored if quantity option is enabled
Required if shipping=2
Ignored if quantity=1
quantity Quantity option: allow user to select more than one unit of the item 1 = Enabled (user can select more than one unit) 2 = Disabled (default) Optional
first_shipping Shipping cost of the first unit of the item.

Note: this setting only applies if shipping calculator is used (if shipping=3 or the override feature is enabled)
Decimal Required if quantity=1 and shipping calculator is used
after_first_shipping Shipping cost of each unit after the first unit.

Note: this setting only applies if shipping calculator is used (if shipping=3 or the override feature is enabled)
Decimal Required if quantity=1 and shipping calculator is used
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 Value 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 Value 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 Value 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 Value 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
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
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
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 Buy Now Button