Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: Gift Certificate and PayPal  (Read 10033 times)

Offline camcguir

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Gift Certificate and PayPal
« on: August 13, 2014, 02:29:26 AM »
Hey all,

Not sure where to turn to on this one.  I am using PayPal standard (sandbox) with the Gift Certificate extension.  When attempting to purchase a gift certificate, PayPal returns a response of "Your shopping cart is empty."  I looked at the post in the browser and compared it to a successful post, and it appears that Gift Certificates are not being treated as normal products.  The following parameters are missing the post:

item_name_(i)
item_number_(i)
amount_(i)
quantity_(i)
weight_(i)

Not that quantity/weight are important, but these are the missing parameters; everything else is there.  I did some digging, but honestly PHP isn't my thing.  I'm assuming that somehow the GCs are not being passed into the Products array, so when the product loop occurs in the PayPal extension, the GCs do not appear. Or maybe in the controller the specific GC fields are not being mapped.  I'm at a loss.  Any help that you can provide or even a direction as to where I need to start looking is more than appreciated.  Thanks!

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2048
  • Karma: +319/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Gift Certificate and PayPal
« Reply #1 on: August 13, 2014, 03:55:58 PM »
solution in attachment. Please check and let me know.
Just replace file public_html/extensions/default_pp_standart/storefront/controller/responses/extension/default_pp_standart.php
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline camcguir

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Re: Gift Certificate and PayPal
« Reply #2 on: August 13, 2014, 10:00:23 PM »
Awesome!  Thanks!  It worked, but the first time I ran it, something funky happened.  It passed 2 virtual products in the header request to PayPal.  I must have been something in my cache from yesterday.  I emptied the cart, made a $0 purchase, and then tried again.  The 2nd time it worked.

I was thinking that it was something like this, but I could not find the functions; hence, I didn't know they were called "Virtual Products".  I basically wrote the same code but used $gifts, and know 'get' method. 

Any suggestions on how I can debug PHP from the server side? (I'm ok with reference links)

Thanks, again, for the help!

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5798
  • Karma: +274/-2
    • View Profile
Re: Gift Certificate and PayPal
« Reply #3 on: August 14, 2014, 01:37:57 AM »
Any suggestions on how I can debug PHP from the server side? (I'm ok with reference links)

Thanks, again, for the help!

Did you use PayPal Sandbox? It should help

Offline camcguir

  • Newbie
  • *
  • Posts: 5
  • Karma: +1/-0
    • View Profile
Re: Gift Certificate and PayPal
« Reply #4 on: August 14, 2014, 11:18:18 AM »
Yes, I'm using PayPal Sandbox, but that's not really what I'm getting at.

I'm a C# programmer, but interested in PHP.  I'm used to using Visual Studio to debug C# or the browser to debug JS.  I haven't had much exposure to PHP, but I'm getting there.  I'm wondering how I can debug PHP using breakpoints, inspecting live objects, walking through code, etc.

Thanks!

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2048
  • Karma: +319/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Gift Certificate and PayPal
« Reply #5 on: August 18, 2014, 02:43:44 AM »
Any suggestions on how I can debug PHP from the server side? (I'm ok with reference links)
1. Easy way - you can use our native debug mode, Just turn it on in settings->system and choose "show" debug info on page.
2. hard way   - you can try to use xdebug lib for php and tune it to work with your IDE. Then you can set some breakpoints and run script. But it's all theory:) i still can't find time for this experiment.:) probably you have:)
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline GottaRun

  • Newbie
  • *
  • Posts: 35
  • Karma: +6/-0
    • View Profile
    • GottaRun Webshop
Re: Gift Certificate and PayPal
« Reply #6 on: December 18, 2014, 12:41:33 PM »
solution in attachment. Please check and let me know.
Just replace file public_html/extensions/default_pp_standart/storefront/controller/responses/extension/default_pp_standart.php

Thanks for that fix, I installed Gift Cert extension just this week and needed this fix. Would be great if these bugs were being fixed in the extensions as updates.

Thankfully a customer I know brought it to my attention.

Offline GottaRun

  • Newbie
  • *
  • Posts: 35
  • Karma: +6/-0
    • View Profile
    • GottaRun Webshop
Re: Gift Certificate and PayPal
« Reply #7 on: January 19, 2015, 08:09:50 AM »
Something else has popped up using this extension.

When you apply the gift certificat in your cart, the correct adjusted subtotal is shown but when you go to the external Paypal to make payment the value of the Gift Certificate is added onto the total.

So if your cart was €200 and you apply €100 Certificate Paypal looks for you to pay €300.

Anyone else experience this?

Offline abolabo

  • core-developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 2048
  • Karma: +319/-13
  • web for all, all for web!
    • View Profile
    • AbanteCart
Re: Gift Certificate and PayPal
« Reply #8 on: January 20, 2015, 01:19:55 PM »
do you mean GS as product or as discount?
If you try to buy GS you have to pay for it.
“No one is useless in this world who lightens the burdens of another.”
― Charles Dickens

Offline GottaRun

  • Newbie
  • *
  • Posts: 35
  • Karma: +6/-0
    • View Profile
    • GottaRun Webshop
Re: Gift Certificate and PayPal
« Reply #9 on: January 27, 2015, 05:27:36 AM »
No this was a Gift Certificate that was bought by a customer and when they applied it to their purchase the correct subtotal showed in AbanteCart but when they went externally to PayPal to pay the balance the value of the Certificate was added to the total.

I have disabled the extension as there is an update available but first I have to figure out how to update my site to 1.2.0. It would be so much easier if Softaculous managed these updates automatically.

Offline Basara

  • Administrator
  • Hero Member
  • *****
  • Posts: 5798
  • Karma: +274/-2
    • View Profile
Re: Gift Certificate and PayPal
« Reply #10 on: January 29, 2015, 04:04:07 AM »
No this was a Gift Certificate that was bought by a customer and when they applied it to their purchase the correct subtotal showed in AbanteCart but when they went externally to PayPal to pay the balance the value of the Certificate was added to the total.

I have disabled the extension as there is an update available but first I have to figure out how to update my site to 1.2.0. It would be so much easier if Softaculous managed these updates automatically.

Hello. We can not replicate issue with latest Gift Certificate extension and PayPal STD (AbanteCart 1.2)

Offline GottaRun

  • Newbie
  • *
  • Posts: 35
  • Karma: +6/-0
    • View Profile
    • GottaRun Webshop
Re: Gift Certificate and PayPal
« Reply #11 on: February 05, 2015, 08:31:17 AM »
Hi Basara, thanks for the reply, as I said the update should have taken care of it, I wish the version update to the website was a little more straightforward.

I have never been able to update Version from within the Admin panel and am not experienced enough to trick around in the Cpanel with file uploads.

I have disabled the extension as there is an update available but first I have to figure out how to update my site to 1.2.0. It would be so much easier if Softaculous managed these updates automatically.

Hello. We can not replicate issue with latest Gift Certificate extension and PayPal STD (AbanteCart 1.2)

 

Powered by SMFPacks Social Login Mod