support

NewPayment Extension - Stuck with response handling

Started by donthecat, April 02, 2018, 05:36:36 PM

Previous topic - Next topic

donthecat

I'm autonomously developing a new extension for the EaseBuzz payment gateway (India specific), which will be offered free to the AbanteCart community as soon as I sort out one issue that seems to be bugging me...

The extension installs and works perfectly both in Test and Live modes. The payment gateway transaction goes smoothly, both for Successful and Failed scenarios. I also tried a Live transaction,  the Card got debited and the PG dashboard shows it as a Successful transaction.

The Buyer's transaction response, the Buyer's Order Records, the Store Admin dashboard show "Failed" for all transactions. The stock gets reduced and a success mail get sent to the Buyer...

I realise that I'm sending a wrong response (or none) to the Storefront controller from the PG processing file. I've gone through the code, but I'm just not able to figure out where I'm going wrong. I'm not a JSON coder and I think I'm missing something... the error logs don't provide any warnings.

I've attached the php files for reference... Request help from someone to point out the error I'm doing.

Looking forward to offering AbanteCart, India's first free Payment Gateway extension.

Cheers

You aint Cool if you aint Green...

Save Earth ! It's the Only Planet with Chocolates !!

abolabo

Hi.
It looks like you have issue the same as for pp_standart.
After pressing button "Confirm" on checkout/conform page your customer will be reditected to third-party site (in your case easyBuzz side).
Then, after payment, will be redirected back on checkout/success page. But connection server-server (i mean post-request from their API to your response/callback) will be after redirect. In this case checkout/success see that order status is zero (incomplete) and set it to "failed".

Please check our solution for paypal_standart extension. We created additional page with periodical ajax and asks response controller is payment confirmed (page for pending of api confirmation).
Logic of this:
1. create hook to checkout/success controller InitData() and check is order incomplete and payment method is easyBuzz. If true - redirect to "pending payment page".
2. This page asks every 5 seconds your response controller method is_confirmed() with timeout 30sec. If order status still 0 - returns false. if status greater 0(api asked callback and changed order status) - returns true. If "true" OR timeout exceed - redirect back to checkout/success page. In 1st case order will be completed correctly. Otherwise - failed

Please check this commit https://github.com/abantecart/abantecart-src/commit/0a5adf666a869393ee30f1d38689fb09b6fd1cbe
You can copy whole file with hooks, methods pending_payments() and is_confirmed(), and pending_ipn.tpl

Hope this hepls

"No one is useless in this world who lightens the burdens of another."
― Charles Dickens

donthecat

Thanks a mil, Abalabo....

Sorry, I was stuck in another webdev and couldn't check this earlier... I'm now testing it out...

will revret with notes ...
You aint Cool if you aint Green...

Save Earth ! It's the Only Planet with Chocolates !!

donthecat

Hi Abalabo,

I took your advice and reworked on my code and added the hooks and other embellishments as suggested in the commit...

However, I'm still facing the same problem and I'm not able to figure out where I'm going wrong.

I'm not very familiar with JSON and I'm still in the process of understanding AbanteCart coding.

I've been stuck with this extension for a month now and we are unable to launch the Store till now  :-\ :-\

Any help will be wholesomely appreciated... Many Thanks !
You aint Cool if you aint Green...

Save Earth ! It's the Only Planet with Chocolates !!

donthecat

Thanks....
We have completed the Extension and will be offering it FREE from tonight...
You aint Cool if you aint Green...

Save Earth ! It's the Only Planet with Chocolates !!

Basara


donthecat

You aint Cool if you aint Green...

Save Earth ! It's the Only Planet with Chocolates !!

Forum Rules Code of conduct
AbanteCart.com 2010 -