2

我当前的代码如下:

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 开发者网络的申请已获得批准!您现在可以上线了!

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

需要帮忙?通过https://www.paypal.com/mts/向商户技术服务提交票证“

我在哪里放置实时应用程序 ID?我要更改什么代码?什么是应用程序ID,是iTunes Connect中的应用程序ID吗?

谢谢 :)

4

1 回答 1

0

在下面的方法中

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

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

于 2013-09-03T12:27:07.273 回答