vue-paypal-checkout icon indicating copy to clipboard operation
vue-paypal-checkout copied to clipboard

flow_config.user_action cannot be set to "Continue"

Open Connum opened this issue 7 years ago • 9 comments

Hi there,

this might not be the component's fault, but as the docs state that a "valid object with the Experience options" can be passed, I'm posting this here in the hope that someone has an idea.

This is what my experienceOptions look like:

      experienceOptions: {
        presentation: {
            ...
        },
        flow_config: {
          landing_page_type: 'Billing',
          user_action: 'Continue'
        },
        input_fields: {
          no_shipping: 1,
          address_override: 1
        }
      }

However, as soon as I set the user_action to 'Continue' (also tried small-caps 'continue'), I get an error from the API:

{
    "name": "VALIDATION_ERROR",
    "debug_id": "9a81813a1c23",
    "message": "Invalid request - see details",
    "information_link": "https://developer.paypal.com/docs/api/payment-experience/#errors",
    "details": [
        {
            "field": "flow_config.user_action",
            "issue": "Value is invalid (must be commit)"
        }
    ]
}

Any idea why I shouldn't be able to set the user_action to anything other than 'commit'? Maybe a combination with another (default) setting that prevents it? I don't want to use the "Pay now" approach, because I fear that a tech-savvy user could tamper with the cart amount, so I want to get the Payment ID and check that server-side before making the actual purchase. And as the component doesn't support Advanced Integration yet (see #36), I think there's no other option.

Any help appreciated.

Connum avatar May 29 '18 08:05 Connum

Hey @Connum,

The paypal-checkout button exposes a prop called commit which should be what you're looking for. It's normally true by default. I'm guessing you can set commit: false instead?

If this doesn't work for you let me know! I'll look into it.

Cheers!

cocoastorm avatar May 29 '18 17:05 cocoastorm

Thanks for the quick response! Currently I can't access the REST API at all (always receiving a status of 401), but I'll try it out and let you know, as soon as it's working again.

Connum avatar May 30 '18 07:05 Connum

Hey @Connum,

Did you get it to work?

cocoastorm avatar Jun 08 '18 23:06 cocoastorm

Unfortunately, I still haven't been able to test it due to the API error. Even tried a new key, but to no avail. But I hope this will be sorted out soon!

Connum avatar Jun 09 '18 09:06 Connum

Hi @khoanguyen96, thanks, it works!

Connum avatar Jun 13 '18 06:06 Connum

One thing that I still don't understand though is that the payment is automatically being completed after authorization, without the user having to confirm it on the page again. This seems to be triggered by the component? Shouldn't there be a check in "onAuthorize" for the commit prop?

Connum avatar Jun 15 '18 10:06 Connum

Hey @Connum,

I never used it without commit: true before, so you're most likely right. I'll add a check for the commit prop beforehand.

Cheers!

P.S. Thanks for the PR I'll take a look at it as soon as I can. 👍

cocoastorm avatar Jun 16 '18 02:06 cocoastorm

<PayPal
       env="sandbox"
       amount="0.01"
       currency="USD"
       locale="en_US"
       :client="paypal_credentials"
       :paypal-paymentAuthorized="onPaymentSuccess"
       :paypal-paymentCancelled="onPaymentFail">
</PayPal>

I imported and used this code and provided sandbox client ID.But not working.can you please help me how to get responses while doing payment

bhaskararao-nyros avatar Nov 01 '18 06:11 bhaskararao-nyros

hey @bhaskararao-nyros,

The event names were changed recently.

https://github.com/khoanguyen96/vue-paypal-checkout#events-fired-by-the-simple-paypal-component

What version of vue-paypal-checkout do you have installed?

cocoastorm avatar Nov 01 '18 18:11 cocoastorm