App ionic PayPal支付
1.在PayPal开发者中创建Sanbox应用和Live应用
2.在应用下添加webhooks(支付回调)
3.测试时可以用sandbox的账号测试
4.得到sanbox的client id和live的client id
5.安装(cordova)(https://ionicframework.com/docs/native/paypal)
ionic cordova plugin add com.paypal.cordova.mobilesdk
npm install @ionic-native/paypal
6.代码
import {
PayPal, PayPalPayment, PayPalConfiguration } from '@ionic-native/paypal/ngx';
constructor(private payPal: PayPal) {
}
this.payPal.init