【发布时间】:2016-06-30 13:15:45
【问题描述】:
很抱歉提出这个问题。因为没有与此问题相关的可用链接,但我的意图有点不同,这就是我在此处发布此问题的原因:
在 Apple App Store 中提交应用之前,是否可以使用 PayPal Live Credentials 检查 iOS 应用?
问题是在 Apple 方面有 2 个概念,例如 推送通知 和 应用内购买(生产未开发)我们无法检查测试时间。我觉得 PayPal 也一样。但我对此有点怀疑.....
我在我的应用程序中集成了 paypal,它在沙盒中运行良好,但现在我想在实时应用程序 ID 上实时运行,所以我需要做什么?
这里我面临的问题与:Invalid merchant - payments to this merchant are not allowed (invalid clientId )
注意:我也已经在 developer.paypal.com 中红色了 PayPal iOS SDK 集成过程
(1) "使用向应用程序所有者注册的 PayPal 帐户的凭据登录 PayPal 开发者网站。请注意,与应用程序关联的 PayPal 帐户必须是经过验证的 Premier 或经过验证的 Business 帐户。"
我做了同样的事情。现在我正在使用有效的 LIVE Client id & Sandbox Key。
在 ANDROID 中: LIVE 凭据工作正常
在 iOS 中: 它说的是我上面提到的错误?
我该如何解决这个问题?你能帮帮我吗?
这里我使用如下代码:
#pragma mark
#pragma mark -- connectToPayPalBtnClicked
- (IBAction)connectToPayPalBtnClicked:(id)sender {
// // Create a PayPalPayment
PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = [[NSDecimalNumber alloc] initWithString:@"10.95"];
//we recommend limiting transactions to currencies supported by both payment types. Currently these are: USD, GBP, CAD, EUR, JPY.
payment.currencyCode = @"USD";
payment.shortDescription = @"Awesome saws";
// Check whether payment is processable.
if (!payment.processable) {
// If, for example, the amount was negative or the shortDescription was empty, then
// this payment would not be processable. You would want to handle that here.
}
/*
For Test Account purpose
[PayPalMobile initializeWithClientIdsForEnvironments:@{
PayPalEnvironmentSandbox : PayPalClienKey}];
*/
[PayPalMobile initializeWithClientIdsForEnvironments:@{PayPalEnvironmentProduction : @"AU2qoYgXhfghgfhgfhfghhNS_QYjTSMV_LS4RmG-qbPGdXODlvJXuSE5jXQRAeJEwPvh6h4C",
PayPalEnvironmentSandbox : @"ELQN7GqTJZDCH3Qfr17wyhfghfghgfhhg9esR9fyJ9prL6xKfFURMoAK0PZw0scTB5I6Un "}];
#ifdef CONFIGURATION_ReleaseLive
[PayPalMobile preconnectWithEnvironment:PayPalEnvironmentProduction];
#else
[PayPalMobile preconnectWithEnvironment:PayPalEnvironmentSandbox]; // PayPalEnvironmentSandbox ?
#endif
[self setPayPalConfig:[[PayPalConfiguration alloc] init]];
[[self payPalConfig] setAcceptCreditCards:YES];
[[self payPalConfig] setPayPalShippingAddressOption:PayPalShippingAddressOptionNone];
[[self payPalConfig] setLanguageOrLocale:[NSLocale preferredLanguages][0]];
// Create a PayPalPaymentViewController.
PayPalPaymentViewController *paymentViewController;
paymentViewController = [[PayPalPaymentViewController alloc] initWithPayment:payment
configuration:self.payPalConfiguration
delegate:self];
// Present the PayPalPaymentViewController.
[self presentViewController:paymentViewController animated:YES completion:nil];
}
#pragma mark - PayPalPaymentDelegate methods
- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController
didCompletePayment:(PayPalPayment *)completedPayment {
NSLog(@"PayPal Payment Success!");
// Payment was processed successfully; send to server for verification and fulfillment.
[self verifyCompletedPayment:completedPayment];
// Dismiss the PayPalPaymentViewController.
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)payPalPaymentDidCancel:(PayPalPaymentViewController *)paymentViewController {
NSLog(@"PayPal Payment Canceled");
// The payment was canceled; dismiss the PayPalPaymentViewController.
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)verifyCompletedPayment:(PayPalPayment *)completedPayment {
// Send the entire confirmation dictionary
confirmation = [NSJSONSerialization dataWithJSONObject:completedPayment.confirmation
options:0
error:nil];
NSLog(@"Here is your proof of payment:\n\n%@\n\nSend this to your server for confirmation and fulfillment.", completedPayment.confirmation);
// Send confirmation to your server; your server should verify the proof of payment
// and give the user their goods or services. If the server is not reachable, save
// the confirmation and try again later.
}
【问题讨论】:
标签: ios objective-c