1

私はiPhone開発に不慣れで、iPhoneアプリにpaypal sdkを実装し、サンドボックス環境で確認しました。すべてが完全に機能していますが、正常に完了した後にpaypalから返されたトランザクションIDを見つける必要があります。以下のこの機能で確認しました

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

しかし、それは私にステータスを示しているだけです。

4

1 に答える 1

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];
}
于 2012-09-14T07:23:58.263 に答える