大家好,我的应用程序中我必须使用 Paypal 支付挪威货币 (NOK),一切都很好,但是当我使用沙箱测试 Paypal 时,状态显示为挂起,而当我尝试使用相同的代码使用美元时,状态是同意为什么会这样。 这是我的代码和回复
@try
{
self.resultText = nil;
NSUserDefaults *defpay=[NSUserDefaults standardUserDefaults];
NSString *mon=[defpay objectForKey:@"month"];
app *ap=[app new];
dictpay=[ap paypal:mon category:_strcategoryid1 catid:_strpostid1];
NSString *strprice=[dictpay objectForKey:@"price"];
_lbl.text=strprice;
NSLog(@"%@", _lbl.text);
PayPalPayment *payment = [[PayPalPayment alloc] init];
payment.amount = [[NSDecimalNumber alloc] initWithString:strprice];
//payment.amount = [[NSDecimalNumber alloc] initWithString:@"12"];
payment.currencyCode = @"NOK";
payment.shortDescription = @"Payment";
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.
}
// Update payPalConfig re accepting credit cards.
self.payPalConfig.acceptCreditCards = self.acceptCreditCards;
PayPalPaymentViewController *paymentViewController;
paymentViewController = [[PayPalPaymentViewController alloc] initWithPayment:payment
configuration:self.payPalConfig
delegate:self];
// Present the PayPalPaymentViewController.
[self presentViewController:paymentViewController animated:YES completion:nil];
}
@catch(NSException *e)
{
NSLog(@"%@",e.reason);
}
Here is the response which i got for NOK
client = {
environment = sandbox;
"paypal_sdk_version" = "2.0.5";
platform = iOS;
"product_name" = "PayPal iOS SDK";
};
response = {
"create_time" = "2014-04-30T05:43:49Z";
id = "PAY-7DX14671UN8535156KNQI3FI";
intent = sale;
state = pending;
};
"response_type" = payment;
}
最佳答案
我有同样的问题,问题是买家使用的货币不是卖家的默认货币,默认情况下 paypal 设置了一些东西,比如手动批准不同的货币,因为他们有转换费。
登录到您的沙盒帐户,点击个人资料,然后选择我的销售偏好,然后在该页面上点击付款接收偏好。然后选择
允许以我不持有的货币向我付款 是的,接受并将它们转换为 blabla
在此之后,您的测试将恢复正常,它们也将获得批准
设置截图:
修改后不要忘记保存设置:)
关于objective-c - Paypal 状态待处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23380713/