objective-c - Paypal 状态待处理

标签 objective-c paypal

大家好,我的应用程序中我必须使用 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

在此之后,您的测试将恢复正常,它们也将获得批准

设置截图:

First Step

Second Step

Last Step

修改后不要忘记保存设置:)

关于objective-c - Paypal 状态待处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23380713/

相关文章:

使用 Website Payments Pro(或类似工具)的 PayPal 链式支付

ios - 无法设置从 iPhone 到 iPad 全屏的大小

objective-c - 具有多个条件的“if”语句

loops - Paypal DoCapture 批处理循环

paypal - woocommerce 订阅免费试用文本

paypal - 续订的 Paypal IPN是什么样的?

ruby-on-rails - Paypal - 使用 Rails 定期计费(适用于非美国商家)

objective-c - Http 日期到 NSDate

ios - 如何在 iOS 中创建自动完成 [实时] 文本字段,它会在您键入时提供建议

objective-c - NSTokenField 表示核心数据对多关系