Beanstream Payment Terminal

Overview

Our script allows you to have a quick & easy payment terminal for your clients to pay with major credit cards (Visa, Master Card, American Express) on your website (without leaving it) with BeanStream API, as well as paypal payments through paypal gateway. Installation and configuration of the script takes less than 5 minutes (however you do need to have SSL and BeanStream account). There are 3 options to pay: 1) customers can *input price themselves* and type description, 2) you can turn on *pre-defined services* and customers will select service from dropdown and 3) customers can select *recurring services from dropdown*

Optionally PayPal Website Payments Standard can be enabled/disabled for both one time PayPal payments and recurring PayPal payments.

Server Requirements

1) PHP 5.0+

2) SSL certificate installed on server

3) cURL php extension must be enabled to accept payments (contact your hosting provider if unsure).

Installation

Fresh installation is pretty simple. 

1) Unzip the contents of the file which you downloaded from codecanyon.net.
You will find 2 folders: “beanstream-payment-terminal” and “documentation”

2) open beanstream-payment-terminal/includes/config.php and edit all needed variables (see explanation below)

3) Upload “beanstream-payment-terminal” folder to your FTP server. 

Configuration

below you will find all editable variables from includes/config.php and their meaning. 

Line 19 – global page meta title
Line 21 – notification email address where you want to receive “new payment received” emails. (can be multiple emails, comma separated)
Line 24 through 29 – non-recurring services array. You can add more by copy/pasting line 31 below it.
Line 32 – if set to true services dropdown will be available on payment page for selection, if false – amount box will appear to allow customer amount entry
Line 34 – Live/Test indicator. If set to false – you will be using TEST environment, setting this to true will enable LIVE mode.
Line 36 – Payment type switch, can be ONETIME or RECUR. If set to ONETIME – payment terminal will charge customers single transaction. If set to RECUR – recurring services dropdown will appear instead of amount input box/services dropdown.
Line 43 through 61– Recurring services array FOR BEANSTREAM CREDIT CARD PROCESSING ONLY (if you won’t use PAYPAL and you will disable paypal payments as per description below- we suggest to use this recurring services array as it offers more options.) Please note: you MUST DISABLE PAYPAL (line 117 in config.php) if you want to use this this recurring services array. If you need more than 5 recurring options – copy line 60 below it. Array consists of 9 elements: ‘Service Name’, ‘Price to Charge’, ‘Billing Period’, ‘Billing Interval’, ‘The first bill date’, ‘Second bill date’, ‘Recurring service expiring’, ‘GST tax’, ‘PST tax’.
1. Service Name -string- (required)
2. Price to Charge -numeric- (required)
3. Billing Period -string- (required), can be D (daily), W (weekly), M (monthly) or Y (yearly)
4. Billing Interval -numeric- (required), it works in combination with 3.Billing period, eg: 5 and Billing interval set to D, will charge the client every 5 days
5. The first bill date -numeric- (optional) MMDDYYYY format (eg 10312013). If empty, transaction request time will be used
6. Second bill date -numeric- (optional) MDDYYYY (eg 01282013) format Will mark the start for the chosen billing schedule
7. Recurring service expiring -numeric- (optional) MMDDYYYY format will mark the end of the billing cycle, if not provided will can be set from cpannel
8. GST tax -numeric- (optional) 1 or 0 for applying the GST tax , 0 is default
9. PST tax -numeric- (optional) 1 or 0 for applying the PST tax , 0 is default

Line 64 through 71– Recurring services array FOR PAYPAL PAYMENTS & BEANSTREAM (more basic array). If you need more than 5 recurring options – copy line 70 below it. Array consists of 6 elements: ‘service name’, ‘price to charge’, ‘Billing period’ (“Day”, “Week”, “Month”, “Year”), ‘how many periods of previous field per billing period’, ‘trial period in days’ (BeanStream does not support trial periods), ‘Trial amount’.

USERNAME and PASSWORD combo or the HASH key are used only for recurring billing. You will not need the information below, or to configure or change USERNAME AND PASSWORD if you will be using only ONETIME payment. All that is needed is MERCHANT_ID.

