如何使用 PayPal API Xcode 上线

Posted

技术标签:

【中文标题】如何使用 PayPal API Xcode 上线【英文标题】:How to go live with the PayPal API Xcode 【发布时间】:2013-09-06 16:23:33 【问题描述】:

我目前的代码如下:

PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = [[NSDecimalNumber alloc] initWithString:[NSString stringWithFormat:@"%.2f",totalCost]];
payment.currencyCode = @"GBP";
payment.shortDescription = [NSString stringWithFormat:@"Order ID : #%@", orderNumber];

// 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.



// Start out working with the test environment! When you are ready, remove this line to switch to live.
[PayPalPaymentViewController setEnvironment:PayPalEnvironmentProduction];

// Provide a payerId that uniquely identifies a user within the scope of your system,
// such as an email address or user ID.
NSString *aPayerId = [NSString stringWithFormat:@"%@_%@",[nameField.text stringByReplacingOccurrencesOfString:@" " withString:@""], orderNumber];

// Create a PayPalPaymentViewController with the credentials and payerId, the PayPalPayment
// from the previous step, and a PayPalPaymentDelegate to handle the results.

paymentViewController = [[PayPalPaymentViewController alloc] initWithClientId:<live credentials>
                                                                receiverEmail:<recievers email>
                                                                      payerId:aPayerId
                                                                      payment:payment
                                                                     delegate:self];



// Present the PayPalPaymentViewController.
[self presentViewController:paymentViewController animated:YES completion:nil];

我在 paypal 上注册了应用,我收到了这样的回复:

“恭喜!您提交给 PayPal 开发者网络的申请已获得批准! 您现在可以开始直播了!

为了使您的应用程序上线,请确保您: 在代码中将测试应用 ID 替换为您的实时应用 ID。 您的 Live APP ID 是: 确保将您的 Sandbox API 凭据替换为您的实时 API 凭据。

需要帮助吗? 通过https://www.paypal.com/mts/"

向商户技术服务提交工单

我将实时应用 ID 放在哪里?我要更改什么代码? app id是什么,是itunes connect中的app id吗??

谢谢:)

【问题讨论】:

【参考方案1】:

在下面的方法中

paymentViewController = [[PayPalPaymentViewController alloc] initWithClientId:<live credentials>
                                                            receiverEmail:<recievers email>
                                                                  payerId:aPayerId
                                                                  payment:payment
                                                                 delegate:self];

用您的应用程序的客户端 ID 替换“实时凭据”,应用程序 ID 是您的贝宝应用程序 ID,因此在完成时必须向您提供您的应用程序创建及其 ID 看看您的贝宝帐户,您会找到它.

【讨论】:

您好,谢谢,我输入了我的实时凭据。我从 PayPal 获得了我的实时应用程序 ID,以 AP-..... 等开头。我很困惑,因为它说把它放到你的代码中。实时应用 ID 在代码中的什么位置?是捆绑标识符,它是在实际课程中,还是我在 PayPal 方面进行了更改。谢谢

以上是关于如何使用 PayPal API Xcode 上线的主要内容,如果未能解决你的问题,请参考以下文章

Paypal:从沙盒上线

用于 PayPal RESTful API 的 PHP SDK 上线错误

PayPal 支付 REST API - 可用性?

PayPal:仪器在使用 API 处于实时模式时被拒绝

如何从新的 Paypal Sync Api 获取销售 ID

通过 PayPal REST API 示例打折?