设备上禁用了Paypal MPL登录按钮 [英] Paypal MPL login button disabled on device

查看:132
本文介绍了设备上禁用了Paypal MPL登录按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了几个类似问题的问题,但找不到任何解决方法。我已经按照沙盒模式下的步骤进行了操作..在下面的代码后我得到了paypal窗口。

I have gone through several questions with similar problem but could not find any solution for it. I have followed steps given working in sandbox mode.. after following code i get paypal window.

[[PayPal getPayPalInst] checkoutWithPayment:payment];

在paypal窗口,我可以使用电子邮件和密码登录。它在模拟器上工作,但在设备登录按钮后,在提供有效凭据后仍然处于禁用状态。

In paypal window i can login using email and password. which works on simulator but on device log in button remains disabled after giving valid credentials.

提前致谢

我能够运行那里有演示示例。但是当我更改捆绑包标识符并检查然后登录按钮未在paypal窗口中启用

i am able to run there demo example. but when i change bundle identifier and check then log in button is not enable in paypal window

现在我发现它已禁用我的特定捆绑标识符,因为我使用不同配置文件及其捆绑标识符工作。

Now i found out that its disabled for my particular bundle identifier as when i use different profile with its bundle identifier its working.

我们是否必须注册我们的包标识符?或者它的任何特殊原因。

Do we have to register our bundle identifier? or any particular reason for it.

我使用的是Paypal MPL 2.1.0版。

推荐答案

-(void)ChainPayment
{
[PayPal getPayPalInst].shippingEnabled = TRUE;

//optional, set dynamicAmountUpdateEnabled to TRUE if you want to compute
//shipping and tax based on the user's address choice, default: FALSE
[PayPal getPayPalInst].dynamicAmountUpdateEnabled = FALSE;

//optional, choose who pays the fee, default: FEEPAYER_EACHRECEIVER
[PayPal getPayPalInst].feePayer = FEEPAYER_EACHRECEIVER;

//for a payment with multiple recipients, use a PayPalAdvancedPayment object
PayPalAdvancedPayment *payment = [[PayPalAdvancedPayment alloc] init] ;
payment.paymentCurrency = @"USD";

//receiverPaymentDetails is a list of PPReceiverPaymentDetails objects
payment.receiverPaymentDetails = [NSMutableArray array];

//NSArray *nameArray = [NSArray arrayWithObjects:@"Frank's", @"Robert's", @"Julie's",nil];

for (int i = 1; i <= 2; i++)
{
    PayPalReceiverPaymentDetails *details = [[PayPalReceiverPaymentDetails alloc] init];

    details.description = @"Bear Components";
    if(i==1)
    {
        details.recipient =[[[_emailDictionary valueForKey:@"secondary"] valueForKey:@"1"] valueForKey:@"email"];//[NSString stringWithFormat:@"example-merchant-%d@paypal.com", 4 - i];
    }
    if(i==2)
    {
        details.recipient =[[_emailDictionary valueForKey:@"primary"] valueForKey:@"email"];// [NSString stringWithFormat:@"example-merchant-%d@paypal.com", 4 - i];

    }
    details.merchantName = [NSString stringWithFormat:@"merchant  name"];

    /*unsigned long long order, tax, shipping;
     order = i * 100;
     tax = 0.0;
     shipping =0.0;
     primary =     {
     email = "m,b@rew.com";
     "first_name" = aj;
     "last_name" = Shar;
     plan = Free;
     "profit_percent" = 68;
     "reffer_from" = "<null>";
     };
     secondary =     {
     1 =         {
     email = "pushnd@gmail.com";
     "profit_percent" = 32;
     };
     };
     }

     //subtotal of all items for this recipient, without tax and shipping
     details.subTotal = [NSDecimalNumber decimalNumberWithMantissa:order exponent:-2 isNegative:FALSE];

     //invoiceData is a PayPalInvoiceData object which contains tax, shipping, and a list of PayPalInvoiceItem objects
     details.invoiceData = [[PayPalInvoiceData alloc] init];
     details.invoiceData.totalShipping = [NSDecimalNumber decimalNumberWithMantissa:shipping exponent:-2 isNegative:FALSE];
     details.invoiceData.totalTax = [NSDecimalNumber decimalNumberWithMantissa:tax exponent:-2 isNegative:FALSE];

     //invoiceItems is a list of PayPalInvoiceItem objects
     //NOTE: sum of totalPrice for all items must equal details.subTotal
     //NOTE: example only shows a single item, but you can have more than one
     details.invoiceData.invoiceItems = [NSMutableArray array];
     PayPalInvoiceItem *item = [[PayPalInvoiceItem alloc] init];
     NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:_price];

     details.subTotal=number;
     item.totalPrice = details.subTotal;
     item.name = @"Audio";
     [details.invoiceData.invoiceItems addObject:item];*/

    //the only difference between setting up a chained payment and setting
    //up a parallel payment is that the chained payment must have a single
    //primary receiver.  the subTotal + totalTax + totalShipping of the
    //primary receiver must be greater than or equal to the sum of
    //payments being made to all other receivers, because the payment is
    //being made to the primary receiver, then the secondary receivers are
    //paid by the primary receiver.
    if (i == 2)
    {
        details.isPrimary = TRUE;
        details.merchantName = [NSString stringWithFormat:@"mercahnt name or app name"];
        NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:_price];
        details.subTotal=number;

    }
    else
    {

        float secondaryPrice=[_price floatValue];
        secondaryPrice=(secondaryPrice*[[[[_emailDictionary valueForKey:@"secondary"] valueForKey:@"1"] valueForKey:@"profit_percent"] integerValue])/100;
        NSNumberFormatter *fmt = [[NSNumberFormatter alloc] init];
        [fmt setMaximumFractionDigits:2];
        NSString *stringPrice=[fmt stringFromNumber:[NSNumber numberWithFloat:secondaryPrice]];
        NSDecimalNumber *number = [NSDecimalNumber decimalNumberWithString:stringPrice];
        details.subTotal=number;
    }

    [payment.receiverPaymentDetails addObject:details];
}
[[PayPal getPayPalInst] advancedCheckoutWithPayment:payment];
   }

这篇关于设备上禁用了Paypal MPL登录按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