uniPaymentGooglePayButton static method

Widget uniPaymentGooglePayButton({
  1. required String paymentConfigurationAsset,
  2. required dynamic failureListener(
    1. UniPaymentResponse response
    ),
  3. required dynamic successListener(
    1. UniPaymentResponse
    ),
  4. required UniPaymentItemStatus uniPaymentItemStatus,
  5. required UniPaymentItemTypes uniPaymentItemTypes,
  6. required dynamic onPressed(),
  7. required String paymentLabel,
  8. required String payableAmount,
  9. UniPaymentGoogleButtonStyle? uniPaymentGoogleButtonStyle,
  10. UniPaymentGoogleButtonType? uniPaymentGoogleButtonType,
  11. double? height,
  12. double? width,
  13. Widget? loadingIndicator,
})

uniPaymentGooglePayButton is called,to integrate GooglePay payment gateway. Following parameters which are required need to pass while implementing, rest of are not neccesary as per need. paymentConfigurationAsset where you add asset path from asset folder.

Implementation

static Widget uniPaymentGooglePayButton({
  required String paymentConfigurationAsset,
  required failureListener(UniPaymentResponse response),
  required Function(UniPaymentResponse) successListener,
  required UniPaymentItemStatus uniPaymentItemStatus,
  required UniPaymentItemTypes uniPaymentItemTypes,
  required Function() onPressed,
  required String paymentLabel,
  required String payableAmount,
  UniPaymentGoogleButtonStyle? uniPaymentGoogleButtonStyle,
  UniPaymentGoogleButtonType? uniPaymentGoogleButtonType,
  double? height,
  double? width,
  Widget? loadingIndicator,
}) {
  return GooglePayService().universalGooglePay(
    paymentConfigurationAsset: paymentConfigurationAsset,
    failureListener: failureListener,
    successListener: successListener,
    uniPaymentItemStatus: uniPaymentItemStatus,
    uniPaymentItemTypes: uniPaymentItemTypes,
    onPressed: onPressed,
    paymentLabel: paymentLabel,
    payableAmount: payableAmount,
    height: height,
    width: width ?? 350,
    loadingIndicator: loadingIndicator ?? CircularProgressIndicator(),
    uniPaymentGoogleButtonStyle: uniPaymentGoogleButtonStyle,
    uniPaymentGoogleButtonType: uniPaymentGoogleButtonType,
  );
}