initialize method

dynamic initialize(
  1. BuildContext context
)

Implementation

initialize(BuildContext context){

  ExpresspaySdk.instance.ADAPTER.APPLE_PAY.execute(
      applePayMerchantId: _applePayMerchantID ?? "",
      order: _order!,
      payer: _payer!,
      callback: ApplePayResponseCallback(
          authentication: (Map response) {
            Log(response.toString());
            _onAuthentication!(response);
          },
          success: (Map response){
            Log(response.toString());
            _onTransactionSuccess!(response);
          },
          failure: (Map response){
            Log(response.toString());
            _onTransactionFailure!(response);
          },
          error: (Map error){
            _onError!(error);
          },
      )
  );

  Future.delayed(const Duration(milliseconds: 200)).then((value) {
    if(_onPresent != null) {
      _onPresent!(context);
    }
  });
}