Thursday, November 12, 2009

Plimus Integration using PHP

This is Sample code for Plimus Integration using PHP

< form id="form1" action="https://secure.plimus.com/jsp/buynow.jsp" method="post" >
< input type="hidden" name="contractId" value="" / >
< input type="hidden" name="quantity" value="1" / >
< input type="hidden" name="overridePrice" value="50" / >
< input type="hidden" name="custom1" value="1001" / >
< input type="hidden" name="enableCustom" value="Y" / >
< input type="hidden" name="firstName" value="" / >
< input type="hidden" name="lastName" value="" / >
< input type="hidden" name="email" value="" / >
< input type="hidden" name="address1" value="" / >
< input type="hidden" name="address2" value="" / >
< input type="hidden" name="city" value="" / >
< input type="hidden" name="zipCode" value="" / >
< input type="hidden" name="country" value="" / >
< input type="hidden" name="state" value="" / >
< input type="hidden" name="workPhone" value="" / >
< input type="hidden" name="cardNumber" value="" / >
< input type="hidden" name="verifyCardCode" value="" / >
< input type="hidden" name="bCur" value="USD" / >
< input type="hidden" name="currency" value="USD" / >
< input type="submit" id="btnSubmit" name="btnSubmit" value="Plimus - Pay Now"/ >
< /form>

SWREG Digital River integration using PHP

Services

Set-up Instructions : Advanced Level Linking

Our most challenging level of linking for people who want total control.
The customer remains on your website.

Please contact Swreg prior to starting development to confirm you are eligible to use the feature. In addition, study the Intermediate Level as you will need to understand the concepts before proceeding here. This especially applies to multiple products per order.

The Advanced Level principle is that you collect all the order information on your own secure server, you then POST the information to our program called https://usd.swreg.org/cgi-bin/c.cgi that returns a string containing a result code, a currency, type of purchase (i.e., realtime, by fax, by phone, etc), an order number, and a value in your own default currency (See below table for further details). On receipt of that string you will produce a web page for your customer incorporating template web pages stored on our website (you must link to them rather than store them locally as they can change from time to time). Meanwhile we will operate exactly as Basic and Advanced levels in sending out emails, storing transactions, etc.

Result parameters
Key Value Description
result Integer Values/description available below.
ordernumber Integer Swreg order number.
payment_method Integer Swreg Payment Method id (Definitions available at tester.htm).
soft_descriptor Url escaped string For payment method 1 calls. Will return soft descriptor that will appear on credit card statement.
currency Url escaped string Native currency to server/account.
amount Float Amount charged in server/account currency.
txn_currency Url escaped string Transaction currency credit card was charged.
txn_amount Float Amount charged in transaction currency.

Parameters that may be returned by check payment processing
BANKACCOUNTNUMBER String Payment processor customData
BANKNAME String Payment processor customData
BRANCHCODE String Payment processor customData
CHEQUEACCOUNTHOLDER String Payment processor customData
COUNTRYDESCRIPTION String Payment processor customData
PAYMENTREFERENCE String Payment processor customData
POSTALADDRESS1 String Payment processor customData
POSTALADDRESS2 String Payment processor customData
POSTALADDRESS3 String Payment processor customData
SWIFTCODE String Payment processor customData

Parameters that may be returned by electronic/wire payment processing
ACCOUNTHOLDER String Payment processor customData
ADDITIONALBANKINFO String Payment processor customData
ADDITIONALREFERENCE String Payment processor customData
ATTEMPTID String Payment processor customData
BANKACCOUNTNUMBER String Payment processor customData
BANKNAME String Payment processor customData
BANK_SORT_CODE String Payment processor customData
BRANCHCODE String Payment processor customData
CITY String Payment processor customData
COMPLETE_FORMATED_ACCOUNT String Payment processor customData
COUNTRYDESCRIPTION String Payment processor customData
EFFORTID String Payment processor customData
EXTERNALREFERENCE String Payment processor customData
IBAN String Payment processor customData
MERCHANTID String Payment processor customData
ORDERID String Payment processor customData
PAYMENTREFERENCE String Payment processor customData
SPECIALID String Payment processor customData
STATUSDATE String Payment processor customData
STATUSID String Payment processor customData
SWIFTCODE String Payment processor customData
midCategory String Payment processor customData
reference_number String Payment processor customData

