【问题标题】:iOS - How to retrieve transaction ID from paypal after successful transaction in iPhoneiOS - 如何在 iPhone 中成功交易后从贝宝检索交易 ID
【发布时间】:2012-09-14 06:16:58
【问题描述】:

我是 iPhone 开发的新手,我已经在我的 iPhone 应用程序中实现了 paypal sdk 并检查了沙盒环境,一切都运行良好, 但是我需要在成功完成后找到贝宝返回的交易 ID。 我已经检查了下面的这个功能

- (void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus 
{
     status = PAYMENTSTATUS_SUCCESS;
}

但它只显示状态。

【问题讨论】:

    标签: iphone paypal


    【解决方案1】:

    您是否查看过 PayPal 提供的示例应用程序。这是示例应用程序中的委托方法,按照此您可以从中获取 transactionId...

    //paymentSuccessWithKey:andStatus: is a required method. in it, you should record that the payment
    //was successful and perform any desired bookkeeping. you should not do any user interface updates.
    //payKey is a string which uniquely identifies the transaction.
    //paymentStatus is an enum value which can be STATUS_COMPLETED, STATUS_CREATED, or STATUS_OTHER
    - (void)paymentSuccessWithKey:(NSString *)payKey andStatus:(PayPalPaymentStatus)paymentStatus 
    {
        NSString* transactionId = [[NSString alloc] initWithString:[payKey substringFromIndex:3]];
        status = PAYMENTSTATUS_SUCCESS;
    
        [self messageAlert:[NSString stringWithFormat:@"%@",transactionId] 
                 title:@"Transaction success" delegate:nil];
        [transactionId release];
    }
    

    【讨论】:

      猜你喜欢
      • 2016-01-04
      • 1970-01-01
      • 2015-08-11
      • 1970-01-01
      • 2014-11-20
      • 2018-02-16
      • 1970-01-01
      • 2012-08-31
      • 2013-08-09
      相关资源
      最近更新 更多