Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
2checkout.com (version 2) Subscription Option Details »»
2checkout.com (version 2) Subscription Option
Version: 1.00, by kall kall is offline
Developer Last Online: Aug 2021 Show Printable Version Email this Page

Version: 3.0.3 Rating:
Released: 08-09-2004 Last Update: Never Installs: 10
 
No support by the author.

Need to give your members the option of paying through 2checkout.com?

This is the modification for you.


It works just like the currently offered payment gateways...you choose 2checkout as an option in the Paid Subscriptions section of your Admin CP, enter your 2checkout id number, and you are good to go.

Members will be diverted to the 2checkout secure payment page, once the transaction is confirmed, 2checkout tells your vb (through a new php file in /subscriptions), and the automatic subscription process goes ahead.

Addendum: This works for Version 2 of 2checkout.com.

This was originally going to be 'sold' to people who wanted it, but I'll just post it here and if anyone feels like rewarding me, there's a paypal addy at the end of the .txt

Update: 12/11/2004: Changed the variable from 2co to checkout. Not really a big change.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-14-2004, 03:27 AM
fastforward fastforward is offline
 
Join Date: Oct 2001
Location: NC, USA
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

kall,

Can you share the version for 2checkout 1 users please?

Many thanks
Reply With Quote
  #13  
Old 08-14-2004, 05:09 AM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by fastforward
kall,

Can you share the version for 2checkout 1 users please?

Many thanks
I'm sorry...I don't know what that would be.

Somebody sent me a list of variables that it asks for, but these are the same variables I used to create this hack for version 2.

As I can't actually get access to version 1 (as they aren't giving it to new users), I can't test it I'm afraid.
Reply With Quote
  #14  
Old 08-14-2004, 06:31 PM
nick_1 nick_1 is offline
 
Join Date: Jan 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll see about getting my version written up for 2checkout 1. I've had it running ages but haven't had time to sort it out.

The basis of the hack was simply to replace the authorise.net payment code a modification which points at 2co's payment gateway. They are quite similar but not a perfect replacement so i duplicated much of the code.

As far as i remember the main changes were in includes/functions_subscriptions.php This is what i did...

find:
PHP Code:
 // ######################## Define payment bits ###################
$_SUBSCRIPTIONS['methods'] = array(
    
'paypal'    =>    1,
    
'nochex'    =>    2,
    
'worldpay'    =>    4,
    
'authorize'    =>    8,
); 
Replace with:
PHP Code:
 // ######################## Define payment bits ###################
$_SUBSCRIPTIONS['methods'] = array(
    
'paypal'    =>    1,
    
'nochex'    =>    2,
    
'worldpay'    =>    4,
    
'authorize'    =>    8,
    
'2checkout'    =>    16
); 
Find:
PHP Code:
// ######################## Define supported curencies ###################
$_SUBSCRIPTIONS['curencies'] = array(
    
'paypal'    =>    array('usd' => true'gbp' => true'eur' => true),
    
'nochex'    =>    array('gbp' => true),
    
'worldpay'    =>    array('usd' => true'gbp' => true'eur' => true),
    
'authorize'    =>    array('usd' => true'gbp' => true'eur' => true)
); 
Replace with:
PHP Code:
// ######################## Define supported curencies ###################
$_SUBSCRIPTIONS['curencies'] = array(
    
'paypal'    =>    array('usd' => true'gbp' => true'eur' => true),
    
'nochex'    =>    array('gbp' => true),
    
'worldpay'    =>    array('usd' => true'gbp' => true'eur' => true),
    
'authorize'    =>    array('usd' => true'gbp' => true'eur' => true),
    
'2checkout'    =>    array('usd' => true)
); 
Find:
PHP Code:
        case 'authorize':
            
$form construct_authorize_form($cost$item$currency);
            break; 
Add below:
PHP Code:
        case '2checkout':
            
$form construct_2checkout_form($cost$item$currency);
            break; 
This is my replacement of construct_authorize_form() add to the bottom of the file.
PHP Code:
function construct_2checkout_form($amount$id$currency 'USD')
{
    global 
$vboptions$authorize_txnkey;

    
$sequence vbrand(11000);
    
$fingerprint hmac($authorize_txnkey$vboptions['authorize_loginid'] . '^' $sequence '^' TIMENOW '^' $amount '^' $currency);
    
$timenow TIMENOW;

    
$id .= "_$currency";

    
//$form['action'] = 'https://secure.authorize.net/gateway/transact.dll';
    
$form['action'] = 'https://www.2checkout.com/cgi-bin/Abuyers/purchase.2c';
    
$form['method'] = 'post';
    
$form['hiddenfields'] = <<< HTML
    <input type="hidden" name="x_fp_hash" value="$fingerprint" />
    <input type="hidden" name="x_login" value="
$vboptions[authorize_loginid]" />

    <input type="hidden" name="x_amount" value="
$amount" />
    <input type="hidden" name="x_currency_code" value="
$currency" />
    <input type="hidden" name="x_invoice_num" value="
$id" />
HTML;
    return 
$form;

I'm sure 2co should accept more variables than that but thats all it seems to accept for me. Also, 2co ignores your currency code so don't change the code to allow other types of currency. I have actually used the same authorize_txnkey for both 2co and authorize.net payments but you might wish to change this to improve security.

Once thats all done set the shopping cart preferences in your 2co admin panel to point back at the authorize.net payment page which will accept the payment correctly (/subscriptions/authorize.php). Try it out in test mode with garbage card numbers to check it all works and you should find its working nicely.

I hope this helps, it was rather important to my site as we were trying to improve our payment system after using a poorly intergrated one.

Nick
Reply With Quote
  #15  
Old 08-15-2004, 12:03 AM
fastforward fastforward is offline
 
Join Date: Oct 2001
Location: NC, USA
Posts: 399
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello nick,

I've got 2checkout accepting payments using your code. Many thanks.

One question. If your 2checkout account is in test mode, should it return valid codes and should the vb account be upgraded? My authorize.php is simply displaying a white page when it returns. There are no parse errors, so I'm guessing it's hitting one of the exit; statements.

Thanks again for your help.
Reply With Quote
  #16  
Old 08-15-2004, 01:34 AM
zajako's Avatar
zajako zajako is offline
 
Join Date: Jan 2002
Location: a place not to far away
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i have a problem with this,

what do i do for the settings for the button to appear, basicaly what im asking is how to set it up to actualy work, you provided the edits for the functions_subscriptions page but i cant get the propper button to display.

can you edit kall's txt file to make it be specific for the other edits needed to work?
Reply With Quote
  #17  
Old 08-15-2004, 04:22 AM
kall's Avatar
kall kall is offline
 
Join Date: Apr 2004
Location: New Zealand
Posts: 2,608
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by zajako
can you edit kall's txt file to make it be specific for the other edits needed to work?
If my permission is needed, you have it in full.

Reply With Quote
  #18  
Old 08-15-2004, 08:40 AM
nick_1 nick_1 is offline
 
Join Date: Jan 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It seems i made changes to subscriptions/authorize.php after all. This is my replacement one:

Find:
PHP Code:
$check_hash strtoupper(md5($vboptions['authorize_loginid'] . $_POST['x_trans_id'] . $_POST['x_amount']));

if (
$check_hash == $_POST['x_MD5_Hash'] AND $_POST['x_response_code'] == 1
Replace with:
PHP Code:
$check_hash strtoupper(md5($authorize_txnkey $vboptions['authorize_loginid'] . $_POST['x_trans_id'] . $_POST['x_amount']));

if (
$check_hash == $_POST['x_MD5_Hash'] AND $_POST['x_response_code'] == 1
Also to get text on the button you need to add a phrase, I believe adding a global phrase named 2checkout containing the word 2checkout will do the job.

I hope thats it.

Nick
Reply With Quote
  #19  
Old 08-15-2004, 12:02 PM
zajako's Avatar
zajako zajako is offline
 
Join Date: Jan 2002
Location: a place not to far away
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

umm my authorize.php doesnt have those lines.... it has this instead...

PHP Code:
$check_hash md5($authorize_secret_key $_POST['x_trans_id'] . $_POST['x_amount']);

if (
$check_hash == $_POST['x_MD5_Hash']) 
Reply With Quote
  #20  
Old 08-29-2004, 09:30 PM
arfan arfan is offline
 
Join Date: Aug 2004
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey lol sorry im newbie does this work with VB 3.03?
Reply With Quote
  #21  
Old 08-29-2004, 09:31 PM
arfan arfan is offline
 
Join Date: Aug 2004
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

MY bad lol im soo stupid didnt read top, got confused with version 2 thing sorry my bad!
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 01:53 PM.


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.07577 seconds
  • Memory Usage 2,357KB
  • Queries Executed 25 (?)
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
  • (10)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete