gpt4 book ai didi

ios - TRANSACTION_REFUSED - 交易被拒绝。在 Paypal ios sdk

转载 作者:太空宇宙 更新时间:2023-11-03 16:09:40 25 4
gpt4 key购买 nike

我在 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];
}

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

TRANSACTION_REFUSED - 交易被拒绝。

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

还有什么我想念的吗。

请帮我解决这个问题。

提前致谢。

最佳答案

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

关于ios - TRANSACTION_REFUSED - 交易被拒绝。在 Paypal ios sdk,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22329066/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com