【发布时间】:2015-08-07 22:30:27
【问题描述】:
我在 iOS 上使用 PayPal sdk 时遇到了一些问题。我在 https://developer.paypal.com/webapps/developer/applications/myapps 创建了我的应用程序并获得了客户端 ID。我使用带有我的 ID 的 paypal 示例应用程序,它在模拟和沙盒模式下工作正常。当我每次在我的应用程序以模拟数据模式移动时在我的应用程序中使用它时,我都会从贝宝服务器获得响应。并且 id 始终是 API-PAYMENT-ID-1843
client = {
environment = mock;
"paypal_sdk_version" = "2.10.2";
platform = iOS;
"product_name" = "PayPal iOS SDK";
};
response = {
"create_time" = "2015-05-26T09:51:13Z";
id = "API-PAYMENT-ID-1843";
intent = sale;
state = approved;
};
"response_type" = payment;
我的代码如下
PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = [NSDecimalNumber decimalNumberWithString:numberStr];
payment.currencyCode = @"USD";
payment.shortDescription = [NSString stringWithFormat:@"Buy %@ Invites",[self.invitesDict objectForKey:@"invites_count"]];
if (!payment.processable) {
// This particular payment will always be processable. If, for
// example, the amount was negative or the shortDescription was
// empty, this payment wouldn't be processable, and you'd want
// to handle that here.
}
_payPalConfig = [[PayPalConfiguration alloc] init];
_payPalConfig.acceptCreditCards = YES;
PayPalPaymentViewController *paymentViewController = [[PayPalPaymentViewController alloc] initWithPayment:payment
configuration:self.payPalConfig
delegate:self];
[self presentViewController:paymentViewController animated:YES completion:nil];
有没有办法解决这个问题
【问题讨论】:
标签: ios paypal paypal-sandbox sandbox