JMSPaymentPaypalBundle
JMSPaymentPaypalBundle copied to clipboard
How to execute the DoExpressCheckoutPayment
I'm implementing this bundle but I cannot seem to find a way to trigger the DoExpressCheckoutPayment after the user is redirected back to my site...I also can't see this in the documentation (not even in the core bundle).
The DoExpressCheckoutPayment
is called by the approve()
or approveAndDeposit()
methods on the plugin controller. Please see the accepting payments guide for more information. The "Performing payments offsite" section is probably what you need.
Then for some reason the transactions are not getting processed... I cannot see them on neither paypal's activity nor my bank account statements.. I have tried both useraction
on commit
and null
... I confirmed that I am using the Live signature.
I contacted paypal and they told me that I needed to call the DoExpressCheckoutPayment and that that was what was missing in my process...
I am using the same code as the documentation that you sent (the sample basically..)
Of course I confirmed that the method approveAndDeposit() is getting called and the whole process flows normally ( I get redirected to PayPal, I verify that it's the live url and I log in with my personal account to pay, and then PayPal redirects me to my site)
Here's the piece that calls it:
$result = $this->ppc->approveAndDeposit($payment->getId(), $payment->getTargetAmount());
if (Result::STATUS_PENDING === $result->getStatus()) {
$ex = $result->getPluginException();
if ($ex instanceof ActionRequiredException) {
$action = $ex->getAction();
if ($action instanceof VisitUrl) {
return new RedirectResponse($action->getUrl());
}
throw $ex;
}
} else if (Result::STATUS_SUCCESS !== $result->getStatus()) {
throw new \RuntimeException('Transaction was not successful: '.$result->getReasonCode());
}
```
I have exactly the same problem Does anyone have the solution ?
The same https://github.com/schmittjoh/JMSPaymentPaypalBundle/issues/91
I ended up downloading the SDK and following their samples on http://paypal.github.io/PayPal-PHP-SDK/sample/. Since I only needed PayPal and I was on a rush I figured it would be faster that way.
Other people or being confronted with the problem and we can solve it. Can you help the community
Thank you for reporting the issue.
@bvisonl @jeremydu To help me pinpoint the cause, could you please post the version of symfony, jms/payment-paypal-bundle and jms/payment-core-bundle that you're using?
You can find the version of installed packages with:
composer show -i
Also, is this something that started happening recently, or did you always have the issue?
Hello,
Here are the lists of bundles with their versions. This is the first time I use your bundle.
jms/payment-core-bundle 1.3.0 jms/payment-paypal-bundle 1.1.2
Thank you @jeremydu, I took the liberty of editing your comment to keep only the relevant packages.
Could you please upgrade both jms/payment-core-bundle
and jms/payment-paypal-bundle
to the latest versions and see if the problem persists? That's 1.4.0
and 1.2.0
, respectively.
Thank you in advance.
Thank you @regularjack
I updated jms/pay-paypal-bundle to version 1.2.0 and jms/payment-core-bundle I keep version 1.3.0. Always the same, I am redirected to paypal, I pay and then I am redirected to my site. The payment is not effective.
If I meet up to days jms / payment-core-bundle in version 1.4.0, or if I install on a new server this version. I have the following error:
PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: Class "" used for ser vice "jms\payment\corebundle\command\generatekeycommand" cannot be found. in /www/vendor/symfony/symfony/src /Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php:40
As a reminder I am in symfony 3.2.14
Thank you for your help
@regularjack
As inicate above in update or in 1st installation I have the error: PHP Fatal error: Uncaught Symfony\Component\DependencyInjection\Exception\InvalidArgumentException: Class "" used for service "jms\payment\corebundle\command\generatekeycommand" cannot be found. in /www/vendor/symfony/symfony/src /Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/AddConsoleCommandPass.php:40
Do you have a resolution for this error ?
@jeremydu Could you open another issue for this? I'd like this issue to remain about the problem with DoExpressCheckout. Thanks.
@regularjack the issue is created :
https://github.com/schmittjoh/JMSPaymentCoreBundle/issues/230
Can you help me please
With the new version of the bundles It still does not work DoExpressCheckoutPayment not available jms/payment-core-bundle 1.4.0 A unified API for processing payments with Symfony jms/payment-paypal-bundle 1.2.0 Payment Bundle providing access to the PayPal API
Do you have an idea for it to work?
My problem is solved. The return-url is false Call payment create and not payment complete
@jeremydu I'm glad you could figure out the solution for your issue. Would you mind elaborating a bit more what the solution was? This seems to be a recurring issue affecting many people so maybe I need to improve the documentation, but to do that I'd like to be sure of what the issue was. Thanks in advance.
The documentation is correct but a complete example would be perfect
Hi, I have the same problem. @jeremydu can i have your solution, please.
I don't khow how to execute DoExpressCheckoutPayment after the user is redirected back to my site
My error was of return_url by id_payment_complete instead of id_payment_create
Example :
$config = [ 'paypal_express_checkout' => [ 'return_url' => $this->generateUrl('id_payment_create', [ XXXXXXXXXXXX ], UrlGeneratorInterface::ABSOLUTE_URL), 'cancel_url' => $this->generateUrl('id_show', [ XXXXXXXXXXXX ], UrlGeneratorInterface::ABSOLUTE_URL), 'useraction' => 'commit', 'default_method' => 'payment_paypal', // Optional ], ];