Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

paypal


keefer

Recommended Posts

Anyone who can give me a clue as to how to get my aggregate total to carry over into paypal upon 'confirming order', I would be so appreciative. As it stands, when i hit the confirm button, the paypal site loads and the order total sits at $0.00, and the account for the customer is pre-filled with my e-mail address.

 

Thanks in advance.

Link to comment
Share on other sites

Anyone who can give me a clue as to how to get my aggregate total to carry over into paypal upon 'confirming order', I would be so appreciative. As it stands, when i hit the confirm button, the paypal site loads and the order total sits at $0.00, and the account for the customer is pre-filled with my e-mail address.

 

Thanks in advance.

 

I'm having similar issues -- I was surprised by how little I had to configure to get PayPal set up on osCommerce and now I see why: none of the user's information is carried over, nor is the total. As for the email address, you have a PayPal cookie on your machine that stores your PayPal email address. This has nothing to do with osCommerce. When a user comes to the site who has a PayPal account (and cookies saved) then their PayPal email address will be displayed.

 

I have barely scratched the surface with osCommerce so I'm hoping that there's a "been-there-done-that" solution to sending over the user info/purchase to PayPal and perhaps making it a bit more seamless: I'd like it to automatically go to PayPal's site if PayPal is the only payment module enabled; no sense making the user click again.

Link to comment
Share on other sites

If you are using the default Pay Pal module that comes with osCommerce then all you need are:

 

1. A Pay Pal Business account

2. To Install the Pay Pal module in osCommerce admin and add your Pay Pal account email address to it.

 

If you have done those things and the order total is not getting passed to Pay Pal then you have a problem with the setup of your website.

 

Vger

Link to comment
Share on other sites

If you are using the default Pay Pal module that comes with osCommerce then all you need are:

 

1. A Pay Pal Business account

2. To Install the Pay Pal module in osCommerce admin and add your Pay Pal account email address to it.

 

If you have done those things and the order total is not getting passed to Pay Pal then you have a problem with the setup of your website.

 

Vger

 

Ok, I'll have to look but the total looks fine on the osCommerce side.

 

Are there additional 3rd-party PayPal modules that would pass more user data to PayPal? I've done manual PayPal integration before using their Payment Gateway and POSTed the vars across asynchronously, but if the works done, then I would prefer not to have to hack in osCommerce to get it to do what I want.

Link to comment
Share on other sites

If you are using the default Pay Pal module that comes with osCommerce then all you need are:

 

1. A Pay Pal Business account

2. To Install the Pay Pal module in osCommerce admin and add your Pay Pal account email address to it.

 

If you have done those things and the order total is not getting passed to Pay Pal then you have a problem with the setup of your website.

 

Vger

 

 

Thanks Vger,

 

I do have a Pay Pal business account.

I have added my paypal account e-mail to the paypal module.

 

Any ideas on what could possibly be wrong with the setup of my website, could it be a permissions issue on the server?

 

K

Link to comment
Share on other sites

If you have done those things and the order total is not getting passed to Pay Pal then you have a problem with the setup of your website.

 

1. A Pay Pal Business account

2. To Install the Pay Pal module in osCommerce admin and add your Pay Pal account email address to it.

 

Vger

 

Not quite. ;)

 

I figured it out -- I'm using CAD and selected "Only CAD" in the PayPal configuration and since I hadn't set up a new currency in the Localization > Currencies section, it was returning an empty string (well actually 0, number_format returns an valid number).

 

Too bad that the values listed in the PayPal module are not related to the currency values defined under Localization but perhaps another version it will be.

 

As for populating the PayPal order form, I used the following, near line 94 in /yoursite/includes/modules/payment/PayPal.php:

 

	  $process_button_string = tep_draw_hidden_field('cmd', '_xclick') .
						   tep_draw_hidden_field('business', MODULE_PAYMENT_PAYPAL_ID) .
						   tep_draw_hidden_field('item_name', STORE_NAME) .
						   tep_draw_hidden_field('first_name', $order->customer['firstname']) .
						   tep_draw_hidden_field('last_name', $order->customer['lastname']) .
						   tep_draw_hidden_field('address1', $order->customer['street_address']) .
						   tep_draw_hidden_field('city', $order->customer['city']) .
						   tep_draw_hidden_field('zip', $order->customer['postcode']) .
						   tep_draw_hidden_field('state', $order->customer['state']) .
						   tep_draw_hidden_field('country', $order->customer['country']['iso_code_2']) .
						   tep_draw_hidden_field('H_PhoneNumber', $order->customer['telephone']) .							   
						   tep_draw_hidden_field('email', $order->customer['email_address']) .
						   tep_draw_hidden_field('amount', number_format(($order->info['total'] - $order->info['shipping_cost']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency))) .
						   tep_draw_hidden_field('shipping', number_format($order->info['shipping_cost'] * $currencies->get_value('USD'), $currencies->get_decimal_places('USD'))) .
						   tep_draw_hidden_field('currency_code', $my_currency) .
						   tep_draw_hidden_field('return', tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL')) .
						   tep_draw_hidden_field('cancel_return', tep_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));

 

All these variables were taken from the PayPal Developer Network reference site: http://www.paypal.com/IntegrationCenter/ic...-reference.html

(See the "FORM Variables: Prepopulating PayPal FORMs or Address Overriding" section)

 

I'd get yourself a sandbox account from the PayPal Developers Network so you can do a bunch of test orders without actually paying for them. when you do, change line 32 in PayPal.php to:

 

	  $this->form_action_url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...