The latest version of the Google Pay x Flutter plugin.

The latest version of the Google Pay x Flutter plugin.

Flutter and Google Pay are both common drivers in the real world. Both belong to the same religious space. One is known as the app development platform framework, and the other is the payment platform. Plugins manage the extensiveness of hosting the program without influencing its root properties.

Developers install the plugins to efficiently perform real-world flutter app development tasks and drive a comfortable user experience. These plugins instantly boost the performance, keeping everything in the right state.

We have numerous digital payment processing apps to access seamless transactions. Google pay is one of the most trending platforms that simplifies digital payments from small and big merchants if you are engaged in a flutter app development and hustle about payment accessibility. You can integrate Google Pay for robust and rapid transaction benefits.

Read this blog until the end to uncover how to get the job done Google pay flutter app development plugin.

Google Pay unveils a plugin to integrate exceptional payment process features across android and iOS devices. Feel free to if you are a flutter developer and want to add on the payment utility.

What does Flutter2.2 latest version bring to us?

With the launch of the Flutter 2.2 version app, developers can access a handful of features to make the user experience more astonishing. From background caching to deferred components, everything is convenient to access.

  • Simplifying the payment accessibility for goods through the Google Pay plugin integration. You can access this facility on Apple pay seamlessly.

Although developers have the support of numerous third-party plugins getting something from your space feels like belonging.

  • Access the beta version of Google Mobile Ads SDK to access the capabilities of dynamic ads plus adaptive banners. It extends the compatibility with each device by optimizing the experiences. Developers would love it for null safety.
  • You can access different UI elements and buttons for the preferred requests.
  • Manage the cloud-enriched deployment support, Github access, and Docker image instruction template.

Google pay mechanism in Flutter App Development:

Flutter manages the app features by accessing the relevant dependencies. Enable the google pay features and activate the plugin to comply with the pubspec.yaml file. Alternatively, it's a package dependency accessible from the remote server point and local space.

One of the significant reasons for using this plugin or google pay payment option is its easy integration. A few lines of JSON structure, and you’re good to go with flutter app development with google pay integration. Here is the JSON reference from:

{
  "provider": "google_pay",
  "data": {
    "environment": "TEST",
    "apiVersion": 2,
    "apiVersionMinor": 0,
    "allowedPaymentMethods": [{
      "type": "CARD",
      "tokenizationSpecification": {
        "type": "PAYMENT_GATEWAY",
        "parameters": {
          "gateway": "example",
          "gatewayMerchantId": "gatewayMerchantId"
        }
      },
      "parameters": {
        "allowedCardNetworks": ["VISA", "MASTERCARD"],
        "allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
        "billingAddressRequired": true,
        "billingAddressParameters": {
          "format": "FULL",
          "phoneNumberRequired": true
        }
      }
    }],
    "merchantInfo": {
      "merchantId": "01234567890123456789",
      "merchantName": "Example Merchant Name"
    },
    "transactionInfo": {
      "countryCode": "US",
      "currencyCode": "USD"
    }
  }
}

For more examples of JSON files that define payment options, look at the example/assets/ folder.

Manage the payment method with single-button accessibility in your flutter app.

Here's an example of a Dart file:

import 'package:pay/pay.dart';

const _paymentItems = [
  PaymentItem(
    label: 'Total',
    amount: '99.99',
    status: PaymentItemStatus.final_price,
  )
];

// In your Widget build() method
GooglePayButton(
  paymentConfigurationAsset: 'sample_payment_configuration.json',
  paymentItems: _paymentItems,
  style: GooglePayButtonStyle.black,
  type: GooglePayButtonType.pay,
  onPaymentResult: onGooglePayResult,
),

void onGooglePayResult(paymentResult) {
  // Send the resulting Google Pay token to your server or PSP
}

Note:

  • paymentConfigurationAsset: you can’t alter this parameter. As it holds all the payment transaction configuration details.
  • You can set the environment as TEST or PRODUCTION.
  • Set the provider: apple_pay / google_pay
  • Data is the essential part of the PaymentRequest and act as a JSON instance

Test Card Suite By Google:

You can access the following things:

Environment: Mastercard, Discover, Visa, Amex

Authentication methods: PAN_ONLY CRYPTOGRAM_3DS

Set api version values, api version minor, allowed payment methods(type, tokenization specification, card parameter).

  • Include card payment method.
  • Gateway and gatewayMerchantId as parameters.
  • SetCardParameters
    • allowedAuthMethods, allowedCardNetworks, billingAddressRequired, billingAddressparameters

Billing Address parameters: format, phoneNumerRequired, merchantInfo

MerchantName

TransactionInfo

currencyCode

Trigger Action: onPaymentResult

PaymentMethodData: type, description, tokenizationData

Integrate the desired configuration with the payment profile and drive the functionalities for successful, seamless, robust transactions for flutter application development.

Your client will have a comfortable and secure payment process by clicking a single button. No security lacks or occurrences lie here during the flutter app development.

In 2017, flutter was introduced to the developer community during a conference event. It has gained fame as Dart based official google app development platform. It encapsulated the cross-platform development codebase support for Android, iOS, web apps, Linux, macOS, Windows, and embedded devices.

You can do most of the accessibility with this Google Pay Flutter plugin. It can easily share compatibility with the Dart-enriched codebase and app platform.

Did you find this article valuable?

Support Quokka Labs' Blogs by becoming a sponsor. Any amount is appreciated!