0

应用程序崩溃,崩溃的原因是

“没有委托设置?......你打算如何回调?”

设置了 PGTransactionViewController 的委托。但它仍然没有调用委托方法。

        PGTransactionViewController *txnController = [[PGTransactionViewController alloc]
                                                  initTransactionForOrder:pgOrder];
#if SERVER_PRODUCTION
    txnController.serverType = eServerTypeProduction;
#else
    txnController.serverType = eServerTypeStaging;
#endif

    txnController.merchant = [PGMerchantConfiguration defaultConfiguration];

    // Set the Delegates
    txnController.delegate = self;
    [self.hostViewController.navigationController pushViewController:txnController animated:YES];

该类是 NSObject 的子类。

4

1 回答 1

0

你在使用这些委托方法吗?

  - (void)didSucceedTransaction:(PGTransactionViewController *)controller
                     response:(NSDictionary *)response
{
    DEBUGLOG(@"ViewController::didSucceedTransactionresponse= %@", response);

}

- (void)didFailTransaction:(PGTransactionViewController *)controller error:(NSError *)error response:(NSDictionary *)response
{
    DEBUGLOG(@"ViewController::didFailTransaction error = %@ response= %@", error, response);

}

- (void)didCancelTransaction:(PGTransactionViewController *)controller error:(NSError*)error response:(NSDictionary *)response
{
    DEBUGLOG(@"ViewController::didCancelTransaction error = %@ response= %@", error, response);

}

- (void)didFinishCASTransaction:(PGTransactionViewController *)controller response:(NSDictionary *)response
{
    DEBUGLOG(@"ViewController::didFinishCASTransaction:response = %@", response);
}
于 2017-02-06T07:24:06.460 回答