1 of 2
1
Simple Commerce Setup
Posted: 14 September 2008 12:04 AM   [ Ignore ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

Hi,

I am trying to set up IPN on the Simple Commerce module. I have verified sandbox seller and buyer accounts, my ‘buy now’ link works and the PayPal return to store link works. $debug is set to TRUE and my index.php page does not have restricted access.

I placed the following code in the mod.simple_commerce.php:

ob_start();
print_r($_POST);
$msg = ob_get_contents();
ob_end_clean();

if ( !
class_exists('EEmail'))
{
    
require PATH_CORE.'core.email'.EXT;  
}    

$email
= new EEmail;
$email->initialize();
$email->from($PREFS->ini('webmaster_email'));
$email->to('you@email.com');
$email->subject('IPN test');
$email->message($msg);
$email->Send();

And, when making a purchase, this sends me the following result:

Array
(
   
[mc_gross] => 119.00
   [protection_eligibility]
=> SellerProtection
   [address_status]
=> confirmed
   [payer_id]
=> X5F69VR522AUA
   [tax]
=> 0.00
   [address_street]
=> 1 Main St
   [payment_date]
=> 22:46:52 Sep 13, 2008 PDT
   [payment_status]
=> Pending
   [charset]
=> windows-1252
   [address_zip]
=> 95131
   [first_name]
=> Test
   [mc_fee]
=> 3.75
   [address_country_code]
=> US
   [address_name]
=> Test User
   [notify_version]
=> 2.5
   [custom]
=> 1
   [payer_status]
=> verified
   [business]
=> rob2_1217214042_biz@frontstage.net.nz
   [address_country]
=> United States
   [address_city]
=> San Jose
   [quantity]
=> 1
   [verify_sign]
=> A3cvXbGifiQkmr7nPVUM7LLlWA3BAh0bQln4axeJy9C6xTqimHQtWwsV
   [payer_email]
=> JohnDo_1217211896_per@frontstage.net.nz
   [txn_id]
=> 485207331K384605M
   [payment_type]
=> instant
   [last_name]
=> User
   [address_state]
=> CA
   [receiver_email]
=> rob2_1217214042_biz@frontstage.net.nz
   [payment_fee]
=> 3.75
   [receiver_id]
=> 5NSLF5URQ7BWJ
   [pending_reason]
=> PaymentReview
   [txn_type]
=> web_accept
   [item_name]
=> HotBod 12 Week Membership
   [mc_currency]
=> USD
   [item_number]
=> 1
   [residence_country]
=> US
   [test_ipn]
=> 1
   [payment_gross]
=> 119.00
   [shipping]
=> 0.00
)

So, the PayPal IPN must be responding? However, the SimpleCommerce module doesn’t record any purchases or send any emails.

What else should I look at?

 Signature 

http://www.robyallop.com

Profile
 
 
Posted: 14 September 2008 08:19 AM   [ Ignore ]   [ # 1 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23522
Joined  05-20-2002

Hm- is the buyer verified?  It looks to be the case, but I’m not dead sure.  Could you open up mod.simple_commerce.php and around line 421:

if (stristr($result, 'VERIFIED'))
        
{
change to

        
if (! stristr($result, 'VERIFIED'))
        
{


Run the same test again.  If it goes in, we know the main issue.

Make sense?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 15 September 2008 02:37 AM   [ Ignore ]   [ # 2 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

Changed code as suggested; same result :(

In case it’s helpful, Purchase template code is:

{if logged_out}
    
<p>You must be registered and logged in before you can purchase the HotBod programme.</p>
{if:else}
    {exp
:simple_commerce:purchase entry_id="107" success="site/payment_success" cancel="site/index"}
    {item_name}
    
<p><strong>{item_sale_price}</strong></p>

    <
p><a >Buy Now</a></p>
    <
p><a >Add to Cart</a></p>
    <
p><a >View Cart</a></p>

    
{/exp:simple_commerce:purchase}
{
/if}

The Buy, Add and View links have onclick=“window.open(this.href, ‘paypal’); return false;” in them.

 Signature 

http://www.robyallop.com

Profile
 
 
Posted: 15 September 2008 03:27 AM   [ Ignore ]   [ # 3 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

Edit - Just tested out using the conditional on a logged_out tag and seems to work although I can’t find it mentioned in the documentation anywhere. Not sure now if that will be your problem or not as it seems to work as it should do. Would like to know from the team now as to whether we can use that tag in that way? wink. Again hope you get your problem sorted soon.

Don’t know if this is the problem or not but I don’t think you can have :

{if logged_out}

{if
:else}

{
/if}

I think you can only have :

{if logged_out}
Content here…
{
/if}

{if logged_in}
Content here…
{
/if}

Might be wrong on that one but might be worth a try with that. If I am right then I am guessing that what is happening is that logged-out people (guests) are being allowed to purchase items?

Hope you get it sorted soon.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 15 September 2008 03:56 AM   [ Ignore ]   [ # 4 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

Thanks Mark.  I made the change you suggested but still get the same result.

I do recall seeing that advice before but I had forgotten.  I had better check my other pages for the same issue, although it doesn’t appear to be cause of the problem in this case.

 Signature 

http://www.robyallop.com

Profile
 
 
Posted: 15 September 2008 04:02 AM   [ Ignore ]   [ # 5 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

Yes sorry about that. Just saw the code above and didn’t recognise it as standard practice so thought the conditional might not be working correctly. Seems as though this does work although I haven’t seen it documented anywhere or at least I don’t think I have.

Have you gone through all the processes with setting up the sandbox environment. I remember having real problems getting mine to work ages back now and I had done everything that was in the documentation but then I remember checking in one of the accounts (sorry can’t remember which now as it was such a long time ago) and looked on the left hand column and it said that I needed to set something else up to be verified. Once I did that everything was fine. I seem to remember having to set up quite a few things just to get it to work. Seems a bit weird to me that you have to set up so many items for a sandbox. Why you can’t just enter an e-mail address and be done with I’ll never know!!

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 18 September 2008 04:21 AM   [ Ignore ]   [ # 6 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

Well I never got Sandbox to work but it does work on a live account which is the most important thing.


Cheers,

Rob

 Signature 

http://www.robyallop.com

Profile
 
 
Posted: 18 September 2008 04:25 AM   [ Ignore ]   [ # 7 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6543
Joined  04-15-2006

Yes the Sandbox can be a real pain to set up at times. I remember when I did it that I had to setup loads of stuff just to get it working. I think there was one tiny little piece of information or something silly that wasn’t in the ExpressionEngine documentation that you had to do on PayPal’s side for it to work. I think that PayPal changed what information was required to ask for more and that’s why it wasn’t in the documentation.

Pretty annoying really as it is after all just a Sandbox, they don’t (in my mind anyway) need all that information surely just for you to get a test bed area? Crazy!!

Glad it’s all working for you though.

Good luck with your site.

Best wishes,

Mark

 Signature 

Full List Of Plugins Here!! (16)
 
Retrieve Statuses
Maximum Posts Reached
Neat Link
Redirect
Fetch URI

Profile
 
 
Posted: 18 September 2008 07:36 AM   [ Ignore ]   [ # 8 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  23522
Joined  05-20-2002

My apologies, ryal001.  This one completely slipped by us on reply.  If that ever happens, do bump it.  We like to get things fixed for you- and in a speedy manner.

That said- ‘blarg’ to paypal.  I’ll test on my sandbox today, see if maybe they’ve changed something on their end.  They’ve been known to do so.  It may also have been a matter of sandbox setup.  You need to have both buyer and seller ‘approved’ in the test setup.  Which can be convoluted.

Otherwise, is all definitely well now?

 Signature 

AKA rob1

Help Request TipsPro Network

Profile
 
 
Posted: 18 September 2008 05:24 PM   [ Ignore ]   [ # 9 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

Hi Robin,

Yes, I switched to using “live” details and both the PayPal and Simple Commerce automated emails were all sent, the purchase was recorded in EE and my test customer was moved into the “paid” member group.  Thus, everything seemed to work as advertised.

It would be good to get Sandbox working for test purposes but I can live without it.  It’s probably one little thing that I’ve done or not done.  PayPal seem to make everything as obtuse as possible; I spent ages looking for an “enable” or “setup” button for Website Payments Standard before I eventually realised that it’s enabled by default once you have a verified business account.


Thanks,

Rob

 Signature 

http://www.robyallop.com

Profile
 
 
Posted: 22 September 2008 05:53 PM   [ Ignore ]   [ # 10 ]  
Grad Student
Avatar
Rank
Total Posts:  35
Joined  03-21-2006

Hmm.. I can’t get Sandbox working either. I’ll try it w/ a live account and see if that works.

 Signature 

Brian Warren // Be Good Not Bad // BeGoodNotBad.com

Profile
 
 
Posted: 06 October 2008 10:14 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

mrwarren - were you able to get the live site working?  This may be worth splitting to a new thread to investigate separately anyway.

Rob - we commonly see issues with unverified buyers/sellers - and the sandbox, I believe, has to have its own users verified separately since it’s a complete test environment.  Could that be the potential cause of the failure?

In any case, it’s up to you if you wish to pursue this or not - if you’d rather not work through it, then let me know and we can consider it a done deal since the live stuff works. =)

 Signature 
Profile
MSG
 
 
Posted: 06 October 2008 10:22 AM   [ Ignore ]   [ # 12 ]  
Grad Student
Avatar
Rank
Total Posts:  35
Joined  03-21-2006

Funny, I switched to Live site and it didn’t work, then I switched back to sandbox and got it working. The site is still in development, so I am not in a position to test live again until a bit later. I’ll fire up another post if it’s still giving me problems.

Is Simple Commerce getting much of an update w/ 2.0? As it is, the documentation could use a serious overhaul. The step by step instructions are pretty opaque. I’m constantly feeling like I’m missing something. Maybe I am? There’s some awesome tutorial somewhere? That’d be wonderful!

 Signature 

Brian Warren // Be Good Not Bad // BeGoodNotBad.com

Profile
 
 
Posted: 06 October 2008 10:36 AM   [ Ignore ]   [ # 13 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

Hi, mrwarren - glad to hear you got the sandbox working.  Do post again if you need help with going live.  As far as your other questions, you can, of course, put in a feature request for more documentation or other features with the Simple Commerce module.

But let’s keep this thread on track.  Rob - let us know if what I said sounds like a potential issue.

 Signature 
Profile
MSG
 
 
Posted: 06 October 2008 03:26 PM   [ Ignore ]   [ # 14 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

Hi Lisa, all the accounts are verified.

 Signature 

http://www.robyallop.com

Profile
 
 
Posted: 06 October 2008 03:29 PM   [ Ignore ]   [ # 15 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

Verified for both the sandbox and live sites?  My understanding is that they are quite different.

 Signature 
Profile
MSG
 
 
Posted: 06 October 2008 04:02 PM   [ Ignore ]   [ # 16 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

I will check again later (at work at the moment), but I’m sure all the sandbox accounts are verified.

My understanding is that the IPN wouldn’t work at all if the accounts weren’t verified.  As noted above, I could be wrong but PayPal does seem to be sending an IPN response, it just isn’t recognised by Simple Commerce.

 Signature 

http://www.robyallop.com

Profile
 
 
Posted: 06 October 2008 07:24 PM   [ Ignore ]   [ # 17 ]  
Moderator
Avatar
RankRankRankRankRankRankRankRank
Total Posts:  32861
Joined  05-14-2004

Let us know what you find out about the verification. Also, can you confirm what version and build of EE you’re on, and any extensions you may be running?

 Signature 
Profile
MSG
 
 
Posted: 07 October 2008 04:49 AM   [ Ignore ]   [ # 18 ]  
Grad Student
Avatar
Rank
Total Posts:  46
Joined  07-04-2006

I confirm that all the test accounts are enabled and verified. 

There are three email accounts, one is my actual email address (e.g. rob@abc.com), one is a test business account (e.g. rob2_1215555042_biz@abc.com) and one is a personal test account (e.g. JohnDo_1217211896_per@abc.com).

I have tried using both rob@abc.com and rob2_1215555042_biz@abc.com as the PayPal account in the Simple Commerce settings.


I am using EE 1.6.4.


Extensions:

Register Birthday (v.1.0)
File, by Mark Huot (v.3.1.1)
First Timer (v.1.0.0)
Register Occupation

 Signature 

http://www.robyallop.com

Profile
 
 
   
1 of 2
1
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64912 Total Logged-in Users: 31
Total Topics: 81863 Total Anonymous Users: 18
Total Replies: 440097 Total Guests: 171
Total Posts: 521960    
Members ( View Memberlist )
Newest Members:  bjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcfthenetmonkeybenekwhobutsb