initialize method

dynamic initialize(
  1. BuildContext context
)

Implementation

initialize(BuildContext context) {
  TotalPaySdk.instance.ADAPTER.CARD_PAY.execute(
      order: _order!,
      payer: _payer!,
      callback: CardPayResponseCallback(
          success: (TotalPayTransactionDetailsSuccess response) {
        Log(response.toJson().toString());
        _onTransactionSuccess!(response);
      }, failure: (TotalPayTransactionDetailsSuccess response) {
        Log(response.toJson().toString());
        _onTransactionFailure!(response);
      }, error: (TotalPayError error) {
        _onError!(error);
      }),
      onFailure: (err) {});
  Future.delayed(const Duration(milliseconds: 200)).then((value) {
    if (_onPresent != null) {
      _onPresent!(context);
    }
  });
}