Paypal Sandbox不适用于使用Paypal iOS SDK的非美国开发者

时间:2013-03-29 12:05:14

标签: ios6 paypal payment-gateway paypal-sandbox paypal-adaptive-payments

在我的iOS应用中,我使用来自https://www.x.com/developers/paypal/documentation-tools/paypal-sdk-index

的paypal sdk整合了自适应付款

在paypal更改了他们的网站后,我无法使用上面的库执行交易。

这是我的代码

    -(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?

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

非常感谢任何形式的帮助。感谢。

更新:

如果我使用美国测试帐户,那么我的交易仍未完成。

- (void)paymentFailedWithCorrelationID:(NSString *)correlationID

以上方法被称为&amp;这是回复

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

这是截图

enter image description here

1 个答案:

答案 0 :(得分:1)

您可以切换到我们针对iOS的新移动支付库吗?旧版本现已弃用,鼓励所有人使用新库。

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