【问题标题】:PayPal Adaptive Pay 589023贝宝自适应支付 589023
【发布时间】:2012-03-01 15:50:59
【问题描述】:

我目前正在尝试在我的应用程序中实现 django-paypal-adaptive 支付,并遇到了由于 589023 - If a fractional amount is rounded due to currency conversion, funds could be lost 而导致链式支付无法正常工作的实例

在我们的网站上,我们收取 6% 的佣金,下面是我们拥有的代码的简单示例。

amount = 5
commission = amount * 0.06
# commission = 0.3
data['receiverList'] = {'receiver': [{'email': settings.PAYPAL_EMAIL, 
    'amount': unicode(amount),
    'primary': 'true'}, 
    {'email': secondary_receiver, 
    # 'amount': unicode(5 - 0.3),
    'amount': unicode(amount - commission),
    'primary': 'false'}]}

我可以通过其他方式计算金额吗? 我应该对佣金进行不同的计算吗?

欢迎任何提示。

【问题讨论】:

    标签: python django paypal


    【解决方案1】:

    这就是我们在 iPhone 应用程序中解决 Paypal(沙盒)错误“589023”的方法:

    -(void)payWithPayPal{
        for (int i=0;i<numberOfReceipents; i++) {  
            PayPal  *payPal=[PayPal  getPayPalInst];
            payPal.shippingEnabled = FALSE;
            payPal.dynamicAmountUpdateEnabled = NO;
            payPal.feePayer = FEEPAYER_EACHRECEIVER;
    
            PayPalPayment *payment = [[[PayPalPayment alloc] init] autorelease];
            payment.recipient = @"UKMCA2010@GMAIL.COM";    
            payment.paymentCurrency = @"USD";
            payment.description = @"Payment Discription here...";
    
            SampleSingleton *sample=[SampleSingleton sharedInstance];
            payment.merchantName =[sample getStrRestaurantName]; 
            payment.invoiceData = [[[PayPalInvoiceData alloc] init] autorelease];
            payment.invoiceData.invoiceItems = [NSMutableArray array];   
    
            PayPalInvoiceItem *item = [[PayPalInvoiceItem alloc] init];               
            item.totalPrice=[NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f", 126.34545]]; // If u give xxx.xx , no need to give the %.2f , u can give directly %f
    
            item.name = objTempReceived.strItemName;
            item.itemId = @"Item ID";
    
            [payment.invoiceData.invoiceItems addObject:item];
    
            [item release];
        }
    
        payment.subTotal = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f",126.34545]]; //Total and Subtotal must be equal   
        payment.invoiceData.totalTax = [NSDecimalNumber decimalNumberWithString:[NSString stringWithFormat:@"%.2f",3.34]];
    
        NSLog(@"Total Tax is :%@",[payment.invoiceData.totalTax stringValue]);
    
        [payPal checkoutWithPayment:payment];
    }
    

    【讨论】:

      猜你喜欢
      • 2012-10-25
      • 2011-05-06
      • 2014-02-19
      • 2016-02-02
      • 2012-06-21
      • 2015-06-29
      • 2012-11-05
      相关资源
      最近更新 更多