Active until October 1st, 2008 (Please discontinue using before this date)
USD Float Amount charged in server/account currency.
GBP Float Amount charged in server/account currency.
EUR Float Amount charged in server/account currency.
CAD Float Amount charged in server/account currency.
??? Float Amount charged but server/account currency unknown.

Please go to a live working site now at http://www.evidence-eliminator.com - this is from our second busiest vendor, Andy Churchill, to whom we are indebted for assistance in developing this system, and is working in anger right now. Feel free to do a test using the "By Phone" or "By Fax" orders but make it clear in your address it is a test purchase so Evidence Eliminator can ignore them in the Pending Orders report. (Of course you could always buy a copy)!! Click here to download Andy's PERL source code for adaption by yourself.

Chris from Cinarsoft has kindly made an adaption to work with PHP. Click here for source code. His website is running it at http://www.cinarsoft.com/

Graham from GPP Software has provided a solution for .NET. Please click here to download. It is written in C# .NET, conversion to VB.NET would be very simple.

Please do not ask these two kind folks to support their code.

You may wish to lift the source code for the list of countries we sell to from https://usd.swreg.org/cgi-bin/s.cgi?s=43387&p=433871&v=0&d=0&q=1&t=

Now look at the web page at http://swreg.org/tester.htm - you will see a test page listing all the variables we need - you should study the code on this page to see how it works. All variables are required to be POSTed but a list of variables that must have data is shown with an asterisk. All variables not required to have a value must still be sent as a null value (this can simply be an = sign like "x=")

What happens when you submit our sample page is that it sends a string to our program at https://usd.swreg.org/cgi-bin/c.cgi

If the order is successful you will get back a zero (0). If the order fails, a non-zero value with be returned. Possible return values are available here.

RULES:

When not a realtime credit card order you need to supply the following web pages in a frame with your pricing confirmation at the top and the following information at the bottom. The information at the top must always quote the Order Number prominently - this is one of the returned values from our server.

* "By Fax" - place http://swreg.org/fax_ordering.htm in the lower frame. Remind people there is a $3 surcharge for ordering this way and that they must use the same email address as already on Paypal or the order will fail.
* "By Phone" - place http://swreg.org/phone_ordering.htm in the lower frame. Remind people there is a $3 surcharge for ordering this way.
* "By Check" or "By Wire" or "By Electronic Funds Transfer" - Remind people there is a $3 surcharge for ordering by check and an $20 surcharge for wire transfer. We will return the information to make the payment in the parameters listed at the top of this page for check or wire payment processing.
* TEST PURCHASES - If the purpose of testing is to test your communications with our server then you can test the results with credit card number 5555555555555555 (5 x 16). You will get a simple page returned with the word "Test Mode" and a list of all variables you have sent. This proves communication with our server. You will not get any transactions logged even in the Pending Orders database, nor any test emails. You can also try using card 36000000000008 which should give you a failure although it should appear as "Test Completed" in the Pending and Failed orders table - if it does show "Test Complete" or "Declined" it proves communication through to our bank. Another way to do an online test is to use the "By Phone" or "By Fax" options. If you wish to test the email layouts then you need to use the Test Order button on each product data entry page online.
* Remember you can select currency and you can select method of payment.

On a multiple product order you only enter the general variables (name, address, etc) once. All transaction variables can be entered just like the Intermediate method described above.

You will need a GetEnv variable to identify the customer's IP - getenv("REMOTE_ADDR") - or try http://www.swreg.org/cgi-bin/whoami.cgi to see how it can work.

Currencies: The best practice is to display and charge your customer in their native currency. You can convert USD to other world currencies by calling http://usd.swreg.org/cgi-bin/rate-calculator.cgi?currency=GBP. Where GBP is the international 3 letter currency code. This will return the conversion rate we are using at that moment so you will need to multiply USD by that rate to get an approximation of what will appear on the customer's credit card. Then you will pass the currency to charge the customer with the c= parameter. We will return the amount and currency of the charge. There are currencies that we do not have exchange rates, the rate calculator will return 0.000000 in these cases.

For a list of supported currencies please visit :-

https://usd.swreg.org/cgi-bin/s.cgi?s=43387&p=433871&v=0&d=0&q=1&t=

MORE RULES:

Please keep an eye on these rules as they may change form time to time until we have worked them all out from experience.

* You must collect IP number (see above)
* You must transmit to us required variables, but you do not need to passed optional variables - see the page at http://swreg.org/tester.htm for a list of required values.
* By "quotation" we mean the display to the customer showing process before the customer commits to final purchase
* You should do the same for VAT if you need it collecting although you should be able to calculate and display this ideally
* Always make clear on the final page after a realtime sale how the charge will appear on their credit card (Use the soft_descriptor parameter passed back from Swreg
* If you receive your own payments from us via BACS or UK cheque the currency value returned by us will be in GBP otherwise USD - ONLY FOR REALTIME TRANSACTIONS - for non-realtime transactions (i.e., by fax) the result will be in USD.
* You can send out a string to our server from a cgi program or directly from a web page. You will always need the response to be sent to a cgi program at your end in order to select the correct response for your customer. If you are using the same cgi program to both send the string and receive the response you do not use the Return Address variable and can leave it set as ra= but if you are transmitting straight from a web page form or need the result to be sent to a different cgi program you will need to use the value ra=.
* Please make data in the State field compulsory if USA entered as the country.
* Payment options are (1) Realtime credit card (2) By Fax - credit card (3) By Phone - credit card (7) Purchase order by ACH if in USD/CAD, by EFT if in EUR/CAD or by BACS if in GBP. (8) Purchase order by Wire and (9) Purchase order by cheque/check, (10) Purchase order by Local Wire.
* IMPORTANT: In order to send us secure strings you must have LWP (libwww-perl) and Crypt-SSLeay installed in your Perl setup on your server. Ask your ISP to install those modules. These are common modules installed on many servers, it shouldn't cost you anything. It takes a couple of minutes at the ISP.
* How to handle error 21 "Call Authorisation Centre". Please display text similar to that at http://swreg.org/call_auth_centre.htm
* Error 22 comms failure. I suggest thanking them for the order, "there has been a communications problem with their bank but we will try again each hour until completed at which point you will receive an emailed receipt. Please do not attempt to re-order. Any queries please click here but please allow a couple of hours before writing in."
* On your Submit button in giant letters flashing with neon nymphettes please show something like "WARNING: ONLY PRESS ONCE OR YOU MAY BE CHARGED MORE THAN ONCE. IT CAN TAKE UP TO 2 MINUTES TO PROCESS YOUR CARD" In fact it only takes a few seconds but people are impatient and if they click twice the first pipe is broken so even we cannot tell if the card has been charged. This is a classic e-commerce problem. One solution is to issue a serial number with each page that has the final Pay Now button on it. When the page is clicked the serial number is passed back to your cgi that ignores any but the first click.
* Create a system to identify double clicks and ignore them - see the bit about serializing served web pages above paragraph.
* Diner's Club has a 4% surcharge automatically added to the customer's bill due to their higher commission rates.
* SUPPORT: We cannot give programming advice - the samples are to show you how it can be done but that is just one way - you are welcome to adapt the sample code given above - but we are happy to give general implementation advice by clicking here

VAT Issues

You must assume that the local VAT rate will be added to any EU shipping address order - that includes any $3 manual processing fees. You can call a cgi called vnv.cgi to determine the VAT rate. There are some instructions at :-

http://usd.swreg.org/vnv.htm

Please list on the receipt as:

* Price
* VAT @ member state rate
* Total

As part of the address you will need to collect the customer's VAT number. It must be in the format of two letters and a series of numbers (max 15 characters) i.e. GB445812740 in that format. If the customer enters a VAT number, you must pass it to c.cgi in the vn= parameter. You can use the vnv.cgi module to validate the VAT number is in an acceptable format.

If this field is completed, and the customer is not in the EU please make the following information available on the receipt page - and possibly prior to order completion if you feel it may help.

Sold by:

SWREG Inc.
9625 West 76th Street
Eden Prairie, MN 55344
USA

Our VAT Reg. # EU826011714
Your VAT #: FR123456789

"If you are a company within the European Union and did not provide or do not have a VAT number, you can obtain the VAT refund from your taxing authority provided you are VAT exempt. We are unable to refund the VAT tax from a completed order."

A list of country names we accept is available by grabbing the from the following URL :-

https://usd.swreg.org/cgi-bin/s.cgi?s=43387&p=433871&v=0&d=0&q=1&t=

Additional Information

* NEW: Dynamic soft descriptors. We now support dynamic soft descriptors based on the the items the customer ordered. We are passing this information back to you in return query string from the advanced level API. You set the option in the "Author Details." to determine what we should base the soft descriptor on.
* We have added a variable for the 3-number CVV2/CSC field, the number on the back of the credit card. It is 'csc=nnn' (lower case)
* We have updated the variable vt=n to your cgi call to prevent us duplicating orders from yourself. You give each order a unique token up to 30 characters. This will ensure that we will not allow an order to be repeated if we have already logged an order with the same token.

You can also interrogate https://usd.swreg.org/cgi-bin/token2order.pl with three arguments sent as a post (You cannot send as a GET): shop_id (your store number), token_id, and password. The password is specified by you through your author details via the new "Automated calls" password field.

Results are sent as plain text. Each result name/value pair is on its own line: Name/value pairs: StatusCode StatusMessage TokenId OrderId ErrorCode

Here are two call examples: perl and html.
* You can stop people being careless selecting the wrong country with a scroll mouse with the following code:


l

* You can generate printable receipts by following the instructions listed here
* Please have your PayPal customers order using our Intermediate Level as we have too many problems via Advanced Level. Or drop PayPal completely.
* New variable is vp for Variable Pricing. (Gets returned to the keycode generator as pp for price and pv for VAT amount).
* New variable rc for Redemption Code. If 'Merchandising' is enabled for your shop, use this field to pass a Coupon or Promotional URL Code.

Google Checkout Integration for PHP

Google Checkout Integration for PHP

What is Payment Gateway integration?

A payment gateway can be defined as a third party service, which is a combination of hardware and software that provides an interface to the bank credit card processing network. The credit card information is collected and is transferred over the Internet to the credit card processors in the encrypted format for transaction purpose. Some well-known payment gateways are AuthorizeNet, Google Checkout, USAePay, Verisign and Paypal.
What is google checkout?

* Using Google checkout buying from stores across the web becomes simple and also facilitates you to keep track of all the orders.
* The Google Checkout's fraud protection policy protects you against all the unauthorized purchases made via Google Checkout. Another advantage is that the Google Checkout does not share the history of the purchasers with other sellers.
* With Google checkout your email is well protected and is kept confidential. Tracking down your purchase history list is also simple.

Methods to Integrate with Google checkout:
Google checkout Provides three different types of integration methods

google_checkout_integration_for_php Buy Now Buttons (Provided by Google Checkout).
google_checkout_integration_for_php Valid eCommerce Partners.
google_checkout_integration_for_php Google Checkout API (Code Integration with Google Checkout).


1) Buy Now Buttons

If you do not require the shopping card functionality, you can simply integrate with Google Checkout using the Google checkout Buy Now buttons. You can have these buttons be displayed next to the products you are selling by just adding the Google checkout's HTML code to your website. Visitors/Buyers who click this button will be automatically directed to the secure Google Checkout page where they can complete their purchase.
Integration requirements: You have a working knowledge of your website's HTML.

2) eCommerce Partners

If your shopping card application is being provided by one of the Google checkout's partners, you can simply integrate your shopping cart and order processing functionalities with Google Checkout.

Integration requirements: You have a shopping cart provided by an valid eCommerce partner.
3) Google Checkout API
Integrating our website which has shopping cart and order processing system via the Google Checkout API (Sample Codes) is a simple process.
The Google Checkout API is available in the following Codes:

* ASP (Active Server Pages)
* .Net (Visual Studio .Net)
* PHP (Hypertext Preprocessor)
* Java 1.5
* Java 1.4


Integrating with Google checkout by using the Google Checkout API with PHP can be seen in the Sample Code. You can download the Sample code provided by the Google Checkout API (PHP) from here » PHP Sample Code.

**Before going to use the Sample code provided by Google checkout you need to check the following configuration settings are available in your PHP server.

* PHP Version- PHP v4.3.0 or later (But Not greater or equal to PHP 5.0, because Current Google checkout API codes supports only the Lower versions of PHP 5.0).
* CURL - libcurl v7.9.0 or later libcurl is an implementation of CURL (PHP supports libcurl, that allows you to connect and communicate to many different types of servers by using different protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols), which allows you to send XML over HTTPS using server-to-server HTTP POST requests.
* libxml-2.4.14 or later. libxml installs a DOM XML library (This Dom XML library is used to parse and construct the XML Messages).


Some Important PHP Library Files provided by the Google Checkout

* GlobalAPIFunctions.php - This library contains functions that are used to communicate with multiple Google Checkout APIs.
Some Important Functions are
1. GetMerchantID - The GetMerchantID function returns your Google Checkout merchant ID ( You can get this Merchant ID by Registering as a Merchant with the Google Checkout).
2. GetMerchantKey - The GetMerchantKey function returns your Google Checkout merchant key ( You can get this Merchant key by Registering as a Merchant with the Google Checkout)
3. CalcHmacSha1 -The CalcHmacSha1 function uses a checkout shopping cart XML file, which contains information about an order, and your merchant key to compute a cryptographically secure HMAC-SHA1 value
4. SendRequest - The SendRequest function verifies that you have provided values for all of the parameters needed to send a Google Checkout or Order Processing API request.
* ResponseHandlerAPIFunctions.php - This library contains functions that handle synchronous responses that Google Checkout sends in response to your API requests. Some Important Functions are
1. ProcessXmlData - The ProcessXmlData function creates a DOM object representation of the XML document received from Google Checkout.
2. ProcessRequestReceivedResponse - The ProcessRequestReceivedResponse function receives a synchronous Google Checkout response to an API request originating from your site.
3. ProcessErrorResponse - The ProcessErrorResponse function receives a synchronous Google Checkout response to an API request originating from your site.
* CheckoutAPIFunctions.php - This library contains functions for systematically building XML documents that can be included in Google Checkout Checkout API requests Some Important Functions are
1. CreateItem - The CreateItem function constructs the XML for a single in a shopping cart(Here we have to list our each products as a item).
2. CreateShoppingCart - The CreateShoppingCart function constructs the XML for the element in a Checkout API request.
3. CreateCheckoutShoppingCart - The CreateCheckoutShoppingCart function returns the XML structure, which contains all of the items and checkout-related information for an order.

The Screen Shots for the Google Checkout Integration For an Online Event Registration

* Your Cart
* Sign in to Google Checkout
* Review & Place Your Order
* Thanks Page


A Sample Shoping Cart with Google Checkout Button
Your Sample Cart Page
cart

Return top


After Pressing the Google Checkout Button, You will get the Following Sign in Page

Sign in to Google Checkout

In This below page you can view two different items
1) The Event name (The event which you need to book online)
2) The Service Charge (The Service Charge Amount for the Particular Event Ticket)
In this Page if you are an already existing user, You will given your Email address as user name and your password to login into the Review & Place the Order page.
Else you will have a provision to enter your Credit card details and need to create an account with the Google checkout.
place_order


Return top


After Successful Register/Sign up You will get the Following page

Review & Place Your Order

In This Review & Place order page you will confirm your Order details and Place your order. After the Successful Placement of order, A copy of your order will be emailed to the Merchant and also a copy to the person who place the order.
An Additional feature available in the Google Checkout is an copy will be stored in your Purchase history list.
confirm_order


Return top


Thanks Page
After Pressing the Place order button you will get the following page
google checkout


Return top


Vital Informations needed to Configure the Google Checkout **

