iphone - 如何使用 PayPal API Xcode 上线

标签 iphone ios xcode paypal live

我目前的代码如下:

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吗??

谢谢:)

最佳答案

在下面的方法中

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

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

关于iphone - 如何使用 PayPal API Xcode 上线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18592197/

相关文章:

iphone - 简单的 UITapGestureRecognizer。 IBAction 未触发

ios - 使用sqlite3 sqlcipher DB,如何? (iOS)

iphone - GKSession sendDataToAllPeers 在客户端上?

iphone - 解密时 OSStatus -9809

iphone - 从 IOS 应用程序注销的完美方法是什么?

ios - StartInterval 键如何影响启动的守护进程

iphone - 无需 App Store iPhone 下载并安装应用程序

ios - 如何通过动画同时增加单元格高度和 subview 高度?

ios - 如何使用 Stackview 消费整个 View

ios - Xcode UI 测试 - 如何在 WebView 中查找和点击()元素