View Poll Results: Is it any good???

Voters
46. You may not vote on this poll
  • So-so

    5 10.87%
  • Yes

    39 84.78%
  • Piece of junk

    2 4.35%
Page 1 of 10 123 ... LastLast
Results 1 to 10 of 94

Thread: PayPal Module

  1. #1
    Join Date
    Jun 2004
    Posts
    8

    Default

    Hello everyone,

    Here's the PayPal module I wrote for OC. It allows to charge on per listing basis. All details are in readme.txt file which I'll also paste here. Mod was tested with PayPal sandbox only since my website is not fully deployed yet. Let me know if you find any bugs.


    ***README.TXT***

    ********************************
    PayPal Mod for Open-Realty v 1.0
    author - Mikolaj Zielinski
    ********************************

    1. Purpose

    This mod will allow to charge agents on per listing basis on OR site using PayPal service.
    It allows to set 2 different prices for Featured Listings (FL) and Regular Listings (RL).
    You may also specify amount of free promotional listings for new agent accounts (by changing
    default value on listing amounts for the agent's account).


    2. Installation

    2.1 Unzip orppmod.zip and upload the files to corresponding folders. Don't forget to BACKUP files.
    Package contents:
    -/include/language/english/paypal.php (language file)
    -/modules/paypal/ppbuy.php (for agent)
    -/modules/paypal/pphist.php (for agent)
    -/admin/module_admin/ppadmin.php (for admin)
    -/admin/add_listing.php (ask for type of listing before new record is added and checks
    if agent have listing of that type available)
    -ppinstall.php (database setup)
    -/modules/paypal/read_me.txt

    2.2 In /include/language/english.php add following line right after $lang = array();
    or in "//module language file includes" section if you have installed fullmod

    include("".$config[basepath]."/include/language/english/paypal.php");

    2.3 Open http://www.yoursite.com/ppinstall.php . It'll make all necessary changes to the database.

    2.4 Configure your menu for the agent and admin pages of the module.

    2.5 Open admin page and provide proper information (pricing, email account for PayPal, promotion)

    2.6 IMPORTANT : Edit Add Listing Form Template - remove Featured Listing field

    2.7 It might be also wise to set listings to expire after some time (3 maybe 6 months)


    3. Database changes

    3.1 UserDB - new fields will keep current amount of listings available for the agent
    added f_listing int(3)
    added r_listing int(3)

    3.2 billing_history - new table to keep purchase history
    id int(11)
    user_id int(11)
    order_date int(11)
    fl_amount int(3)
    fl_price float
    rl_amount int(3)
    rl_price float
    paid int(1)
    tempid varchar(20)

    3.3 charges - new table for price list
    id int(1)
    name varchar(60)
    price float

    two records added
    1, "Featured Listing", 25.00
    2, "Regular Listing", 20.00

    3.4 paypaladm - new table to store PayPal config info
    email varchar(100)
    free_fl int(2)
    free_rl int(2)
    Attached Files Attached Files
    Last edited by greengiant; 07-01-2004 at 08:24 PM. Reason: Restoring Mod Attachment from weekly backup.

  2. #2
    Join Date
    Sep 2003
    Location
    London UK
    Posts
    1,654

    Default

    Hi

    Thank you for this great mod..

    installed ok.

    when I get to
    ppbuy.php?
    and click but now it does not up date the database to go to
    the next stage.

    ?action=confirm&tid=$tempid>";

    so this part of the code ///

    <?php } else if ($action == "addorder") { ?>

    <table width='100%' border='0' cellspacing='2' cellpadding='2'>
    <tr>
    <td>
    <?

    //insert new order
    $priceF = mysql_fetch_array(mysql_query("SELECT price FROM ".$config[table_prefix]."charges WHERE id=1"));
    $priceR = mysql_fetch_array(mysql_query("SELECT price FROM ".$config[table_prefix]."charges WHERE id=2"));
    $date = getdate();
    $date = $date[0];
    $tempid = getmicrotime();

    $addOrder=mysql_query("INSERT INTO `".$config[table_prefix]."billing_history` ( `user_ID` , `order_date` , `fl_amount` , `fl_price` , `rl_amount` , `rl_price` , 'tempid') VALUES ( $userID , $date, $amount1, $priceF[price], $amount2, $priceR[price] , \"$tempid\" )", $db);



    if($addOrder) //if success goto confirmation
    {
    echo "<meta http-equiv=\"refresh\" content=5;URL=$PHP_SELF?action=confirm&amp;tid=$te mpid>";
    }
    if(!$addOrder) //else back to order entry
    {
    echo "$lang[admin_paypal_error_edit]";

    >>>>>>>>HERE IS WHERE it stops for me<<<<<<<<

    echo "<meta http-equiv=\"refresh\" content=5;URL=$PHP_SELF? >";
    }

    ?>

    <?php } else if ($action == "confirm") { ?>

    <table width='100%' border='1' cellspacing='2' cellpadding='2'>
    <tr>
    <td>

    ///

    Is not geting passed to the next stage.

    apart from that all is ok


    Al

  3. #3
    Join Date
    Jun 2004
    Posts
    8

    Default

    You got an error because I forgot to add tempid field in ppinstall.php . I have added it manually using phpMyAdmin. Here's the solution to your problem:

    Using phpMyAdmin add tempid varchar(20) field to billing_history table and script will work after that.

    Also I'll submit orppmod.zip with corrected ppinstall.php file for new installations.

    Once again guys sorry for this mistake.

  4. #4
    Join Date
    Sep 2003
    Location
    London UK
    Posts
    1,654

    Default

    Quote Originally Posted by zielit
    You got an error because I forgot to add tempid field in ppinstall.php . I have added it manually using phpMyAdmin. Here's the solution to your problem:

    Using phpMyAdmin add tempid varchar(20) field to billing_history table and script will work after that.

    Also I'll submit orppmod.zip with corrected ppinstall.php file for new installations.

    Once again guys sorry for this mistake.
    Hi Yah I saw
    thank you

    here is the code i used to get it to work 8)

    DROP TABLE IF EXISTS default_billing_history;
    CREATE TABLE default_billing_history (
    id int(11) NOT NULL auto_increment,
    user_id int(11) NOT NULL default '0',
    order_date int(11) NOT NULL default '0',
    fl_amount int(3) NOT NULL default '0',
    fl_price float NOT NULL default '0',
    rl_amount int(3) NOT NULL default '0',
    rl_price float NOT NULL default '0',
    paid int(1) NOT NULL default '0',
    tempid varchar(25) NOT NULL default '0',
    PRIMARY KEY (id)
    ) TYPE=MyISAM;


    Al

  5. #5
    Join Date
    Apr 2004
    Posts
    43

    Default

    Anyone have a working demo

  6. #6
    Join Date
    Jun 2004
    Posts
    8

    Default

    Quote Originally Posted by rogerthat
    Anyone have a working demo
    I still have some work to do on my website, and it'll be in polish, so I don't think it'll be usefull for you. As I said I tested this mod with PayPal sandbox and it worked fine.

  7. #7
    Join Date
    Sep 2003
    Location
    London UK
    Posts
    1,654

    Default

    hi

    Just this comming up on the buy page

    $randompass = rand(1,1000000);

    script does not like it ???

    Also where is the admin part for this?
    so admin can add or remove fl /rl listings etc !!

    zielit thank you for this mod

    Al

  8. #8
    Join Date
    Jun 2004
    Posts
    8

    Default

    Quote Originally Posted by awddesign
    Just this comming up on the buy page

    $randompass = rand(1,1000000);

    script does not like it ???
    Can you be more specific. I mean what kind of error you get. I'm beginer with php and have no idea why it wouldn't work. Maybe someone else have an idea....

    Also where is the admin part for this?
    so admin can add or remove fl /rl listings etc !!
    Admin part only takes care of paypal e-mail, amount of default free listings and price. I tried to write this mode so there will be no or minimal ingerence in original code (well I had to modify add_listing.php to make this module functional at all). Your request would require modification of original user_edit.php script since thats where I keep info about available listings. In my opinion changing those values shouldn't be neccessary and if so you can always use phpMyAdmin.

    Cheers,

    Zielit

  9. #9
    Join Date
    Sep 2003
    Location
    London UK
    Posts
    1,654

  10. #10
    Join Date
    Jun 2004
    Posts
    8

    Default

    Yup that helps a lot. It looks like your web server configuration doesn't allow to randomize such high numbers. Solution - either change web server configuration or (what I think is better) lower the range of rand() function in the script.

    ie : change range to 100K instead of one milion

    $randompass = rand(1,100000);

    Zielit

Similar Threads

  1. MOD - Virtual Tour Module [040504]
    By Mick in forum Mods (CLOSED)
    Replies: 141
    Last Post: 08-19-2004, 03:24 AM
  2. PostNuke Integration / Other Module Needed ?
    By Anonymous in forum General Discussion
    Replies: 18
    Last Post: 03-17-2004, 01:36 AM
  3. PayPal
    By Andre in forum General Discussion
    Replies: 2
    Last Post: 03-11-2004, 02:58 AM
  4. PayPal etc
    By FoxyWeb in forum HELP (CLOSED)
    Replies: 42
    Last Post: 09-28-2003, 02:37 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •