gpt4 book ai didi

iphone - 如何使用 PayPal API Xcode 上线

转载 作者:太空宇宙 更新时间:2023-11-03 15:51:05 25 4
gpt4 key购买 nike

我目前的代码如下:

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/

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