If, however you need recurring payments – you need to enter USERNAME/PASSWORD OR HASH as per below:
BeanStream allows you to authenticate using your account user name and password OR by using a hash key that needs to be generated from control panel.
By default this script uses the account credentials BUT you may choose to use your hash key.
Please note that ONLY ONE authentication method is allowed at one time.
For using the hash key, you just need to comment defined user name and password from both live and test modes places from below, and to UN comment the hash
It should look like this for test mode :

   //TEST MODE
        //define('MERCHANT_ID', '291870000');
        //define('USERNAME', 'admin');
        //define('PASSWORD', 'S3cur3Pass!');
        define('HASH','YOUR_HASH_KEY');


Line 98 / 105 – enter your MERCHANT ID (please read text above – it explains whether you need to enter anything here or not)
Line 99 / 106 – enter your USERNAME (please read text above – it explains whether you need to enter anything here or not)
Line 100 / 107 – enter your PASSWORD (please read text above – it explains whether you need to enter anything here or not)
Line 101 / 108 – enter your HASH (please read text above – it explains whether you need to enter anything here or not)
Line 102 / 109 – enter your RECURRING_BILLING_PASS_CODE (please read text above – it explains whether you need to enter anything here or not)
Line 112 – Timezone variable. Default US/Eastern. Change it to your timezone from list here http://php.net/manual/en/timezones.php

If you have any additional questions about BeanStream API integration – we’ve included their documentation PDF in “assets” folder of this documentation (this script was based on that documentation).

Settings

In order to enable paypal payments (website payments standard) you need to change Line 78 in config.php to TRUE. Other paypal settings below:

Line 117 – PayPal payment method on/off switch.
Line 118 – PayPal merchant email.
Line 119 – PayPal success url – your customers will be taken to this page after successful paypal payment.
Line 120 – PayPal cancel url – your customers will be taken to this page if they decide not to pay through paypal.
Line 121 – PayPal ipn url – this is IPN listener file which will accept paypal responses about the payments and will notify you about new payments (if you want to update your db somehow – this is the file for paypal).
Line 122 – PayPal custom variable – you can pass any customer related variable here, serves for the purpose of updating database later in ipn listener file (optional).
Line 123 – PayPal currency.
Line 124 – PayPal Live/Sandbox mode switch. If set to true – paypal will run in TEST mode(you have to have paypal developers account and you must be logged in to developer.paypal.com)

Other than the above – you don’t need to edit any variables for PayPal.

PayPal Recurring Parameters (for paypal website payments standard recurring functionality, taken from paypal.com)

Name

Required or Optional

Description

Character Length

business

Required

Your PayPal ID or an email address associated with your PayPal account. Email addresses must be confirmed.

 

item_name

Optional

Description of item being sold. If you are collecting aggregate payments, the value can be a summary of all items purchased, a tracking number, or a generic term such as “subscription.” If this variable is omitted, buyers see a field in which they can enter the item name.

127

currency_code

Optional

The currency of prices for trial periods and the subscription. The default is USD.

For allowable values, see Currencies Supported by PayPal.

3

a1

Optional

Trial period 1 price. For a free trial period, specify 0.

 

p1

See description.

Trial period 1 duration. Required if you specify a1. Specify an integer value in the allowable range for the units of duration that you specify with t1.

2

t1

See description.

Trial period 1 units of duration. Required if you specify a1.

Allowable values are:

  • D – for days; allowable range for p2 is 1 to 90

  • W – for weeks; allowable range for p2 is 1 to 52

  • M – for months; allowable range for p2 is 1 to 24

  • Y – for years; allowable range for p2 is 1 to 5

1

a2

Optional

Trial period 2 price. Can be specified only if you also specify a1.

 

p2

See description.

Trial period 2 duration. Required if you specify a2. Specify an integer value in the allowable range for the units of duration that you specify with t2.

2

t2

See description.

Trial period 2 units of duration.

Allowable values are:

  • D – for days; allowable range for p2 is 1 to 90

  • W – for weeks; allowable range for p2 is 1 to 52

  • M – for months; allowable range for p2 is 1 to 24

  • Y – for years; allowable range for p2 is 1 to 5

1

a3

Required

Regular subscription price.

 

p3

Required

Subscription duration. Specify an integer value in the allowable range for the units of duration that you specify with t3.

2

t3

Required

Regular subscription units of duration.

Allowable values are:

  • D – for days; allowable range for p3 is 1 to 90

  • W – for weeks; allowable range for p3 is 1 to 52

  • M – for months; allowable range for p3 is 1 to 24

  • Y – for years; allowable range for p3 is 1 to 5

1

src

Optional

Recurring payments. Subscription payments recur unless subscribers cancel their subscriptions before the end of the current billing cycle or you limit the number of times that payments recur with the value that you specify for srt.

Allowable values are:

  • 0 – subscription payments do not recur

  • 1 – subscription payments recur

The default is 0.

1

srt

Optional

Recurring times. Number of times that subscription payments recur. Specify an integer with a minimum value of 1 and a maximum value of 52. Valid only if you specify src=”1″.

1

sra

Optional

Reattempt on failure. If a recurring payment fails, PayPal attempts to collect the payment two more times before canceling the subscription.

Allowable values are:

  • 0 – do not reattempt failed recurring payments

  • 1 – reattempt failed recurring payments before canceling

The default is 1.

For more information, see Reattempting Failed Recurring Payments with Subscribe Buttons.

1

no_note

Required

Do not prompt buyers to include a note with their payments. Allowable values for Subscribe buttons:

  • 1 – hide the text box and the prompt

For Subscribe buttons, always include no_note set to 1. )

1

custom

Optional

User-defined field which PayPal passes through the system and returns to you in your merchant payment notification email. Subscribers do not see this field.

255

invoice

Optional

User-defined field which must be unique with each subscription. The invoice number is shown to subscribers with the other details of their payments

127

modify

Optional

Modification behavior.

Allowable values are:

  • 0 – allows subscribers only to sign up for new subscriptions

  • 1 – allows subscribers to sign up for new subscriptions and modify their current subscriptions

  • 2 – allows subscribers to modify only their current subscriptions

The default value is 0.

For more information, see Working with Modify Subscription Buttons.

1

usr_manage

Optional

Set to 1 to have PayPal generate usernames and initial passwords for subscribers.

For more information, see Generating Usernames and Passwords with Subscribe Buttons.

1

Connect Database

In order to connect Beanstream payment terminal with your existing website database, to insert new orders or update existing upon successful payment you need to place your “update order” or “insert new order” code into following places:
For regular payments (non-recuring payments): includes/form.processing.php – between line 194 and line 195
For recurring payments: includes/form.processing.php – between line 451 and 453
For paypal payments standard : paypal_listener.php – between line 61 and 63

Live / Test Modes

You need to set variable on line 34 in includes/config.php to TRUE to use LIVE MODE and switch to FALSE to use TEST MODE 

Also don’t forget to set sandbox mode to false for paypal on line 61 in same file (if paypal payments are enabled on line 54).

For test purposes you can use 4242424242424242 VISA credit card with any cvv (3 numbers) and any future expiry date

You will need to create paypal developer account in order to test paypal payments in sandbox (test mode) – please read more here: https://cms.paypal.com/ca/cgi-bin/?cmd=_render-content&content_ID=developer/howto_testing_sandbox

Technical Support

We provide courtesy support for all our products to our valued customers within 48-72 hours after receiving the request through our support ticketing system. Each purchase comes with 6 months support time. After that – you may either purchase extended support through the marketplace or purchase premium support with us.

If you need any help regarding the installation of the script or any other question please read through respective product documentation first and if solution is not found – open support ticket (please note, you will need to register account and you will be required to provide your license key (item purchase code) during the registration process, which will then be validated through CodeCanyon API. If your support period has expired you may either extend it with Envato or purchasepremium support from us).

Please note that we do not provide support by email. Any email related to support and not to pre-sales questions will be replied to after any other support tickets are resolved and in general will be directed to open a ticket, since we need to validate your purchase/support period validity.

For more details about our support policy and terms of service (including what is and is not included in Basic Support) click here.

Our business hours are Monday – Friday: 9:00am – 6:00pm (EST), and support is provided only at that time. Upon opening a ticket, we make it our goal to respond within 48-72 hours, however depending on the issue you’re having it may take a bit longer, but in any case we will address the issue within specified period of time with at least “resolution time” in reply.

Changelog

v1.0 – 6 September 2013
initial release

Sources, Credits, Appreciation

We’ve used the following images, icons or other files as listed.

  • jQuery UI Library – http://www.jqueryui.com
  • jQuery Library – http://www.jquery.com
  • jQuery Colorbox – http://www.jacklmoore.com/colorbox
  • jQuery Tools – http://jquerytools.org/

Once again, thank you so much for purchasing our product. 

Is this document useful? 0 0

Published: March 11, 2016 Updated: March 11, 2016

« back to all manuals