skip to Main Content

In My Application i want to show a one Google pay Button when the user click on this button i want to pass the whom to pay upi id redirect on google pay application transction page and after the payment sucessfully then redirect on my application and show the payment status whatever it sucess or fail,cancle etc.

For the Open the google pay i use Url luncher code But it does not work it not Open direct Google pay

so Give any other solutions for payment integration in google pay,phonepe,paytm in flutter ..

2

Answers


  1. pay package can help you
    First create dart file (payment_config.dart) inside lib folder that will hold the payment configuration details
    enter image description here

    You can get those payment configuration here:
    https://github.com/google-pay/flutter-plugin/blob/main/pay/example/lib/payment_configurations.dart
    let’s define the Google Pay button widget

    var googlePayButton = GooglePayButton(
      paymentConfiguration: PaymentConfiguration.fromJsonString(
          defaultGooglePayConfigString),
      paymentItems: [PaymentItem(
        label: 'Total',
        amount: '0.01',
        status: PaymentItemStatus.final_price,
      )],
      type: GooglePayButtonType.pay,
      margin: const EdgeInsets.only(top: 15.0),
      onPaymentResult: onGooglePayResult,
      loadingIndicator: const Center(
        child: CircularProgressIndicator(),
      ),
    ),
    

    Now you can use this widget anywhere you want and it will make the payment.

    Finally you need a google pay business account in google pay console to make real payments.

    Login or Signup to reply.
  2. if you have only one purpose to integrate payment then you can use Razorpay Payment. razorpay_flutter . It includes everything from payment apps to card to UPI payments. If you need any other help regarding razorpay do let me know.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search