My favorites | Sign in
Project Logo
                
Search
for
Updated Feb 11, 2008 by subimage
PayPal  
Integrating with PayPal

Substruct

To enable PayPal - visit the admin preferences page inside Substruct.

Select PayPal IPN from the Processor select box, and enter in your PayPal email address and password.

PayPal Account Setup

Enable IPN

  1. Log into your PayPal account and go to Profile
  2. Click on "Instant Payment Notification Preferences"
  3. Click on Edit
  4. The URL should point to: http://yourserver/paypal/ipn

Comment by rogerpack2005, Feb 23, 2008

To use it in "test mode" Checkout the latest and greatest, code, create a sandbox merchant account, put it in your substruct admin prefs (make sure your store is in test mode), add the right url to paypal's IPN setup (a paypal setup on their site for the merchant, within sandbox) (url must be public), then checkout using another 'normal' sandbox account. Should work--if the paypal code is working. Good luck!

Comment by SeanStar12, Jul 18, 2008

@rogerpack2005 Thank you for that. It helped me!

Comment by edelsonstudios, Jul 24, 2008

I've gotten paypal integration setup, but the email functionality is not quite working. Can anyone give me a quick overview of how they got their SMTP stuff all set up and configured? I tried using my gmail account and accessing gmail's free SMTP server without any luck :(

Comment by edelsonstudios, Jul 24, 2008

Extra Info: I'm not running an SMTP server on my dev machine nor any other machine, but I am running Substruct, MySQL, Apache, and Mongrel on my dev box.

So I'm assuming I need to use a 3rd party, any tips on good, free ones I can use just for development? I can switch to a full-on SMTP server when I move everything to production.

FYI, when I tried using gmails I set "SMTP Authentication Type" to 'login', "SMTP Username" to my gmail address, "SMTP Mail Host" to 'smtp.gmail.com', "SMTP Port" to 587, and set my "SMTP Password" to my gmail password. -- But I'm still not getting mails from my test orders through Paypal's Sandbox and my orders are still "on hold - awaiting payment".

Thanks for all your help!

Comment by baldari...@yahoo.com, Aug 18, 2008

Did you enabled po3 services in your gmail account? Baldaris

Comment by rogerdpack, Jul 02, 2009

note: apparently you don't actually need to enter your paypal password in the admin/preferences required?

Comment by alanomaly, Aug 17, 2009

It appears the PayPal return URL for after the order is complete is defined by Substruct as yourcheckouthost/store/finish_order, which overrides and therefore makes it unnecessary and redundant to set the return URL via your PayPal profile.

However, I cannot find where Substruct sets this return URL. I've tried several code searches and tracing through the whole checkout process. Can anyone help? I have a necessarily unusual server setup and need to reconfigure this. Thanks!

Comment by JonTec7, Aug 17, 2009

alanomaly-- I don't believe you are correct in that assumption.

Substruct sets the url that the user is returned to after submitting the PayPal information. The user submits a form to PayPal from within the Substruct app containing hidden fields with all of the relevant order data. The user is then redirected to the url set by the hidden field with the name "return" (see vendor/plugins/substruct/app/views/store/_paypal_cart.rhtml) which happens to be the item you're trying to find. It is necessary to set the URL on your PayPal account because PayPal then does a postback to the server, hitting the paypal controller at /paypal/login. That postback is what Substruct then checks to verify that the payment has indeed been confirmed by PayPal.

However, you might not want to edit that item because it returns to the finish_order action which then updates the status of the order in the DB (or you can implement this functionality in your own action... just a note).

More information on PayPal !IPN is here

Comment by alanomaly, Aug 18, 2009

Thanks! Not sure how I missed _paypal_cart.rhtml. I did mean the user return URL, which is overridden, I wasn't trying to contradict the instructions. Post intended as general info, not a correction.

Thanks for the step-by-step run through, exactly what I'd been looking for!


Sign in to add a comment
Hosted by Google Code