BeelabPaypalBundle icon indicating copy to clipboard operation
BeelabPaypalBundle copied to clipboard

getting "503 Service Unavailable" in prod env.

Open bycrea opened this issue 5 years ago • 15 comments

Hi,

I installed beelab bundle on symfony 3.4. Everything works fine in dev environment with paypal develloper (sandbox), but i get "503 Service Unavailable" error in prod env.

Dumping Exception shows : 'Security header is not valid' Seems to come from setTransaction($transaction)

       try {
            $response = $service->setTransaction($transaction)->start();
            $this->getDoctrine()->getManager()->persist($transaction);
            $this->getDoctrine()->getManager()->flush();
            return $this->redirect($response->getRedirectUrl());
        } catch (Exception $e) {
            throw new HttpException(503, 'Erreur de paiement', $e);
        }

I've tried cache:clear of course, look on the web for similar paypal issues, but nothing comes to me. If (you have any idea?) {thanks!} ;)

bycrea avatar May 23 '19 21:05 bycrea

Hello @garak I've just tried and got this :

TIMESTAMP=2019%2d05%2d24T08%3a11%3a36Z&CORRELATIONID=8e9d929e390f&ACK=Failure&VERSION=204&BUILD=52821064&L_ERRORCODE0=10002&L_SHORTMESSAGE0=Security%20error&L_LONGMESSAGE0=Security%20header%20is%20not%20valid&L_SEVERITYCODE0=Error

If something is wrong with my credentials, how come it works fine in dev env. ? Do you have any idea how to fix that? ask for new security code?

thanks.

bycrea avatar May 24 '19 08:05 bycrea

@bycrea I hope that in your dev env you're using sandbox credentials. Anyway, if your credentials are not working with a plain call to Paypal, it's clearly impossible to get it working in this bundle

garak avatar May 24 '19 09:05 garak

Of course I do, I can connect, pay, and get success return route in dev mode, with paypal credentials in parameters. It's weird it does not work in prod right? Should I try asking for different credentials as they have been used in dev already?

bycrea avatar May 24 '19 10:05 bycrea

Well, I'm not sure if you understood difference between sandbox credentials and "real" credentials. But, again: this is not something you can solve inside this bundle, you need to get your Paypal working before

garak avatar May 24 '19 11:05 garak

Sorry I may not have been clear enought. All my credentials are in the symfony parameters.yml. As long as I am in dev environement (mywebsite.com/app_dev.php/payement) everything works fine. But if I try from prod env. (mywebsite.com/payement) I get this 503 service unavailable...

Can't be more specific :/ thanks anyway.

bycrea avatar May 24 '19 16:05 bycrea

Are you using test_mode option?

garak avatar May 24 '19 16:05 garak

ok, on your advise I tried test_mode: false instead of test_mode: "%kernel.debug%" I double checked --env=prod --no-debug, but nothing helps... Is there an other way to do it?

Here is what I get in prod.log : [2019-05-26 23:53:03] request.CRITICAL: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\HttpException: "Payment error" at /var/www/"mywebsite"/src/AppBundle/Controller/User/PaymentController.php line 64 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\HttpException(code: 0): Payment error at /var/www/"mywebsite"/src/AppBundle/Controller/User/PaymentController.php:64, Beelab\\PaypalBundle\\Paypal\\Exception(code: 0): Security header is not valid at /var/www/"mywebsite"/vendor/beelab/paypal-bundle/Paypal/Service.php:108)"} []

Thanks.

bycrea avatar May 27 '19 07:05 bycrea

@garak any last idea before I give up? :)

bycrea avatar May 29 '19 15:05 bycrea

I cannot help you here. If you can't get your PayPal credentials working outside this bundle, you won't be able to get it working inside it

garak avatar May 29 '19 15:05 garak

But it works in dev environment... I dont get it haha. Thanks anyway.

bycrea avatar May 29 '19 15:05 bycrea

If you try in dev with test_mode: true you're not actually doing a real request. On the other hand, you reported above that your manual try resulted in an error.

garak avatar May 29 '19 17:05 garak

Ok I didn't know that, I'll try to reset my credentials then. Thank you very mush.

bycrea avatar May 29 '19 17:05 bycrea

Hi!

I have the same problem. did you manage to enter the mode?

artro8 avatar Jul 19 '19 18:07 artro8

No sorry, never tried mush, I'll when ever I've got time. What I understood was that you need to have a real sailor account to make it work properly. Let us know if you find out please :) Good luck with it.

bycrea avatar Jul 19 '19 18:07 bycrea