Make $5 paypal money, by just telling me what to do

Discussion in 'Programming' started by nitrogen77, Jan 4, 2009.

  1. #1
    I need to setup in this paypal class currency as Australia dollars. it is just 1 sentence of code. And I have the felling is this one:
    $p->add_field('mc_currency', 'AUD');

    your job is just to tell me where to add it.
    First one that replies gets $5 via paypal.

    Easy job if you know PHP

    No PM, please post the answer here, so I can track the first one.

    ================================

     
    nitrogen77, Jan 4, 2009 IP
  2. elahi9999

    elahi9999 Well-Known Member

    Messages:
    121
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    103
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    below this line
    // values can be overwritten by the calling script.
     
    elahi9999, Jan 4, 2009 IP
  3. raushan2007

    raushan2007 Active Member

    Messages:
    211
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #3
    U add it under:
    $this->add_field('rm','2'); // Return method = POST
    $this->add_field('cmd','_xclick');

    So it will be:
    $this->add_field('rm','2'); // Return method = POST
    $this->add_field('cmd','_xclick');
    $this->add_field('mc_currency', 'AUD');


    Use $this because it is with in class :)
     
    raushan2007, Jan 4, 2009 IP
  4. richu

    richu Peon

    Messages:
    460
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #4
    add under :-

    $p->add_field('business', 'somebody@domain.com');
     
    richu, Jan 4, 2009 IP
  5. raushan2007

    raushan2007 Active Member

    Messages:
    211
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    Well, i think it is wrong, Because: not $p-> use $this-> because ur using it within the class

    and $p is made by declaring a new calss

    Basically $this-> = $p->
    but only after $p is declared
     
    raushan2007, Jan 4, 2009 IP
  6. richu

    richu Peon

    Messages:
    460
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    I mean look the below lines (thats the starting of the code)

    To submit an order to paypal, have your order form POST to a file with:
    *
    * $p = new paypal_class;
    * $p->add_field('business', 'somebody@domain.com');
    * $p->add_field('first_name', $_POST['first_name']);
    * ... (add all your fields in the same manor)
    * $p->submit_paypal_post();

    Now find the line
    $p->add_field('business', 'somebody@domain.com');

    Saw, right ?
    Below that add your code ie :- $p->add_field('mc_currency', 'AUD');
     
    richu, Jan 4, 2009 IP
  7. richu

    richu Peon

    Messages:
    460
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    I mean look the below lines (thats the starting of the code)

    To submit an order to paypal, have your order form POST to a file with:
    *
    * $p = new paypal_class;
    * $p->add_field('business', 'somebody@domain.com');
    * $p->add_field('first_name', $_POST['first_name']);
    * ... (add all your fields in the same manor)
    * $p->submit_paypal_post();

    Now find the line
    $p->add_field('business', 'somebody@domain.com');

    Saw, right ?
    Below that add your code ie :- $p->add_field('mc_currency', 'AUD');
     
    richu, Jan 4, 2009 IP
  8. raushan2007

    raushan2007 Active Member

    Messages:
    211
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #8
    see
    $p = new paypal_class;

    that, that declares a new class
    so if you had another page you would include this one, do, $p = new paypal_class;, $p->add_field('business', 'somebody@domain.com');,
    to add all the fields, then do $p->submit; , but this is a value in the class
    , so you use $this, so you can do $anything here = new paypal_class; and it will work
     
    raushan2007, Jan 4, 2009 IP
  9. nitrogen77

    nitrogen77 Active Member

    Messages:
    1,276
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    80
    As Seller:
    100% - 0
    As Buyer:
    62.5% - 10
    #9
    Hi guys, so far it is not working. Thanks for the feedback. I think i will pay someone to work in the code. (It is jut 2 files... ) so if you are interested please PM. My offer is $10.

    Thanks
     
    nitrogen77, Jan 4, 2009 IP
  10. newgenservices

    newgenservices Well-Known Member

    Messages:
    862
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    105
    Digital Goods:
    1
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #10
    
    <?php
    # This is a newfile. Say ipn.submit.php
    include "paypal.class.php";
    $p = new paypal_class;
    $p->add_field('first_name', $_POST['first_name']);
    $p->add_field('business', 'somebody@domain.com');
    $p->add_field('mc_currency', 'AUD');
    # ... (add all your fields in the same manner)
    $p->submit_paypal_post();
    #
    # To process an IPN, have your IPN processing file contain:
    #
    $p = new paypal_class;
     if ($p->validate_ipn())
    {
    
    // Payment has been recieved and IPN is verified. This is where you
    // update your database to activate or process the order, or setup
    // the database with the user's order details, email an administrator,
    // etc. You can access a slew of information via the ipn_data() array.
    
    // Check the paypal documentation for specifics on what information
    // is available in the IPN POST variables. Basically, all the POST vars
    // which paypal sends, which we send back for validation, are now stored
    // in the ipn_data() array.
    
    mysql_connect("localhost","db_user","dbpass") or die("Unable to connect to database");
    mysql_select_db("db_name") or die("Unable to select database");
    
    foreach ($p->ipn_data as $key => $value) { $$key == $value; }
    
    $qry="INSERT INTO paypal_table VALUES (0 , '$payer_id', '$payment_date', '$txn_id', '$first_name', '$last_name', '$payer_email', '$payer_status', '$payment_type', '$memo', '$item_name', '$item_number', $quantity, $mc_gross, '$mc_currency', '$address_name', '".nl2br($address_street)."', '$address_city', '$address_state', '$address_zip', '$address_country', '$address_status', '$payer_business_name', '$payment_status', '$pending_reason', '$reason_code', '$txn_type')";
    
    mysql_query($qry);
    }
    }
    ?>
    
    Code (markup):
     
    newgenservices, Jan 4, 2009 IP
  11. nitrogen77

    nitrogen77 Active Member

    Messages:
    1,276
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    80
    As Seller:
    100% - 0
    As Buyer:
    62.5% - 10
    #11
    To all of you thank a lot, i decided to hire someone, based that the "second" file, is a bit complex. newgenservices - thanks for your help. The same for raushan2007

    I decided to go with Richu, to do the job. Cheers
     
    nitrogen77, Jan 4, 2009 IP
  12. atlantaazfinest

    atlantaazfinest Peon

    Messages:
    389
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #12
    Job is done!
     
    atlantaazfinest, Jan 4, 2009 IP