1

在我的 iOS 应用程序中,我使用来自https://www.x.com/developers/paypal/documentation-tools/paypal-sdk-index的 paypal sdk 集成了自适应支付

贝宝更改他们的网站后,我无法使用上述库执行交易。

这是我的代码

    -(void)processSplitPaymentWithFacebuyAdminPayPalId:(NSString*)adminId sellerPayPalId:(NSString*)sellerId withAdminPercentage:(NSNumber*)adminPercentage forTotalAmount:(NSNumber*)totalAmount andShippingCharges:(NSNumber*)shippingCharges
{
    NSLog(@"!!!--------------------------------------");
    NSLog(@"AdminID: %@",adminId);
    NSLog(@"SellerID: %@",sellerId);
    NSLog(@"Admin Percentage: %@",adminPercentage);
    NSLog(@"Total Amount: %@",totalAmount);
    NSLog(@"Shipping Charges: %@",shippingCharges);
    NSLog(@"!!!--------------------------------------");

    PayPal *ppMEP = [PayPal getPayPalInst];
    ppMEP.shippingEnabled = TRUE;
    ppMEP.dynamicAmountUpdateEnabled = TRUE;
    ppMEP.feePayer = FEEPAYER_EACHRECEIVER;
    PayPalAdvancedPayment *payment = [[[PayPalAdvancedPayment alloc] init] autorelease];
    payment.paymentCurrency = @"AUD";

    payment.receiverPaymentDetails = [NSMutableArray array];

    NSArray *emails = [[NSArray alloc]initWithObjects:adminId,sellerId, nil];

    for (int i = 0; i < emails.count; i++)
    {
        PayPalReceiverPaymentDetails *details = [[[PayPalReceiverPaymentDetails
                                                   alloc] init] autorelease];

        details.invoiceData = [[[PayPalInvoiceData alloc] init] autorelease];

        float adminAmount = [adminPercentage floatValue];
        float sellerAmount = [totalAmount floatValue] - adminAmount;


        switch (i) {
            case 0:
                // Admin commission
                details.subTotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%f",adminAmount]];
                details.description = @"Amount payed to Admin as a Commission";
                details.merchantName = [NSString stringWithFormat:@"%@",ADMIN];
                break;
            case 1:
                // Seller amount
                details.invoiceData.totalShipping = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%@",shippingCharges]];
                details.subTotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%f",sellerAmount]];
                details.description = @"Amount payed to Seller";
                details.merchantName = [NSString stringWithFormat:@"%@ : %@",SELLER,@"Seller Name"];
                break;
            default:
                break;
        }

        details.recipient = [emails objectAtIndex:i];
        [payment.receiverPaymentDetails addObject:details];
    }
    [ppMEP advancedCheckoutWithPayment:payment];
    [emails release];
}

但是每次我尝试执行交易时,都会出现以下错误

    errorId: 580022
message: The receiver is based in a country that isn't enabled to receive payments

我的测试帐户是为澳大利亚创建的。我的应用程序仅在澳大利亚可用。

现在我的问题是 1) 即使我的 iOS 应用程序投入生产也有关系吗?2)我们也可以使用上面链接中给出的iOS SDK还是我们需要使用最新的SDK?

我看到了一些链接,但我不清楚出了什么问题。

任何形式的帮助都将受到高度赞赏。谢谢。

更新:

如果我使用美国测试账户,那么我的交易仍然没有完成。

- (void)paymentFailedWithCorrelationID:(NSString *)correlationID

上面的方法被调用&这里是响应

severity: None
category: Application
errorId: 0
message: None

这是一个截图

在此处输入图像描述

4

1 回答 1

1

你能切换到我们新的 iOS 移动支付库吗?旧库现已弃用,鼓励每个人使用新库。

https://developer.paypal.com/webapps/developer/docs/integration/mobile/ios-integration-guide/

于 2013-04-03T22:48:38.037 回答