我正在尝试使用 paypal-cordova-plugin 将 paiement 集成到我的移动应用程序中。但是我遵循的说明要求提供沙箱 ID 和生产 ID,但我不知道在 paypal 中的何处可以找到它们。有人可以帮我吗?
这是他们被问到的地方
angular.module('app')
.constant("shopSettings", (function () {
return {
payPalSandboxId: "Aar8HZzvc5NztVWodTBpOiOod9wWrBDrJUjyvRr4WsxcCD28xYig7oecfYsqxQUDu5QHptPpSALirxZD",
payPalProductionId : "production id here",
payPalEnv: "PayPalEnvironmentSandbo", // for testing production for production
payPalShopName : "SenPass",
payPalMerchantPrivacyPolicyURL : "url to policy",
payPalMerchantUserAgreementURL : "url to user agreement"
}
})());
这是我关注的链接:http://ionicandroidlearning.blogspot.fr/2015/11/ionic-paypal-integration.html
最佳答案
- 首先您需要在 paypal developers 上创建一个帐户.
- 然后在仪表板内创建一个新应用程序(REST API 应用程序)。
- 当您创建新应用时,Paypal 会为您生成一个沙盒帐户和一个客户端 ID。
- 添加代码(示例):
var configuration=function () {
var configOptions = {
merchantName: "Some name you have specified",
merchantPrivacyPolicyURL: "http://yourserver/privacypolicy",
merchantUserAgreementURL: "http://yourserver/agreement",
languageOrLocale: "en_US"
};
// for more options see paypal-mobile-js-helper.js
var _config = new PayPalConfiguration( configOptions );
return _config;
}
var onPrepareRender = function(){
$log.info(" ======= onPrepareRender ==========");
}
var onPayPalMobileInit = function(){
var payPalConfig = configuration();
PayPalMobile.prepareToRender("PayPalEnvironmentSandbox", payPalConfig, onPrepareRender);
deferred.resolve( payPalConfig );
}
var clientIDs = {
"PayPalEnvironmentProduction": '', //leave it blank
"PayPalEnvironmentSandbox": 'your sandbox id'
};
PayPalMobile.init(clientIDs, onPayPalMobileInit);
关于angularjs - 将 cordova 插件 paypal 与 ionic 集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41526194/