• Resolved damiansgtestudio

    (@damiansgtestudio)


    Hi!

    I’ve installed and setup the plugin using live API keys but I get “Forbidden” error in the checkout. If I use sandbox API key it works ok, but not with Live API keys.

    I checked the logs file and seems to be ok, this is what I get:

    [09-04-2019 10:48:30] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/oauth2/token
    [09-04-2019 10:48:32] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: Response Status 	: 200
    [09-04-2019 10:48:32] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/payment
    [09-04-2019 10:48:33] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: Response Status 	: 201
    [09-04-2019 10:48:40] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: POST https://api.paypal.com/v1/payments/payment
    [09-04-2019 10:48:41] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: Response Status 	: 201
    [09-04-2019 10:49:26] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: GET https://api.paypal.com/v1/payments/payment?count=1
    [09-04-2019 10:49:27] Inpsyde\Lib\PayPal\Core\PayPalHttpConnection : INFO: Response Status 	: 200

    I’ve also contacted Paypal support and they said I should contact plugin author.

    Please can you let me know why this error happens and how I can fix it?
    Let me know if you need any other data.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter damiansgtestudio

    (@damiansgtestudio)

    In console during checkout I get:
    Refused to set the document’s base URI to ‘https://www.paypalobjects.com/web/res/d96/XXXXXXXXXXXXXXXXXX’ because it violates the following Content Security Policy directive: “base-uri ‘self’ https://*.paypal.com”.

    Thread Starter damiansgtestudio

    (@damiansgtestudio)

    Can the plugin author answer? Please? I’m stuck with this issue, thanks

    Hi @damiansgtestudio,

    Try to update the plugin and see if the issue still persist, version 2.0.0 add a logger in WooCommerce you can use to give us more information about the context of the problem if needed.

    Let us know.

    Thread Starter damiansgtestudio

    (@damiansgtestudio)

    @wido thanks for the reply. I already had version 2 but finally I was able to solve the problem with the Forbidden message. I think it was conflicting with another payment gateway.

    Now the order is created successfully but page won’t be redirected to Paypal payment, I get an error in Console:

    Uncaught could not get URLs
    U	@	ppplus.min.js:25
    plusRedirect	@	payPalRedirect.js?4ee0:23
    (anonymous)	@	payPalRedirect.js?4ee0:33
    load (async)		
    (anonymous)	@	payPalRedirect.js?4ee0:32
    (anonymous)	@	bootstrap:83
    t	@	bootstrap:19
    (anonymous)	@	bootstrap:83
    (anonymous)	@	bootstrap:83

    And the page will not get redirected. Any ideas what it could be?

    Hi @damiansgtestudio,

    I need the site link to debug a bit, sounds like paypal script doesn’t get the url where redirect the user.

    Thread Starter damiansgtestudio

    (@damiansgtestudio)

    Hi Guido,

    The problem is that it is a live site and you need to make an order to see this, but we cannot do many test orders in this site. Is there any other way that we can debug it? I’m developer, just tell me and I can follow the instructions.

    Thread Starter damiansgtestudio

    (@damiansgtestudio)

    @wido any news?

    Hi @damiansgtestudio I had a deeper look on the issue.

    The url is entirely managed by php, you should check if the value in woo-paypalplus/src/PlusGateway/Gateway.php at line 199, $paymentUrl = $this->createPayment(); contains a valid value when the iframe is loaded within the checkout page.

    A var_dump($paymentUrl); exit; in checkout page could show you the value.

    If the value is valid, may be the problem is when the we setup the redirect via javascript in the file woo-paypalplus/resources/js/payPalRedirect.js you’ll see

    
    window.addEventListener('load', () => {
      plusRedirect(window.payPalRedirect.message)
    })
    

    May be it’s too late to call plusRedirect for some reason and that should be instead done when the document is ready.

    In that case try to use the code from https://pastebin.com/UuNpWAbU just copy paste into woo-paypalplus/public/js/payPalRedirect.min.js and see if something changed.

    I did the following change

    
    document.addEventListener('DOMContentLoaded', () => {
      plusRedirect(window.payPalRedirect.message)
    })
    

    I haven’t had any problems to be honest it’s the first time I see it.

    Let me know

    • This reply was modified 5 years, 11 months ago by Guido Scialfa.
    Plugin Support Andreas W.

    (@aweissinpsyde)

    Da es den Anschein hat, dass Problem wurde mit der neuen Version behoben, werde ich dieses Ticket hier schliessen. Selbstverst?ndlich kann weiterhin hierauf geantwortet oder eine Neues aufgemacht werden.

    Vielen Dank
    Andreas

    Hi, i have the same problem on checkout, except i don’t use any payment getaways and this is happening to one specific customer. What could be the reason for that?
    Help. please, as me and my customer are going nuts…

    {"result":"failure","messages":"<ul class=\"woocommerce-error\" role=\"alert\">\n\t\t\t<li>\n\t\t\tVa\u0161ega naro\u010dila ni bilo mogo\u010de obdelati. Poskusite ponovno.\t\t<\/li>\n\t<\/ul>\n","refresh":true,"reload":false}

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Problem Checkout Forbidden’ is closed to new replies.