Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callbacks in onSuccessPayment[] never gets called #18

Open
JanMikes opened this issue Mar 9, 2016 · 3 comments
Open

Callbacks in onSuccessPayment[] never gets called #18

JanMikes opened this issue Mar 9, 2016 · 3 comments

Comments

@JanMikes
Copy link

JanMikes commented Mar 9, 2016

I have done everything exactly according to documentation, but unfortunately script is not working for me.
When i click on button, i get redirected to paypal, which is ok, after sandbox payment (have tested without sandbox mode as well) i get redirected back, callback onConfirmation() is invoked and nothing happens afterwards - no balance is transfered as well.

Last thing that happens is calling component handler handleConfirmation() nette action looks like Video:User:orderDetail paypalButton-confirmation!

As i checked code, there is function confirmExpressCheckout() which is NEVER called and i think there is something wrong with it, as well it contains onSuccessPayment() which should invoke callbacks.

@JanMikes
Copy link
Author

JanMikes commented Mar 9, 2016

Working workaround:

$control->onConfirmation[] = function($data) use ($control) {
    $this->confirmOrder($control, $data);
};
public function confirmOrder($control, $data)
{
    $control->confirmExpressCheckout();
}

Though i dont know it is supposed to work like this or there is nicer way.
Using this solution as well balance is changed on both accounts affected.

@fmasa
Copy link
Contributor

fmasa commented Mar 18, 2016

@lexinek That's the way it's supossed to work. You should have control over payment confirmation, you may want to run some checks (i.e. order status in DB) before accepting the payment.

Current docs are unclear about that. Would you mind creating a PR? :)

@fmasa
Copy link
Contributor

fmasa commented Mar 21, 2016

The question is whether we need separate onSuccessPayment event. Do we?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants