6
Setting up PayPal standard payments with IPN for Magento
1 Comment | Posted by Mark Kordon in Web and social media
On a project I’m doing with a good friend, Sebastian Kraaijenzank. We’re setting up a Magento Commerce shop. The shop was coming along quite nice and we started adding products. In Denmark, you have to get your webshop approved before starting accepting payments via credit cards. This was a problem for us. First of all, this process can take months, if you’re unlucky. We decided to start out with PayPal payments. Here’s how to get started.
Okay, we’re going to set up a couple of things to get started. Both in Magento admin panel and PayPal.
Let’s get started!
1. Setting up Magento
First thing we gotta do is setup PayPal Standard.
Go to System -> Configuration -> PayPal Accounts
The field “Business Name”. The name you enter in this field is used when all the items in the Magento shopping cart are aggregated into a lump sum on the Paypal invoice.
The field “Business Account”. Type in the e-mail. you use to sign in with, on your PayPal Business account.
Optional: Set the “Sandbox flag” to “True”, if you’re testing this in sandbox mode.
Next up, go to: System -> Configuration –> Payment Methods –> PayPal Standard
Start out by enabling the payment method; set “Enabled” to “Yes”.
Now if you want PayPal to capture the money when to order is placed, choose “Sale” for “Payment Action”. If you want to control when the money is actually captured, set it to “Authorization”. This will only validate the credit card and let you decide when the money will be captured. We choose this option, because you’re only allowed to capture the money when the order is sent by mail.
Note: you will need to log in to your PayPal account in order to actually capture the money. But Magento will automatically be notified.
Select an option for “New order state”. It’s totally your call.
The “Transaction Type”: select “Individual Item” to have all the items in the Magento shopping cart listed separately on the Paypal invoice, or “Aggregate Order” when you just want a lump sum for the whole order on the Paypal invoice.
That was about it for Magento. Let’s have a look at your PayPal account.
2. Setting up PayPal
First, we need to enable IPN (Instant Payment Notifications). In order to do this, log in to your PayPal account and choose My Account -> Profile ->Instant Payment Notification Preferences
Click the “Edit IPN Settings” button and put in this url in the field:
- http://www.your-magento-shop-url.com/paypal/standard/ipn/
And of course, you need to enable the feature.
You might also want your customers to be automatically redirected to your shop, when they have completed the payment. To do this, go to Website Payments in My Account -> Profile. Check the “On” button and put in this URL in the field:
- http://www.your-magento-shop-url.com/paypal/standard/success/
That’s about everything. Your shop is now PayPal ready. However, you might experiencing some problems regarding double Grand Totals and Total Paid, or the order show as Completed instead of the selected value. Read on!
3. Known problems and fix
As mentioned above, some might be having problems with double Grand Totals and Total Paid, or the order show as Completed instead of the selected value. If that is the case you need to modify a core file. It’s a bug; yaiks!
Open the file:
- /app/code/core/Mage/Paypal/Model/Standard.php
On line 149 you should see the following:
- return false;
Change this to
- return true;
On line 423, edit this line:
- Mage_Sales_Model_Order::STATE_COMPLETED, true,
Instead, it should be:
- Mage_Sales_Model_Order::STATE_PROCESSING, $newOrderStatus,
Done!
Yep, it’s true! You’re actually finished! If you got any problems or questions, feel free to comment!
1 Comment for Setting up PayPal standard payments with IPN for Magento
online clothes shop | February 18, 2010 at 4:47 am


I been looking for a fix for that..Thanks man!!