Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
5.4k views
in Technique[技术] by (71.8m points)

ionic framework - Error for vault in paypal ( enabling it for subscription )

Hello im trying to do a subscription for my app using paypal. I created the subscription plan and product in sandbox as it is still a test account. When I implement the codes into my ionic app, I get this error.

enter image description here

This is the script code that I added to the index.html

<script
  src="https://www.paypal.com/sdk/js?client-id=qwe...&vault=true">
</script>

I have also added the code in my .ts page here

setTimeout(() => {
  // Render the PayPal button into #paypal-button-container
  <any>window['paypal'].Buttons({

    // Set up the transaction
    createOrder: function (data, actions) {
      return actions.order.create({
        purchase_units: [{
          amount: {
            value: _this.data.paymentAmount
          }
        }]
      });
    },

    // Finalize the transaction
    onApprove: function (data, actions) {
      return actions.order.capture()
        .then(function (details) {
          // Show a success message to the buyer
          alert('Transaction completed by ' + details.payer.name.given_name + '!');
          console.log(details)
        })
        .catch(err => {
          console.log(err);
        })
    }
  }).render('#paypal-button-container');
}, 500)

Inside the sandbox of my paypal account, I have enabled vault as well. enter image description here

I am not really sure what else I can do to enable the vault to be true.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...