rubyonrailsin

A Ruby and Rails talk

Thursday, March 25, 2010


Re: [spree-user] Re: Paypal Express 500 internal server error

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

Hey I'm glad you finally got it working. 


Both of those issues are pretty much related, we need to:
1) hide / disable / rewire the "Save & Continue" button when PPE is selected.
2) force core to ensure that an actual payment is made. 

I'll take a look at what's involved there.

PPE really behaves like a standard gateway (as far as I can tell), you can make calls for all the same information you do on "regular" gateway. I know it does still provide an IPN but I'm not sure what it's benefit is intended to be (when you already go to the bother of making all the needed calls interactively anyway).

Plus, the issue regarding capturing is really dependent on the :auto_capture preference (which by default is false), so all payments are just authorized. You can manually capture a PPE payment via the order's Payments screen - where the authorized payment will appear under "Pending Payments", once you click on the "Capture" link it will move to "Finalized Payments" and you can click "Show"  to see the actual auth and capture transactions.

If you set :auto_capture to true, the the payment will capture immediately and appear under "Finalized Payments" - with only one transaction appearing when u view it's details.

Finally regarding PPE and emails, when using the sandbox you can review all the transactional email on the "Test Email" page on the sandbox site.

On 25 March 2010 13:19, Chris <r3ap3r2004@gmail.com> wrote:
I had to copy and paste both of these instructions into a text editor
to look at them side by side to see what your typo was. :-D
Definitely an easy mistake to make.

OK.  The extension does work, but I've found 2 bugs in the process.

First bug:
When I choose the PayPal radio button when checking out, the credit
card options are removed and the 'Pay with PayPal' graphic/link shows
up.  That part is fine, the problem is that the Spree "Save and
Continue" button remains.  Not knowing for sure which I was supposed
to click I chose the 'Save and Continue' button which happily moved
along to the confirm page and then the thanks for purchasing page.  It
did this without me entering any kind of payment information.

When logging into the Admin I could see this order in the orders list
as a 'New' order.  If I edit the order and go to the payments page it
shows a PayPal payment.  The links to the right though that normally
say "Show" and "Capture"  said "Show paypalexpress Capture" or
something like that.  When I clicked on Show I got some template error
undefined method `email' for nil:NilClass from line #11 of
vendor/extensions/paypal_express/app/views/admin/payments/source_views/_paypalexpress.html.erb).
 Anyway, at that point I clicked my back button and then clicked on
the "Capture" link which in turn changed the order to be 'Paid'.  This
of course is a major bug since it couldn't possibly have captured
payment since I didn't give it any paypal information to actually use
to pay for the funds, so how could it capture them.

So Bug #2:  Payment capturing is somehow capturing a payment even
though there was no authorization which didn't occur since I never
actually was directed to the paypal site to verify my account and pay
for the goods.  So in reality it isn't capturing a payment it is
simply giving away product.


On the bright side:  If I click on the 'Pay with PayPal' link like I
should everything worked fine.  Of course I'm not sure if PayPal
denied the payment if the capture would actually be capturing or not,
but I'm sure it would mark the product as paid for either way.

This is possibly a misunderstanding on my part about how PayPal
express is supposed to work.  I understand the regular gateways that
return transaction codes, authorizations, etc., and I've written IPN
code to deal with the gateway returning the authorization
asynchronously, but I'm not sure if that is an option using PayPal
Express.  I assume since when I issued a 'Capture' even on the order
that I placed properly that I didn't get an e-mail from PayPal saying
that the funds had been captured that it wasn't actually capturing.

Anyway, it would be nice to know the expected work flow when using
this extension too.

Thanks,
-Chris

On Thu, Mar 25, 2010 at 7:20 PM, Brian Quinn <brian@railsdog.com> wrote:
> Ok, please don't kill me but my instructions had a typo..... me = idiot.
> Chris / anyone can you please try:
> git clone git://github.com/railsdog/spree.git spree-ppe
> cd spree-ppe
> cp config/database.yml.example config/database.yml
> rake db:bootstrap
> ./script/extension  install
> git://github.com/railsdog/spree-paypal-express.git
> rake db:migrate
> ./script/server
>
>
> On 25 March 2010 02:19, Chris <r3ap3r2004@gmail.com> wrote:
>>
>> I should point out that it is a clean spree install.  It's my existing
>> rvm setup.
>> -Chris
>>
>> On Thu, Mar 25, 2010 at 11:18 AM, Chris <r3ap3r2004@gmail.com> wrote:
>> > Sean,
>> > Clean install following Brian's list of steps to the letter.
>> >
>> > As an aside, I haven't been chasing down the problem myself because
>> > I'm not at a point where I need it yet, and my priority list has quite
>> > a few things ahead of it right now.  But you asked if anyone else was
>> > experiencing the problem so I ran through the steps to help test
>> > Brian's method.
>> >
>> > So does anyone know if you can just zip up a rvm folder and transplant
>> > it to another system and have it work?  If that works I'm happy to zip
>> > it up for you to play with.
>> >
>> > -Chris
>> >
>> > On Thu, Mar 25, 2010 at 10:54 AM, Sean Schofield <sean@railsdog.com>
>> > wrote:
>> >> You're trying this in clean install with just PPE right?  No special
>> >> site extension or other third party extensions?  Another possible
>> >> explanation is RVM but I tend to doubt that is it.
>> >>
>> >> Sean Schofield
>> >>
>> >> -------------------------------------------
>> >> Rails Dog LLC
>> >> 2 Wisconsin Circle, Suite 700
>> >> Chevy Chase, MD 20815
>> >> voice: (301)560-2000
>> >> -------------------------------------------
>> >>
>> >>
>> >>
>> >> On Wed, Mar 24, 2010 at 9:02 PM, Chris <r3ap3r2004@gmail.com> wrote:
>> >>> http://pastie.org/885819
>> >>>
>> >>> -Chris
>> >>>
>> >>> On Thu, Mar 25, 2010 at 5:26 AM, Brian Quinn <brian@railsdog.com>
>> >>> wrote:
>> >>>> So it's bombing out because of the routes.rb, I've taken a look at
>> >>>> the
>> >>>> routes and nothing jumps out at me as being wrong.
>> >>>> Can you compare ur rails / ruby / gems versions with mine
>> >>>> here: http://pastie.org/885392
>> >>>>
>> >>>> On 24 March 2010 15:51, Chris <r3ap3r2004@gmail.com> wrote:
>> >>>>>
>> >>>>> I get the following error when trying to db:migrate after installing
>> >>>>> the spree-paypal-express plugin.  Following these instructions to
>> >>>>> the
>> >>>>> letter.
>> >>>>>
>> >>>>> -Chris
>> >>>>> ** Invoke db:migrate (first_time)
>> >>>>> ** Invoke environment (first_time)
>> >>>>> ** Execute environment
>> >>>>> rake aborted!
>> >>>>> undefined local variable or method `map' for main:Object
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/test/spree-ppe/vendor/plugins/spree-paypal-express/config/routes.rb:3
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
>> >>>>> `load_without_new_constant_marking'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
>> >>>>> `load'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
>> >>>>> `new_constants_in'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:145:in
>> >>>>> `load'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in
>> >>>>> `load_routes!'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in
>> >>>>> `each'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:286:in
>> >>>>> `load_routes!'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:266:in
>> >>>>> `reload!'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rails-2.3.5/lib/initializer.rb:537:in
>> >>>>> `initialize_routing'
>> >>>>>
>> >>>>> /Users/MyUsername/test/spree-ppe/config/../lib/spree/initializer.rb:159:in
>> >>>>> `initialize_routing'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rails-2.3.5/lib/initializer.rb:188:in
>> >>>>> `process'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rails-2.3.5/lib/initializer.rb:113:in
>> >>>>> `send'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rails-2.3.5/lib/initializer.rb:113:in
>> >>>>> `run'
>> >>>>>
>> >>>>> /Users/MyUsername/test/spree-ppe/config/../lib/spree/initializer.rb:90:in
>> >>>>> `run'
>> >>>>> /Users/MyUsername/test/spree-ppe/config/environment.rb:13
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/ree-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
>> >>>>> `gem_original_require'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/ree-1.8.7-head/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
>> >>>>> `require'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
>> >>>>> `require'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
>> >>>>> `new_constants_in'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
>> >>>>> `require'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rails-2.3.5/lib/tasks/misc.rake:4
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:636:in
>> >>>>> `call'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:636:in
>> >>>>> `execute'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:631:in
>> >>>>> `each'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:631:in
>> >>>>> `execute'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:597:in
>> >>>>> `invoke_with_call_chain'
>> >>>>> /Users/MyUsername/.rvm/ree-1.8.7-head/lib/ruby/1.8/monitor.rb:242:in
>> >>>>> `synchronize'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:590:in
>> >>>>> `invoke_with_call_chain'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:607:in
>> >>>>> `invoke_prerequisites'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:604:in
>> >>>>> `each'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:604:in
>> >>>>> `invoke_prerequisites'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:596:in
>> >>>>> `invoke_with_call_chain'
>> >>>>> /Users/MyUsername/.rvm/ree-1.8.7-head/lib/ruby/1.8/monitor.rb:242:in
>> >>>>> `synchronize'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:590:in
>> >>>>> `invoke_with_call_chain'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:583:in
>> >>>>> `invoke'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2051:in
>> >>>>> `invoke_task'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2029:in
>> >>>>> `top_level'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2029:in
>> >>>>> `each'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2029:in
>> >>>>> `top_level'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2068:in
>> >>>>> `standard_exception_handling'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2023:in
>> >>>>> `top_level'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2001:in
>> >>>>> `run'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:2068:in
>> >>>>> `standard_exception_handling'
>> >>>>>
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/lib/rake.rb:1998:in
>> >>>>> `run'
>> >>>>>
>> >>>>> /Users/MyUsername/.rvm/gems/ree-1.8.7-head/gems/rake-0.8.7/bin/rake:31
>> >>>>> /Users/MyUsername/.rvm/ree-1.8.7-head/bin/rake:22:in `load'
>> >>>>> /Users/MyUsername/.rvm/ree-1.8.7-head/bin/rake:22
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> On Tue, Mar 23, 2010 at 6:06 PM, Brian Quinn <brian@railsdog.com>
>> >>>>> wrote:
>> >>>>> > I must be doing some weird locally that everyone else is missing,
>> >>>>> > so
>> >>>>> > here's
>> >>>>> > the exact steps I just done to get PPE working.
>> >>>>> > git clone git://github.com/railsdog/spree.git spree-ppe
>> >>>>> > cd spree-ppe
>> >>>>> > cp config/database.yml.example config/database.yml
>> >>>>> > rake db:bootstrap
>> >>>>> > ./script/plugin install
>> >>>>> > git://github.com/railsdog/spree-paypal-express.git
>> >>>>> > rake db:migrate
>> >>>>> > ./script/server
>> >>>>> > Once the server starts, login to the admin and create a new
>> >>>>> > Payment
>> >>>>> > Method
>> >>>>> > setting the following fields:
>> >>>>> > Name: PayPal
>> >>>>> > Environment: Development
>> >>>>> > Active: Yes
>> >>>>> > Provider: BillingIntegration::PaypalExpress
>> >>>>> > Review: unchecked
>> >>>>> > Server: test
>> >>>>> > No Shipping: unchecked
>> >>>>> > Test Mode: checked
>> >>>>> > For the actual login details, I've been using the PayPal Sandbox
>> >>>>> > (API
>> >>>>> > Credentials page):
>> >>>>> > Login:  API Username (be careful NOT to use the test account email
>> >>>>> > address
>> >>>>> > here)
>> >>>>> > Password: API Password
>> >>>>> > Signature: Signature
>> >>>>> >
>> >>>>> > Now try to checkout? Feel free to ping me on the IRC channel if u
>> >>>>> > see me
>> >>>>> > on
>> >>>>> > (briandquinn).
>> >>>>> > Hope this helps.
>> >>>>> > BDQ
>> >>>>>
>> >>>>> --
>> >>>>> You received this message because you are subscribed to the Google
>> >>>>> Groups
>> >>>>> "Spree" group.
>> >>>>> To post to this group, send email to spree-user@googlegroups.com.
>> >>>>> To unsubscribe from this group, send email to
>> >>>>> spree-user+unsubscribe@googlegroups.com.
>> >>>>> For more options, visit this group at
>> >>>>> http://groups.google.com/group/spree-user?hl=en.
>> >>>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Brian Quinn
>> >>>>
>> >>>> -------------------------------------------
>> >>>> Rails Dog LLC
>> >>>> 2 Wisconsin Circle, Suite 700
>> >>>> Chevy Chase, MD 20815
>> >>>> voice: (301)560-2000
>> >>>> -------------------------------------------
>> >>>>
>> >>>> --
>> >>>> You received this message because you are subscribed to the Google
>> >>>> Groups
>> >>>> "Spree" group.
>> >>>> To post to this group, send email to spree-user@googlegroups.com.
>> >>>> To unsubscribe from this group, send email to
>> >>>> spree-user+unsubscribe@googlegroups.com.
>> >>>> For more options, visit this group at
>> >>>> http://groups.google.com/group/spree-user?hl=en.
>> >>>>
>> >>>
>> >>> --
>> >>> You received this message because you are subscribed to the Google
>> >>> Groups "Spree" group.
>> >>> To post to this group, send email to spree-user@googlegroups.com.
>> >>> To unsubscribe from this group, send email to
>> >>> spree-user+unsubscribe@googlegroups.com.
>> >>> For more options, visit this group at
>> >>> http://groups.google.com/group/spree-user?hl=en.
>> >>>
>> >>>
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google
>> >> Groups "Spree" group.
>> >> To post to this group, send email to spree-user@googlegroups.com.
>> >> To unsubscribe from this group, send email to
>> >> spree-user+unsubscribe@googlegroups.com.
>> >> For more options, visit this group at
>> >> http://groups.google.com/group/spree-user?hl=en.
>> >>
>> >>
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Spree" group.
>> To post to this group, send email to spree-user@googlegroups.com.
>> To unsubscribe from this group, send email to
>> spree-user+unsubscribe@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/spree-user?hl=en.
>>
>
>
>
> --
> Brian Quinn
>
> -------------------------------------------
> Rails Dog LLC
> 2 Wisconsin Circle, Suite 700
> Chevy Chase, MD 20815
> voice: (301)560-2000
> -------------------------------------------
>
> --
> You received this message because you are subscribed to the Google Groups
> "Spree" group.
> To post to this group, send email to spree-user@googlegroups.com.
> To unsubscribe from this group, send email to
> spree-user+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/spree-user?hl=en.
>

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.




--
Brian Quinn

-------------------------------------------
Rails Dog LLC
2 Wisconsin Circle, Suite 700
Chevy Chase, MD 20815
voice: (301)560-2000
-------------------------------------------

--
You received this message because you are subscribed to the Google Groups "Spree" group.
To post to this group, send email to spree-user@googlegroups.com.
To unsubscribe from this group, send email to spree-user+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive