【问题标题】:Paypal MPL IOS not calling - (void)paymentSuccessWithKeyPaypal MPL IOS 未调用 - (void)paymentSuccessWithKey
【发布时间】:2013-07-15 11:11:19
【问题描述】:

大家好,我遇到了一个问题,那就是 paypal 代表 -

(void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus {

事务成功并结束时永远不会调用。这是我的代码

- (void)viewDidLoad
{
    [super viewDidLoad];

    [PayPal initializeWithAppID:kPayPalAPI
                 forEnvironment:ENV_SANDBOX];
    // Do any additional setup after loading the view from its nib.
}


-(IBAction)payWithPayPal{

    PayPalPayment *payment = [[[PayPalPayment alloc] init] autorelease];
    payment.recipient = @"xxxx@mail.com";
    payment.paymentCurrency = @"EUR";
    payment.description =[NSString stringWithFormat:@"test tetst %@",stest];
    payment.merchantName = @"Test product";

    //subtotal of all items, without tax and shipping
    payment.subTotal = [NSDecimalNumber decimalNumberWithString:txtMontant.text];

    PayPalInvoiceItem *item = [[[PayPalInvoiceItem alloc] init] autorelease];
    item.totalPrice = payment.subTotal;
    item.name = @"Test";
    [payment.invoiceData.invoiceItems addObject:item];

    [[PayPal getPayPalInst] checkoutWithPayment:payment];

}

我已经设置了这样的委托 ViewController : UIViewController<UITextFieldDelegate,PayPalPaymentDelegate> 。有什么我想念的吗?

【问题讨论】:

  • 你在 iOS 6 中使用它吗
  • 此方法在 iOS 6 中不起作用,请检查其他方法
  • 哪种方法:- (void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus { ?
  • 是的,伙计:)这个方法
  • 问题是我必须使用提供的按钮。它在初始化完成后启用。感谢您的时间和帮助@Divz

标签: iphone ios paypal paypal-sandbox


【解决方案1】:

如果你想得到paykey

使用这种方法:

(void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus 

使用您自己的自定义按钮。试试下面的代码:

 _your_custom_button = [[PayPal getPayPalInst]getPayButtonWithTarget:self
                       andAction:@selector(paywithpaypal)
                       andButtonType:BUTTON_278x43
                       andButtonText:BUTTON_TEXT_PAY];

并以paywithpaypal方式付款。

【讨论】:

    猜你喜欢
    • 2013-09-07
    • 2016-08-19
    • 2012-09-19
    • 2013-07-23
    • 2014-04-05
    • 2013-05-20
    • 2014-04-04
    • 2015-11-30
    • 2015-06-10
    相关资源
    最近更新 更多