2017-01-07 127 views
1

我试图使用贝宝科尔多瓦插件集成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

+0

对不起,我不明白什么是你的问题..你不知道从哪里得到来自门户网站贝宝钥匙? ..或如何设置您的离子应用程序中的这些键? –

回答

1
  1. 首先,你需要在paypal developers上创建一个帐户。
  2. 然后在仪表板内部创建一个新应用程序(REST API应用程序)。 dashboard
  3. 当您创建新应用程序时,Paypal将为您生成一个沙箱帐户和一个客户端ID
  4. 添加代码(例如):

var configuration=function() { 
 
\t var configOptions = { 
 
\t \t merchantName: "Some name you have specified", 
 
\t \t merchantPrivacyPolicyURL: "http://yourserver/privacypolicy", 
 
\t \t merchantUserAgreementURL: "http://yourserver/agreement", 
 
\t \t languageOrLocale: "en_US" 
 
\t }; 
 
    // for more options see paypal-mobile-js-helper.js 
 
    var _config = new PayPalConfiguration(configOptions); 
 
    return _config; 
 
} 
 
var onPrepareRender = function(){ 
 
\t $log.info(" ======= onPrepareRender =========="); \t \t \t \t 
 
} \t 
 

 
var onPayPalMobileInit = function(){ 
 
\t var payPalConfig = configuration(); \t \t \t \t 
 
\t PayPalMobile.prepareToRender("PayPalEnvironmentSandbox", payPalConfig, onPrepareRender); 
 
\t deferred.resolve(payPalConfig); 
 
} 
 

 
var clientIDs = { \t 
 
\t "PayPalEnvironmentProduction": '', //leave it blank 
 
\t "PayPalEnvironmentSandbox": 'your sandbox id' 
 
}; 
 

 
PayPalMobile.init(clientIDs, onPayPalMobileInit);

+0

好吧我设法通过生成沙箱id并返回到帐户的配置文件。我想这就是我必须把我的** payPalSandboxId **变量。那么** payPalEnv **还是应该保留空白? – lakhassane

+0

我没有使用** payPalEnv **,在我粘贴的代码片段中就是您需要的全部内容。看看我怎么把这些信息传递给PayPalEnvironmentSandbox ** – Hosar

+0

好吧,我要用相同的方式来实现它,看看它会如何。 – lakhassane

0

以检索贝宝沙箱钥匙试着去这里:

https://developer.paypal.com/developer/accounts/ 

点击您的帐户产生用于测试(表),然后对资料...它打开一个模式与某些选项卡..选择API Credential tab

希望它可以帮助你

+0

好的,谢谢我已经看到你正在谈论的信息。他们真的是我在我的文章中所做的截图中需要的吗? – lakhassane

+0

@federico scamuzzi你能帮我解决这个问题吗? https://stackoverflow.com/questions/44393955/add-paypal-payment-method-ionic/44394436?noredirect=1#comment75790178_44394436 – Stuart2041