Site maintenance: Tuesday 17 Nov, from 10:00 UTC, about 4–6 hours. Details

This cutover relies on some testing that is still incomplete so may be cancelled at short notice

Forums / Addon Payment Modules / Payfast -- Use of gift certificate generates error after payment successful

Payfast -- Use of gift certificate generates error after payment successful

Started by bruce on 14 May 2011, 10:01 AM · Views: 2,000

Results 1 to 8 of 8
14 May 2011, 10:01 AM
#1
bruce avatar

bruce

New Zenner

Join Date:
May 2011
Posts:
14
Plugin Contributions:
0

Payfast -- Use of gift certificate generates error after payment successful

Zencart 1.3.9h, not upgraded

I have set up my Zencart and I am busy testing before going live.

I set up my store to issue a gift certificate when a new customer registers on the site. When I used that gift certificate, it all worked fine until after payment had been made.

After payment I was redirected back to my store, but instead of getting to "Checkout Success", I am get to "Step 2 of 3 - Payment Information" and there is a red message displayed saying "It appears that the amount you have tried to apply and your Gift Certificate balance do not match. Please try again." This is after the Gift Certificate has been used and payment has been collected for the purchase amount less the amount applied from the gift certificate balance.

To the customer, it looks as if the purchase has been unsuccessful and the shopping cart still contains the items that were purchased. However, Zencart has generated the order.

Obviously this is a problem because the customer knows that payment has been collected already, but the purchase appears unsuccessful. Most customers will not first check if their orders are listed under "My Account" to see if an order has been generated. Is there a setting I need to change to allow customers to use their gift certificates?

Many thanks for your assistance.

14 May 2011, 2:10 PM
#2
Kim avatar

Kim

Obaa-san

Join Date:
Jun 2003
Location:
West Coast, North America
Posts:
26,742
Plugin Contributions:
0

Re: Payfast -- Use of gift certificate generates error after payment successful

What Addons have you installed? What payment methods do you have active?

Please do not PM for support issues: a private solution doesn't benefit the community.

Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

18 May 2011, 1:00 PM
#3
bruce avatar

bruce

New Zenner

Join Date:
May 2011
Posts:
14
Plugin Contributions:
0

Re: Payfast -- Use of gift certificate generates error after payment successful

I have installed one add-on to add an extra payment method called Payfast. Payfast is a payment gateway. I initially had a problem with the shopping cart in that an order was not generated despite checkout success. The Payfast technical support team checked out my installation and corrected the error.

The Payfast payment gateway works fine. However, if a gift certificate is used, the order is generated, but the customer is returned to the Payment Information page with the error message. It seems that when the gift certificate is used, the gift certificate amount on the Payment Information page is not cleared. The customer's balance is zero since the gift certificate was used with the order, but the website seems to think the customer is trying to use the gift certificate again. Not sure if the explanation is very clear.

I can give you details of the site and set the payment gateway to test mode so you can check it out if that would be helpful?

18 May 2011, 4:15 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: Payfast -- Use of gift certificate generates error after payment successful

bruce:

After payment I was redirected back to my store, but instead of getting to "Checkout Success", I am get to "Step 2 of 3 - Payment Information" and there is a red message displayed saying "It appears that the amount you have tried to apply and your Gift Certificate balance do not match. Please try again." This is after the Gift Certificate has been used and payment has been collected for the purchase amount less the amount applied from the gift certificate balance.That's not normal, and certainly not how the software was written.

Sounds like a problem in your payment module or code customizations or addons.

Additionally, I can't replicate that activity using a fresh clean uncustomized install using built-in payment modules and demo products.

Try turning on the Check/MoneyOrder payment module, and do a checkout with that, using Gift Cert as part of the payment.
How does the experience differ?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 May 2011, 6:55 AM
#5
bruce avatar

bruce

New Zenner

Join Date:
May 2011
Posts:
14
Plugin Contributions:
0

Re: Payfast -- Use of gift certificate generates error after payment successful

Thanks, Dr Byte.

Using the Check/Money Order module does work correctly and CheckOut_Success is confirmed.

What I can't work out with the Payfast module is that somehow the pre_confirmation_check($order_total) function is being invoked before the checkout_success page is reached. It seems that maybe the session variables are not being properly cleared, but I have gone through the Payfast.php module and immediately before the zen_redirect to checkout_success command, the $order_total_modules->clear_posts() command is given. I have also compared the code in the before_process function per the payfast.php module to the code per the paypal.php module and they are identical.

They both call $order_total_modules->clear_posts(); and then zen_redirect( zen_href_link( FILENAME_CHECKOUT_SUCCESS, '', 'SSL' ) );

Is there any way of debugging this in a step through fashion and keeping track of the environment variables while doing so?

22 May 2011, 7:10 AM
#6
bruce avatar

bruce

New Zenner

Join Date:
May 2011
Posts:
14
Plugin Contributions:
0

Re: Payfast -- Use of gift certificate generates error after payment successful

This must be a Payfast specific issue - I tested using the Paypal Express Checkout and it works correctly.

I am a little bit stuck now.

8 Jun 2011, 2:14 PM
#7
payfast avatar

payfast

New Zenner

Join Date:
Jun 2011
Posts:
1
Plugin Contributions:
1

Re: Payfast -- Use of gift certificate generates error after payment successful

We have stepped through our code, and for some reason the before_process function in our module is not being called by Zen-Cart. Our module works fine on our test systems, but not on Bruce's.

Can anyone point out as to why this would happen? As Bruce points out, our before_process is practically identical to PayPal's. Doing a search on this forum shows many payment modules seem to be effected as of late, but we've yet to find a solution.

21 Apr 2012, 4:50 PM
#8
zelda avatar

zelda

New Zenner

Join Date:
Apr 2012
Posts:
1
Plugin Contributions:
0

Re: Payfast -- Use of gift certificate generates error after payment successful

Hello

Please can you tell me how you installed the Payfast module. As when i go to Zencarts payment module to install, Payfast is not there as an option in Zencart 1.5?

bruce:

I have installed one add-on to add an extra payment method called Payfast. Payfast is a payment gateway. I initially had a problem with the shopping cart in that an order was not generated despite checkout success. The Payfast technical support team checked out my installation and corrected the error.

The Payfast payment gateway works fine. However, if a gift certificate is used, the order is generated, but the customer is returned to the Payment Information page with the error message. It seems that when the gift certificate is used, the gift certificate amount on the Payment Information page is not cleared. The customer's balance is zero since the gift certificate was used with the order, but the website seems to think the customer is trying to use the gift certificate again. Not sure if the explanation is very clear.

I can give you details of the site and set the payment gateway to test mode so you can check it out if that would be helpful?