![]() |
Add Google Checkout to Paid Subscriptions
1 Attachment(s)
This is my first released mod, so please rate!
This modification will allow you to use Google Checkout as a payment processor for paid subscriptions. Google Checkout Steps -Under Settings->Preferences, select the option to automatically authorize and charge -Under Settings->Integration, uncheck the digitally signed cart box -For the API Callback URL, enter in the following: http://path to your forum/payment_gateway.php?method=gcheckout -Select the Notification Serial # method -Select API version 2.5 (do NOT check the notification filtering checkbox!) -Note your Merchant ID and Merchant Key on the right-hand side (will need for below) vBulletin Steps -Upload class_gcheckout.php to <forum base>/includes/paymentapi -Install product -Under Paid Subscriptions->Payment API Manager->Google Checkout, enter in the merchant ID and key found under your Settings. -Activate Google Checkout payment API -Optionally run "Test Communication" under Paid Subscriptions to ensure successful setup and integration Known Issues -Incorrect operation on 32bit systems! (found 12/14/2010) -Only works with curl installed -Chargeback handling not implemented yet Release notes 1.01 -Replaced mysql_ function in install code with vB SQL wrapper 1.0 - Original version |
I'm willing to bet this will work in vb4 with little to no modifications, but I can't say for sure! Let me know if anyone tries...
edit: I forgot templates are different, so see this post |
Quite awesome mate. Very useful feature (should've been built in).. Gonna test this out on vb4.. crossing my fingers.
|
Thanks!
|
How could 3 people have installed this with only 1 download so far?
Quote:
|
Quote:
|
Quote:
|
i followed everything but all i get is;
Oops! We were unable to process your request. Time when the error happened: 2010-09-04T11:53:58 (UTC) (48f6db3d54788) |
is that when you are going to the google checkout cart? at what stage in the process is it giving you this error?
|
1 Attachment(s)
Nice mod, have been looking for this but when installing it in VB4 get these msgs in the attached screenshot. Then when the page has reloaded, after going into the google checkout options, it doesnt give me the option to input the merchant ID or merchant key
|
yeah the code that it is trying to execute is inserting google checkout into the vB API. The error is coming from mysql_real_escape_strings, which is throwing an access denied error (commonly because there isn't a valid mysql connection).
First thing I would is uninstall (assuming it installed the product despite the error), then reinstall. It's possible it was a fluke with mysql, although not really likely. I will look into replacing that function with the appropriate vB wrapper |
Quote:
|
Ok installed and all working now, that did the trick, dont see any issues, did communication test and all was good :)
Forgot to mention in my last post that for VB4, the template fetch command in the php file needs changing to the correct format or an error message comes up on the subscriptions page, I replaced it with the following: PHP Code:
But all in all, great mod and much needed in VB :D |
Quote:
thanks for the code, I'll have to add it into a vb4 version for the future (I don't have a vb4 forum to test it on right now unfortunately) |
Ive actually now encountered a problem. I was originally using the Buy Now Buttons and had the product as a digital product and was adding my users manually to the paid subscriptions but now when they are purchasing, its completing the order but then telling me I have to ship the order when the order is Digital so no shipping is required, also it is not changing the usergroup of the customer upon completion of the order.
Its showing up in the transaction stats but not for an individual subscription. Hope that makes sense and you can help me out with this. |
Quote:
However, the vB Payment API reacts to the 'charge' process, and should be adding the paid subscription successfully once it's charged. The ship state has no impact to the paid subscription. So if you go into transaction log, are you seeing the date, the correct user, and a successful charge? Or is it showing Failure? If it is showing that it Charged, that means everything went through successfully and beyond that, VB Core API is taking over (so my code doesn't impact that). I would make sure your paid subscription is setup correctly to move them to the right usergroup. |
Ok ive now just checked and the log is now showing as failure for the subscriptions that have been purchased.
When clicked on failure its giving me the transaction details with 3 different sub categories: API: VB error code - Invalid subscription ID Get: Method - Google Checkout Post: Shows all details of the transaction My paid subscription is set up correctly as I use another method on them aswell which works 100% fine and have used many others. |
Quote:
The first thing I would check is to verify that your template is properly using all the variables, notably the $hash (which it is using to tie the checkout transaction to a user). My guess is that the variable is not properly registering in the template object, or there is a typo in the modified template (because I'm assuming you edited the code and template to support vb4). When you are on the page that says "Order now using Google Checkout", go look at the source and verify that the form input item "item_merchant_id_1" (or something similar, this is off memory) is being set properly. It should look like some random numbers and letters with some dashes in there. If it is blank or something obviously incorrect, I would say that is your issue. |
Quote:
PHP Code:
Thanks for the replies. |
Quote:
invalid subscription ID means that google checkout and my API are not correctly exchanging that hash back and forth that identifies the exact transaction |
Hi,
In the log in the admincp, there is the following: "order-summary_shopping-cart_items_item-1_merchant-item-id" And then its blank next to it. I think I have found the issue, when I use your php file from this thread, when looking at the page source on the "order using google checkout page", the "item_merchant_id_1" has a value of letters and numbers as you said, as soon as I edit the template part in the php file to enable it to function properly in VB4, the "item_merchant_id_1" value is then blank in the page source so I think it just needs the correct template class for VB4, the code that I am using mustn't be far away from it, just not quite right. EDIT: Ok ive now edited the template code so that the page source shows a value for "item_merchant_id_1". I'll keep a check on it and see how it goes and post my findings. |
Ok I can now confirm that the recent change I made has now worked and the plugin is now working, doing everything it should be :D
The code change I made was to the template part again and is as follows: PHP Code:
|
Quote:
|
Quote:
------------------------ No sorry im not using as it wont work for me.. Click on: Order Using Google Checkout Takes me to: https://checkout.google.com/api/chec...ant/2147483647 Error: Oops! We were unable to process your request. Time when the error happened: 2010-09-13T10:35:26 (UTC) (49021a792b5c8) I entered all my information correct.. Tbh i dont like it now. I'm clicking un-installed. |
Great plugin!!
Thank you for sharing. I really wanted to have an alternative to Paypal and now I have it. |
I am having an issue in the integration.
I followed the instructions. Created the GCheckout account. Added bank information/verified bank etc. Settings/Preferences - Automatically authorize and charge Settings/Integration - Not checked the digitally signed cart box - Typed (correctly) the callback URL - Selected the first option in the Serial # (I don't have https) - Selected API 2.5 In vBulletin I uploaded the class, installed the product and set up the merchant ID and merchant Key. I activated the gateway and tested the communication - all is OK. Now when I go with a test account to subscribe, I see the google checkout option. I click on it, go to the relevant page with my subscription and pay for it. In the Google Checkout account, I do see the charge, however it awaits for me to click the relevant button to make the order shipped. This is issue number 1. Even when I do click shipped, I do not see the order in the logs nor do I see the subscription activated through the callback.... I am somewhat baffled by this. Any help is appreciated. |
Quote:
if you are not seeing anything in the transaction logs, then google checkout is not communicating properly with vB. If there was an error in the communication, you'd still see that in the logs. Double- and triple-check the URL that google checkout is contacting. It should be your forum address/payment_gateway.php?method=gcheckout If that is correct, go to the Google Checkout Integration console (https://checkout.google.com/sell/set...grationConsole). See if there are any errors listed. Next, go to your transaction log verify the recent transactions (successful or otherwise). See if there are any listed errors for your recent GC transactions, anything at all being logged under gcheckout can be helpful Finally, the process isn't as instantaneous as paypal. It usually takes 5-10 mins on average, though. |
Hello CaseLogic,
Thank you for the prompt reply. The issue seems to be twofold. For starters Google did not authorize the transaction (even after 10-15 minutes). My credit card was being checked and that took more than 4 hours. In the end they did charge it successfully. Now something happened with the communication itself which I am going to try and assess looking at the logs as you suggested. Thank you again. I will keep you posted. |
Let me know so I can help you debug
|
1 Attachment(s)
Hello CaseLogic,
It appears that the issue was from Google's fraud detection department. It took them several hours to clear my credit card and my second test was successful. The communication with vBulletin is complete and I have enabled the modification for my forum. Two issues that I want to draw your attention to: 1. I have added the gcheckout_order_instructions phrase so as to display some information when one is presented with the Google Checkout button (follows the other payment apis) 2. In the class itself I have introduced the $_server variable which defaults to checkout.google.com. However you can if you wish set it to sandbox.google.com/checkout so that you can do some testing. I am attaching the changed files for your attention. Thank you again! |
Great I'm glad that it's working for you now.
I will keep your changes in mind. I've been meaning to update with a bit more functionality such as the bits you've included, but I've been too busy lately. Thanks again |
Quote:
|
Quote:
|
I heard somewhere on vbulletin.com native support for Google Checkout was coming soon for VB4. Might want to double check before you put in too much time.
|
I figured out the issue that some (or at least 1) person reported in this thread. There is a problematic intval() call in the form generation function. Merchant ID's are generally very large numbers. intval() is either a 32 bit or a 64 bit function, depending on the host. If it's a 32 bit system, it will max out and cap at the wrong value.
For those running into the "oops!" error, please fix the following line by removing intval: Code:
$form['action'] = 'https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/' . intval($settings['gmerchantid']); Code:
$form['action'] = 'https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/' . $settings['gmerchantid']; |
Quote:
|
thank you mate for the fix :)
|
Quote:
I'll wait for a mod (think it will happen sooner -vs- bulletin.com) |
if someone can be kind enough to let me use their vB4 forum, I can update this for vB4 in an hour tops.
|
Quote:
|
All times are GMT. The time now is 05:46 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|