Welcome to OGeek Q&A 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 Reply

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...