Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Add Google Checkout to Paid Subscriptions Details »»
Add Google Checkout to Paid Subscriptions
Version: 1.01, by CaseLogic CaseLogic is offline
Developer Last Online: May 2013 Show Printable Version Email this Page

Category: Major Additions - Version: 3.8.x Rating:
Released: 08-30-2010 Last Update: 09-04-2010 Installs: 26
DB Changes Uses Plugins Auto-Templates
Additional Files  
No support by the author.

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

Download Now

File Type: zip product-gcheckout-1.01.zip (4.1 KB, 202 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
PHILIPS-08

Comments
  #12  
Old 09-05-2010, 05:36 PM
CaseLogic CaseLogic is offline
 
Join Date: May 2008
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #13  
Old 09-05-2010, 05:53 PM
CaseLogic CaseLogic is offline
 
Join Date: May 2008
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by whitey06 View Post
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
I just updated to version 1.01 which replaced that mysql call with vB's version. See how that works for you and then get back to me
Reply With Quote
  #14  
Old 09-06-2010, 05:39 PM
whitey06 whitey06 is offline
 
Join Date: Sep 2006
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:
$templater vB_Template::create('subscription_payment_gcheckout');
            
$templater->register('cost'$cost);
            
$templater->register('currency'$currency);
            
$templater->register('item'$item);
            
$templater->register('no_shipping'$no_shipping);
            
$templater->register('settings'$settings);
            
$templater->register('subinfo'$subinfo);
            
$templater->register('timeinfo'$timeinfo);
            
$templater->register('userinfo'$userinfo);
        
$form['hiddenfields'] .= $templater->render(); 
Also for anyone that uses it, only use it for the currency that your checkout account allows, i.e. USD for US & GBP for UK.

But all in all, great mod and much needed in VB
Reply With Quote
  #15  
Old 09-06-2010, 07:42 PM
CaseLogic CaseLogic is offline
 
Join Date: May 2008
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by whitey06 View Post
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:
$templater vB_Template::create('subscription_payment_gcheckout');
            
$templater->register('cost'$cost);
            
$templater->register('currency'$currency);
            
$templater->register('item'$item);
            
$templater->register('no_shipping'$no_shipping);
            
$templater->register('settings'$settings);
            
$templater->register('subinfo'$subinfo);
            
$templater->register('timeinfo'$timeinfo);
            
$templater->register('userinfo'$userinfo);
        
$form['hiddenfields'] .= $templater->render(); 
Also for anyone that uses it, only use it for the currency that your checkout account allows, i.e. USD for US & GBP for UK.

But all in all, great mod and much needed in VB
good call, I forgot that vB4 changed their template formats

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)
Reply With Quote
  #16  
Old 09-07-2010, 02:24 PM
whitey06 whitey06 is offline
 
Join Date: Sep 2006
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #17  
Old 09-07-2010, 02:33 PM
CaseLogic CaseLogic is offline
 
Join Date: May 2008
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by whitey06 View Post
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.
Unfortunately I couldn't immediately figure out the shipping thing. Even when marked as digital, it still tries to go through the shipping process and I'm not familiar enough with GC to get around that.

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.
Reply With Quote
  #18  
Old 09-07-2010, 03:51 PM
whitey06 whitey06 is offline
 
Join Date: Sep 2006
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #19  
Old 09-08-2010, 11:35 PM
CaseLogic CaseLogic is offline
 
Join Date: May 2008
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by whitey06 View Post
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.
I'm currently out of town on business travel, so my response time will be a noticeably slower the next few days.

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.
Reply With Quote
  #20  
Old 09-09-2010, 08:01 AM
whitey06 whitey06 is offline
 
Join Date: Sep 2006
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by CaseLogic View Post
I'm currently out of town on business travel, so my response time will be a noticeably slower the next few days.

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.
Ive checked the page source and it is as u say "item_merchant_id_1", the only thing that ive edited is the code in the class php file. I re-uploaded your file without the modifications and apart from the template error code:
PHP Code:
Warningfetch_template() calls should be replaced by the vB_Template class. Template namesubscription_payment_gcheckout in [path]/includes/functions.php on line 3893 
It all works the same way and goes straight through the process but just doesnt change the usergroup at the end of it.

Thanks for the replies.
Reply With Quote
  #21  
Old 09-09-2010, 10:12 PM
CaseLogic CaseLogic is offline
 
Join Date: May 2008
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by whitey06 View Post
Ive checked the page source and it is as u say "item_merchant_id_1", the only thing that ive edited is the code in the class php file. I re-uploaded your file without the modifications and apart from the template error code:
PHP Code:
Warningfetch_template() calls should be replaced by the vB_Template class. Template namesubscription_payment_gcheckout in [path]/includes/functions.php on line 3893 
It all works the same way and goes straight through the process but just doesnt change the usergroup at the end of it.

Thanks for the replies.
under the failure log where you see the error code, look for that same key (item_merchant_id_1) and see if it has anything that makes sense (random numbers, letters, and dashes that is like 20-30 characters long)

invalid subscription ID means that google checkout and my API are not correctly exchanging that hash back and forth that identifies the exact transaction
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 12:21 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06361 seconds
  • Memory Usage 2,373KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_php
  • (6)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete