Skip to content
This repository has been archived by the owner on Mar 21, 2020. It is now read-only.

flow_config.user_action cannot be set to "Continue" #44

Open
Connum opened this issue May 29, 2018 · 9 comments
Open

flow_config.user_action cannot be set to "Continue" #44

Connum opened this issue May 29, 2018 · 9 comments

Comments

@Connum
Copy link
Contributor

Connum commented May 29, 2018

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.

@cocoastorm
Copy link
Owner

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!

@Connum
Copy link
Contributor Author

Connum commented May 30, 2018

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.

@cocoastorm
Copy link
Owner

Hey @Connum,

Did you get it to work?

@Connum
Copy link
Contributor Author

Connum commented Jun 9, 2018

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
Copy link
Contributor Author

Connum commented Jun 13, 2018

Hi @khoaNguyen96,
thanks, it works!

@Connum
Copy link
Contributor Author

Connum commented Jun 15, 2018

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?

@cocoastorm
Copy link
Owner

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. 👍

@bhaskararao-nyros
Copy link

<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

@cocoastorm
Copy link
Owner

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants