【发布时间】:2014-06-16 08:07:24
【问题描述】:
大家好,我的应用程序中的每个人我都必须使用 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);
}
这是我收到的 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;
}
【问题讨论】:
-
沙盒卖家账户的配置方式必须使您能够接受非美元货币的付款。如果您登录卖家账户,您是否会看到旁边带有接受和拒绝按钮的交易?
-
谁能帮我解决这个问题。我卡在这里不知道该怎么办
-
你是否愿意承认我问你的问题,以便我可以帮助你?
标签: objective-c paypal