fromJson static method

SelectedPaymentMethod fromJson(
  1. dynamic params
)

Implementation

static SelectedPaymentMethod fromJson(params) {
  String type = params['type'];
  String? method = params['method'];

  String? easyPayProvider = params['easyPay']?['provider'];
  EasyPay? easyPay =
      (easyPayProvider != null) ? EasyPay(provider: easyPayProvider) : null;

  String? transferProvider = params['transfer']?['provider'];
  Transfer? transfer = (transferProvider != null)
      ? Transfer(provider: transferProvider)
      : null;

  String? paymentMethodKey = params['paymentMethodKey'];
  String? methodId = params['methodId'];

  return SelectedPaymentMethod(
      type: type,
      method: method,
      easyPay: easyPay,
      transfer: transfer,
      paymentMethodKey: paymentMethodKey,
      methodId: methodId);
}