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. ================================
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
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
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');
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');
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
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
<?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):
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