gpt4 book ai didi

ios - 在 Apple App Store 中提交应用程序之前,是否可以使用 PayPal Live Credentials(客户端 ID 和沙盒 ID)测试 iOS 应用程序?

转载 作者:行者123 更新时间:2023-11-29 12:03:22 25 4
gpt4 key购买 nike

很抱歉问这个问题。因为没有与这个问题相关的可用链接,但我的意图有点不同,这就是我只在这里发布这个问题的原因:

在 Apple App Store 中提交应用程序之前,是否可以使用 PayPal Live Credentials 检查 iOS 应用程序?

事情是在 Apple 方面有 2 个概念,例如 Push NotificationIn-App Purchase(Production not in Development)我们无法检查测试时间。我觉得 Paypal 也一样。但我对此有点怀疑......

通过使用:https://simicart.zendesk.com/hc/en-us/articles/214860237-How-To-Obtain-API-Client-ID-And-Secret-Key-Within-Your-Paypal-Account-

我在我的应用程序中集成了 paypal,它在沙盒中运行良好,但现在我想在实时应用程序 ID 上运行,所以我需要做什么?

我在这里面临与以下问题相同的问题:Invalid merchant - payments to this merchant are not allowed (invalid clientId )

注意:我也已经在 developer.paypal.com 中红色了 PayPal iOS SDK 集成过程

(1) “使用向应用程序所有者注册的 PayPal 帐户的凭据登录到 PayPal 开发者网站。请注意,与应用程序关联的 PayPal 帐户必须是经过验证的 Premier 或经过验证的商业帐户。”

我做了同样的事情。现在我正在使用有效的实时客户端 ID 和沙箱 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.
}

最佳答案

是的,您可以测试实时凭据。它不需要 Apple 与推送通知或应用内购买相同的权限。

除了在您的 appDelegate 中添加生产 clientID 之外,您还需要在加载 PayPalPaymentViewController 的任何 viewController 的 viewWillAppear 部分中添加此行:

[PayPalMobile preconnectWithEnvironment:PayPalEnvironmentProduction];

现在,当加载 PayPal 结帐 View 时,您可以使用您自己的实际 Paypal 帐户(请小心,因为如果您付款,它将是真钱)而不是您设置的开发人员帐户。

关于ios - 在 Apple App Store 中提交应用程序之前,是否可以使用 PayPal Live Credentials(客户端 ID 和沙盒 ID)测试 iOS 应用程序?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36005517/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com