设备上Paypal MPL登录按钮被禁用

6

我浏览了几个类似问题的答案,但没有找到解决办法。我已经按照沙盒模式下给出的步骤进行操作。在执行完代码后,我看到了PayPal弹出窗口。

[[PayPal getPayPalInst] checkoutWithPayment:payment];

在Paypal窗口中,我可以使用电子邮件和密码登录。这在模拟器上有效,但在设备上,即使提供了有效的凭据,登录按钮仍然无法启用。
感谢您的帮助。
我能够运行他们的演示示例。但是当我更改包标识符并检查时,Paypal窗口中的登录按钮未启用。
现在我发现它对于我的特定包标识符被禁用了,因为当我使用具有其包标识符的不同配置文件时,它可以工作。
我们必须注册我们的包标识符吗?还是有任何特别的原因。
我正在使用Paypal MPL版本2.1.0。

你从apps.paypal.com获取了自己的appId吗? - Praveen
@Praveen 不,我的应用已经在应用商店上线了。我正在使用开发者配置文件的捆绑标识符,但当我更改并使用其他配置文件时,它可以正常工作。 - the1pawan
@Praveen 我正在使用沙盒模式的Paypal MPL。 - the1pawan
2个回答

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

0
请仔细检查销售账户“sunny.g-faciliator@intelgain.com”(receiverEmail)- 我猜应该是“sunny.g-facilitator@intelgain.com”(facilitator中缺少一个“t”),这可能会导致问题。

是的,你关于那个错误是正确的,但那不是问题。登录按钮仍然保持禁用状态。而且我的有时候可以工作,即登录按钮是启用的,但大多数时间它是禁用的。 - the1pawan
嗨,我使用最新版的iOS SDK 运行了一个快速测试,登录按钮工作正常。我想我可能会把关注点放在使用的电子邮件地址上,请尝试使用不含点的电子邮件地址进行登录吧(例如sanket@intelgain.com)。 - PayPal_Federica
我正在使用MPL而不是SDK,并且我已经使用了没有“.”的电子邮件ID(例如jagan@intelgain.com)。但问题仍然存在。 - the1pawan
@PayPal_Federica 我们正在面临同样的问题。我认为不是邮箱地址的问题。相同的应用在模拟器上运行良好,但在运行iOS 7.0.4的设备上,“支付”按钮被禁用。 - codetiger

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接