1. PHP Version- PHP v4.3.0 or later
2. CURL - libcurl v7.9.0 or later
3. libxml-2.4.14 or later.
4. SSL Certificate** - If you are an merchant, and needed to calculate the Order Status after the Order Placement means you need to Install SSL Certificate (Secure Socket Layer,This is a certificate which is installed on a secure server. It is used to identify the merchant using it and to encrypt the credit card) in your server and place a php file to Capture the Response from the Google Checkout.



Sample Merchant Calculation Coding to Capture the Response Acknowledgement from the Google Checkout for the Every order.
// Retrieve the XML sent in the HTTP POST request to the ResponseHandler
$xml_response = $HTTP_RAW_POST_DATA;
Get rid of PHP's magical escaping of quotes
if (get_magic_quotes_gpc()) {
$xml_response = stripslashes($xml_response);
// Capture the Return Response XML from the Google Checkout.
fnWriteXml($xml_response);
}
function fnWriteXml($string){
$file="ssl_return.txt";
if(file_exists($file)) {
$fileid = fopen($file,"a");
$strmsg = "";
$strmsg.= "***************************************************\r\n";
$strmsg.=$string;
$strmsg.="\r\n***************************************************\r\n";
fwrite($fileid,$strmsg);
fclose($fileid);
}else{
$fileid = fopen($file,"a");
$strmsg = $string;
fwrite($fileid,$strmsg);
fclose($fileid);
}
}

By Downloading the file ssl_return.txt you will get the Response XML From the Google Checkout.Parse the Response XML, according to your needs and manipulate the Merchant Calculation Codings.
Functional Definitions :

stripslashes - Returns a string with backslashes stripped off.(\' becomes ' and so on.) Double backslashes are made into a single backslash.

get_magic_quotes_gpc() - Gets the current active configuration setting of magic quotes.

fopen - This key word is used to open the specified file in the Specified server path
If the open fails, the function returns FALSE.
for Example : fopen("sample.txt","a");
Here the First argument is the File name and the second one is the File open mode type. Some of the File open mode types are('r'-Read only, 'r+'- Reading & Writing, 'w'- Writing only, 'w+' - Reading & writing,'a'- Append writing only,'a+'- Reading & Append Writing only)
file_exists- Returns TRUE if the file specified by filename exists; else it returns FALSE.

* This function will not work on remote files;

fwrite - it writes the contents of string to the file stream pointed to by fp. If the length argument is given, writing will stop after length bytes have been written or the end of string is reached, whichever comes first.

fclose - The file pointed to by fp is closed. Returns TRUE on success, FALSE on failure.

Google Checkout Using PHP

Using Google Checkout....

Google requires the page that is used to monitor the notifications returned from Google is https. If you donot have https on your server, you cannot monitor the notifications from Google. However, you can still use Google Checkout with PHP-KeyCodes but it will work slightly different.

Using PHP-Keycodes without https

When a customer clicks on the Google checkout button, the next licence code is read from the database, and the database is updated to remove that licence code.

The customer then makes a purchase through Google Checkout and if the credit card is correctly authorised, the customer will see the purchased licence code in their Google Checkout account. The customer can also see the licence code at any time by logging back into their Google Checkout account and going to Purchase History.

If the customer fails to make the purchase, the licence code is not displayed to the customer. Also, because there is no notification back to your site, PHP-KeyCodes does not know that there has not been a purchase and hence the database will contain the licence codes, less the one that she attempted to purchase.

Using PHP-Keycodes with https

When a customer clicks on the Google checkout button, the next licence code is read from the database, but the database is not updated to remove that licence code at this point.

When the customer makes a purchase through Google Checkout and the credit card is correctly authorised, the customer will see the purchased licence code in their Google Checkout account and going to Purchase History. The customer can see the licence code at any time by logging back into their Google Checkout account. At this point, Google sends a notification back to your web site and this is used by PHP-KeyCodes to remove the licence code from the database. Only when the applcation receives the correct notification from Google will the database be updated to reflect the purchase.

If the customer fails to make the purchase, the licence code is not displayed to the customer and the database still contains the purchase code that she attempted to purchase.
The Google responsehandler.php

The Google reponse handler is located in the folder 'google_response_handler'

