【问题标题】:TRANSACTION_REFUSED - The transaction was refused. in paypal ios sdkTRANSACTION_REFUSED - 交易被拒绝。在贝宝 ios sdk
【发布时间】:2014-04-15 06:17:24
【问题描述】:

我在 appdelegate 中使用以下代码

[PayPalMobile initializeWithClientIdsForEnvironments:@{PayPalEnvironmentProduction : @"some client id"}];

并使用此代码进行 paypalpayment

#define kPayPalEnvironment PayPalEnvironmentProduction


- (void)viewDidLoad
{
    [super viewDidLoad];

    // Set up payPalConfig
    _payPalConfig = [[PayPalConfiguration alloc] init];
    _payPalConfig.acceptCreditCards = YES;
    _payPalConfig.languageOrLocale = @"en";
    _payPalConfig.merchantName = @"Anything";

    _payPalConfig.languageOrLocale = [NSLocale preferredLanguages][0];

    // Do any additional setup after loading the view, typically from a nib.

    // use default environment, should be Production in real life
    self.environment = kPayPalEnvironment;

    NSLog(@"PayPal iOS SDK version: %@", [PayPalMobile libraryVersion]);
}

- (IBAction)btnPaypalClicked:(UIButton *)sender
{
    PayPalPayment *payment = [[PayPalPayment alloc] init];
    payment.amount = [[NSDecimalNumber alloc] initWithString:@"5"];
    payment.currencyCode = @"GBP";
    payment.shortDescription = @"anything";


    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 = [[PayPalPaymentViewController alloc] initWithPayment:payment
                                                                                                configuration:self.payPalConfig
                                                                                                     delegate:self];
    [self presentViewController:paymentViewController animated:YES completion:nil];
}


- (void)payPalPaymentViewController:(PayPalPaymentViewController *)paymentViewController didCompletePayment:(PayPalPayment *)completedPayment
{
    NSLog(@"PayPal Payment Success!");
    NSLog(@"%@",completedPayment);

    [self saveCompletedPayment:completedPayment]; // Payment was processed successfully; send to server for verification and fulfillment
    [self dismissViewControllerAnimated:YES completion:nil];
}

我正在使用上述所有代码进行贝宝付款。 但是当我付款时显示以下错误

TRANSACTION_REFUSED - 交易被拒绝。

我的 paypal 帐户中有余额,但仍然出现此错误。

我还缺少什么吗?

请帮我解决这个问题。

提前致谢。

【问题讨论】:

    标签: ios iphone paypal


    【解决方案1】:

    请参阅https://github.com/paypal/PayPal-iOS-SDK/issues/111 的讨论 拒绝的原因是很遗憾,无法使用所选的资金来源完成付款。请尝试使用其他资金选项。

    【讨论】:

      猜你喜欢
      • 2014-09-01
      • 2012-08-31
      • 2014-02-01
      • 2019-05-15
      • 2015-10-13
      • 1970-01-01
      • 2020-07-30
      • 2021-11-01
      • 2015-08-11
      相关资源
      最近更新 更多