woocommerce / woocommerce-paypal-payments

https://wordpress.org/plugins/woocommerce-paypal-payments/
GNU General Public License v2.0
62 stars 47 forks source link

Something went wrong. Please try again or choose another payment source (572) #511

Closed arberceni closed 2 years ago

arberceni commented 2 years ago

Describe the Bug

When trying to checkout a new order, I get an error message saying "Something went wrong. Please try again or choose another payment source.", after clicking the "Pay Now" button.

The button contains my PayPal account e-mail address (sandbox account) because I have vaulting activated and I can confirm that renewal payments do work, but I get this error for new payments. If I deactivate vaulting, new payments work but renewal payments do not work (as expected). Also, initial payments work if I choose "Pay with a different funding source" or "Pay with a different account" and I use the same account.

WooCommerce logs:

2022-02-23T12:32:35+00:00 ERROR Order 67236105U5163823X is not approved yet. 2022-02-23T12:32:35+00:00 ERROR Order approve failed: Order 67236105U5163823X is not approved yet.

I edited "ApproveOrderEndpoint.php" a little bit to log the status of the order and it shows as "CREATED".

Edit: Same thing happens when I want to manually renew a subscription.

UPDATE

When clicking the "Pay Now" button no PayPal dialog is displayed. In the browser console I can see an error with this message: "Error: Vault capture restart not implemented".

To Reproduce

  1. Add a subscription product to the cart
  2. Go to checkout
  3. Scroll down to payment options and choose "PayPal"
  4. Click "Pay Now" button

Screenshots

image

image

Expected Behavior

Payment should be successful.

Actual Behavior

Get an error message

Environment

mickaelmaury commented 2 years ago

The same error for me on a site where I try to buy the following product: https://www.formation-gestion-de-projet.education/produit/keychains/

////////////////////////

When I click on the PayPal button, I get a 403 error in the developer console: https://www.formation-gestion-de-projet.education/?wc-ajax=ppc-create-order

////////////////////////

WooCommerce PayPal Payment log :

2022-02-24T01:42:13+00:00 DEBUG POST https://connect.woocommerce.com/ppcsandbox/v2/customer/partner-referrals Request Body: {"partner_config_override":{"partner_logo_url":"https:\/\/connect.woocommerce.com\/images\/woocommerce_logo.png","return_url":"https:\/\/www.formation-gestion-de-projet.education\/wp-admin\/admin.php?page=wc-settings&tab=checkout&section=ppcp-gateway","return_url_description":"Retournez \u00e0 votre boutique.","show_add_credit_card":true},"products":["PPCP"],"legal_consents":[{"type":"SHARE_DATA_CONSENT","granted":true}],"operations":[{"operation":"API_INTEGRATION","api_integration_preference":{"rest_api_integration":{"integration_method":"PAYPAL","integration_type":"FIRST_PARTY","first_party_details":{"features":["PAYMENT","FUTURE_PAYMENT","REFUND","ADVANCED_TRANSACTIONS_SEARCH","VAULT"],"seller_nonce":"a1233wtergfsdt4365tzrshgfbaewa36AGa1233wtergfsdt4365tzrshgfbaewa36AG"}}}}]} Response Debug ID: 828274e7a3d9b Response: Array ( [code] => 201 [message] => Created )

////////////////////////

Environment

Any other plugins installed

mickaelmaury commented 2 years ago

Capture d’écran 2022-02-24 à 02 51 49

mickaelmaury commented 2 years ago

Same problem when switching to the Twenty Twenty Two theme with just WooCommerce + PayPal activated.

mickaelmaury commented 2 years ago

Small clarification: I get the same error when switching to version 1.6.4 and 1.7.0-test5 Pre-release of the extension.

Either way, the PayPal popup tries to open (partly visible for a few milliseconds), then disappears and I get a WooCommerce alert "Something went wrong. Please try again or choose another payment source." .

mickaelmaury commented 2 years ago

The error appears in connected and disconnected mode.

mickaelmaury commented 2 years ago

The problem came from the firewall of my OVH web host.

arberceni commented 2 years ago

The problem came from the firewall of my OVH web host.

That's good to hear, but your problem is not related to the one I described. I am getting a different error message in the console.

InpsydeNiklas commented 2 years ago

@arberceni The checkout with the vaulted button on the checkout page should be a one-click payment. There are some cases where this fails and the modal fallback should open but it doesn't. For now, the way to work around this issue would be manually opening the modal with the dropdown and then "Pay with a different funding source": image But we're investigating together with the PayPal Vault team what's causing the reported behavior for some users. One question: Does the vaulted button work for you on the non-checkout pages (single product or cart)? On these pages, the PayPal popup window should open with your account already being logged in.

arberceni commented 2 years ago

@arberceni The checkout with the vaulted button on the checkout page should be a one-click payment. There are some cases where this fails and the modal fallback should open but it doesn't. For now, the way to work around this issue would be manually opening the modal with the dropdown and then "Pay with a different funding source": image But we're investigating together with the PayPal Vault team what's causing the reported behavior for some users. One question: Does the vaulted button work for you on the non-checkout pages (single product or cart)? On these pages, the PayPal popup window should open with your account already being logged in.

@InpsydeNiklas Thank you for getting back to me!

I get the same behavior and error message from the cart page, single product page and mini cart. I contacted PayPal Merchant Technical Support and they suggested to add this line of code because I was getting "Error: Vault capture restart not implemented":

return actions.restart().catch(err => { // Show an error message or fall back to a different payment method });

but I noticed it is already in there.

arberceni commented 2 years ago

@InpsydeNiklas Is there anyway I can deactivate this one-click payment option, but retain vaulting? In other words, can I make the button so that it opens the dialog every time the user clicks it (vaulted or not) but retain the automatic renewal functionality?

binaryduke commented 2 years ago

We have exactly the same issue. New PayPal subscriptions fail; renewals are working fine. We have vaulting and reference transactions enabled.

AndyClass commented 2 years ago

@InpsydeNiklas InpsydeNiklas We got this Problem do:

This happens when doing this ( Vaulting and Reference Transactions enabled + WooCommerce Subscriptions)

Steps to reproduce:

  1. Buy a Subscription
  2. Cancel that subscription
  3. Try to buy another Subscription

(the Payment Method was (kind of) saved but isnt working anymore) Workaround: Delete Payment Method (Saved in PayPal Payments) and do it all over again

robert-hopla commented 2 years ago

I have the same problem @AndyClass where do you delete the payment method?

AndyClass commented 2 years ago

I have the same problem @AndyClass where do you delete the payment method?

Siwtch to Customer (addon required) -> My Account --> PayPayl Payments --> there could be something you can delete

g-man-jones commented 2 years ago

Another juicy Paypal / Woo bug. I can only hope that this issue and other bugs related to vaulting etc will be resolved soon as it's costing my business and my client time and money. I am now steering all clients to Stripe wherever possible.

Cubsfan3493 commented 2 years ago

Yep. Unfortunately problem has still not been resolved. Features I am sure all work fine with Braintree, their big stuff. But after applying with them and never receiving a response, I assume they only allow big companies to use them.

InpsydeNiklas commented 2 years ago

There's a new pre-release for the 1.8.2 update available here and it should resolve the issue as it duplicates #677. The intended one-click payment behavior should be more reliable with this version but the fallback option via the dropdown as mentioned above still exists if the user for example wants to pay with a different account.

binaryduke commented 2 years ago

I have tested v1.8.2 using:

At checkout, upon pressing the PayPal button, the popup appears briefly and disappears. The logs show:

2022-06-15T10:18:26+00:00 DEBUG POST https://api.paypal.com/v2/vault/payment-tokens Request Body: {"customer_id":"WC-e27dbaa0b9a26","source":{"paypal":{"usage_type":"MERCHANT"}},"application_context":{"return_url":"https:\/\/www.MYDOMAIN.com\/checkout\/","cancel_url":"https:\/\/www.MYDOMAIN.com\/checkout\/?ppcp_vault=cancel"}} Response Debug ID: c8fc8b26ca17a Response: Array ( [code] => 403 [message] => Forbidden )

Response Body: {"name":"FORBIDDEN","message":"No permission for the requested operation","debug_id":"c8fc8b26ca17a","details":[{"issue":"UNKNOWN_BUSINESS_ERROR","description":"There was an issue while processing your request."}],"links":[{"href":"https://developer.paypal.com/docs/api/vault/v2/#error-UNKNOWN_BUSINESS_ERROR","rel":"information_link","method":"GET"}]}

2022-06-15T10:18:26+00:00 ERROR Failed to start PayPal vaulting: [FORBIDDEN] No permission for the requested operation https://developer.paypal.com/docs/api/vault/v2/#error-UNKNOWN_BUSINESS_ERROR

(note - I have also tried with card processing and pay later enabled - same issue).

Is it still necessary for reference transactions to be enabled for automatic renewals? The latest documentation implies this. Paypal's help implies that they are no longer supporting reference transactions. It seems there may be a black hole here now.

lalindeluis commented 1 year ago

Hi Guys, I have exactly the same issue."Something went wrong. Please try again or choose another payment source." We have vaulting enabled. WooCommerce Subscriptions. The error message only comes up when I put certain days for free trial. Lets say I put 2 days free Trial on WooCommerce Subscriptions the error is trigger but it Paypal works perfectly fine when there is no free Trial period. I am guessing is this error happens because when Free Trial period is enabled the total goes to $0 so there is nothing to charge. Is there way to remove required payment when the total is $0?

Expected Behavior Payment should be successful.

Actual Behavior Get an error message

Environment WordPress Version: 6.1.1

WooCommerce Version 7.1.0

FlourishDesignStudio commented 1 year ago

How is this closed? It appears to still be an issue.

nsek commented 1 year ago

I have opened a new ticket concerning this issue. Ticket #1340

sytpb commented 6 months ago

https://woostify.com/add-to-cart-button-not-working-woocommerce/