cocoastorm / vue-paypal-checkout

A simple Vue.js wrapper component for paypal-checkout
MIT License
153 stars 67 forks source link

PayPal experience options #6

Closed itsameandrea closed 6 years ago

itsameandrea commented 6 years ago

Hey @khoanguyen96 any plan on adding the PayPal experience options?

It'd be great to stop users filling in shipping info if not needed.

Cheers!

cocoastorm commented 6 years ago

Hey @ilrock

It's included as a experience prop in the beta.

npm install vue-paypal-checkout@beta

I tested it with this:

<body>
  <script src="https://unpkg.com/vue@^2.5/dist/vue.js"></script>
  <script src="https://unpkg.com/vue-paypal-checkout@beta/dist/vue-paypal-checkout.min.js"></script>

  <div id="app">
    <div class="content">
      <p>Pay with USD $10.00</p>
      <paypal-checkout
        amount="10.00"
        currency="USD"
        :client="paypal"
        :dev="true"
        :invoice-number="'201705051001'"
        :experience="experience">
      </paypal-checkout>
    </div>
  </div>

  <script>
    // eslint-disable-next-line
    new Vue({
      el: '#app',
      data() {
        return {
          paypal: {
            sandbox: 'Ad1voWYq3VL8J4jy6zWARKwz4tjbuDl_TFBa3WQqy_DwAFWd7hkU4i99jijGqaoqU3E-ODqXDayVnOdl',
            production: '',
          },
          experience: {
            input_fields: {
              no_shipping: 1,
            },
          },
        };
      },
    });
  </script>
</body>

It should work. Tell me if there's any problems!

Thanks!!