The url of the responsehandler is :
https://www.yoursite.com/phpkeycodes/google_response_handler/responsehandler.php

which assumes that the application has been installed in the phpkeycodes folder.

NOTES :

If do not get call backs with responsehandler.php first check what happens if actually enter :
https://www.yoursite.com/phpkeycodes/google_response_handler/responsehandler.php

in your browser. You should get the page asking for a username / password. If you get an internal server configuration error try moving the response handler to a separate folder.
Log file testing of responsehandler.php notifications

A handy way of testing the notification messages from Google is by logging the notifications into a text file on your server.

To do this, open /google_response_handler/responsehandler.php in a text editor and find the following :
//---------------------------------
//Added to log data
//A file called log.txt will appear at the root of the application folder
// $f = fopen(dirname(FILE)."/log.txt", "a+"); fwrite($f, "\nROOT:\n".$root."\nData:\n".print_r($data, true)); fclose($f);
//---------------------------------

Uncomment the $f line

Don't forget to change permissions to 777 on the folder to get the log files.
Creating a Google Account

If you have not created a Google account go to :

http://www.google.com/accounts/

and create a new account which will be used by you to sell items.

Go to your account at https://checkout.google.com/sell/orders

After signing in, click on the Settings tab. Then click on the Integration link on the left side of the page. Your 10- or 15-digit Merchant ID and your Merchant Key will both be listed under the Account information header. You need both of these codes which you enter in the Google Setup admin section of PHP-KeyCodes. Also, you need to tick the check box to identify if you are using SSL which is on the same admin page.

In the Settings tab ensure that the tick box 'Shopping trolly post security' is ticked (this is ticked by default).

PHP-KeyCodes can operate with out SSL (called Level 1 integration by Google) or with SSL (called Level 2 integration by Google) which provides the ability for your site to be notified of new orders that you receive.

If you have an SSL certification, you have to set up the url of the response handler which is done as follows :

* Click on 'My Sales' in the top left hand corner of your google account.
* Click on the Settings tab.
* Click on the Integration link
* Enter the API callback URL and a call back method of XML.

The url of the responsehandler is
https://www.yoursite.com/phpkeycodes/google_response_handler/responsehandler.php

which assumes that the application has been installed in a folder called phpkeycodes.
Creating a Sandbox Google Account

PHP-Keycodes is able to use the Google sandbox system for testing.

First create a buyer account at http://sandbox.google.com/checkout, using a credit card of 4111-1111-1111-1111.

Then create your merchant, seller accout at http://sandbox.google.com/checkout/sell/ again using a credit card of 4111-1111-1111-1111.

You should find your 10- or 15-digit Merchant ID and your Merchant Key listed under the Account information header. You will need these when you do testing in the PHP-Keycodes admin pages.

If you are using SSL, don't forget to add in your integration responsehander url in the same way as for your live account.
Testing with Google Sandbox

To do a sandbox test with Google, you have to enter the Merchant ID and Merchant Key into the Google set up admin page of PHP-Keycodes replacing the live key codes. You also have to tick the checkbox to say show that you are using the sandbox system.
Digital delivery buyer expericence :

You may find this link helpful in understanding some of Google concepts
Google notifications

Google says :

Before you ship the item in an order, you should ensure that you have already received the 'new order notification' for the order, the 'risk information notification' for the order and an 'order state change notification' informing you that the order's financial state has been updated to CHARGEABLE.

This means that the credit card has the facility to be Charged and when you log in to your account you click on CHARGE for that item and the credit card amount is processed.

PHP-KeyCodes monitors these notifications from Google and only when the above are received correctly will it process the transaction.
Issues to do with currency and Google Checkout

Google Checkout is currently designed to process transactions in either U.S. Dollars or Pounds Sterling. If your business address is in the U.S., your customers will be charged in USD; if you're located in the U.K., your customers will be charged in GBP.

Customers in all countries where Google Checkout is available can purchase from your site. While their purchases will always be processed in the currency matched to your address, the buyers' credit cards will usually provide seamless currency conversion. You can check the 'Location' drop-down menu on the sign-up page, located at https://www.google.com/accounts/NewAccount