myfatoorah_pay 1.0.3 copy "myfatoorah_pay: ^1.0.3" to clipboard
myfatoorah_pay: ^1.0.3 copied to clipboard

implement MyFatoorah Sdk for android & ios devoloped By SMZ team adding redirect automaticly with payment respose=>(PaymenStatus , PaymentId , Url) .

example/lib/main.dart

import 'dart:developer';

import 'package:flutter/material.dart';
import 'package:myfatoorah_pay/myfatoorah_pay.dart';


const String myFatoorahApi = 'rLtt6JWvbUHDDhsZnfpAhpYk4dxYDQkbcPTyGaKp2TYqQgG7FGZ5Th_WD53Oq8Ebz6A53njUoo1w3pjU1D4vs_ZMqFiz_j0urb_BH9Oq9VZoKFoJEDAbRZepGcQanImyYrry7Kt6MnMdgfG5jn4HngWoRdKduNNyP4kzcp3mRv7x00ahkm9LAK7ZRieg7k1PDAnBIOG3EyVSJ5kK4WLMvYr7sCwHbHcu4A5WwelxYK0GMJy37bNAarSJDFQsJ2ZvJjvMDmfWwDVFEVe_5tOomfVNt6bOg9mexbGjMrnHBnKnZR1vQbBtQieDlQepzTZMuQrSuKn-t5XZM7V6fCW7oP-uXGX-sMOajeX65JOf6XVpk29DP6ro8WTAflCDANC193yof8-f5_EYY-3hXhJj7RBXmizDpneEQDSaSz5sFk0sV5qPcARJ9zGG73vuGFyenjPPmtDtXtpx35A-BVcOSBYVIWe9kndG3nclfefjKEuZ3m4jL9Gg1h2JBvmXSMYiZtp9MR5I6pvbvylU_PP5xJFSjVTIz7IQSjcVGO41npnwIxRXNRxFOdIUHn0tjQ-7LwvEcTXyPsHXcMD8WtgBh-wxR8aKX7WPSsT1O8d8reb2aR7K3rkV3K82K_0OgawImEpwSvp9MNKynEAJQS6ZHe_J_l77652xwPNxMRTMASk1ZsJL';

void main() {
  runApp(const MyfatoorahPay());
}

class MyfatoorahPay extends StatelessWidget {
  const MyfatoorahPay({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      title: 'MyFatoorah Pay',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  State<MyHomePage> createState() => _MyHomePageState();

  MyHomePage();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('MyFatoorah Pay'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            InkWell(
              child: Container(
                  width: MediaQuery.of(context).size.width* 0.6,
                  padding: const EdgeInsets.symmetric(vertical: 16),
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    color: Colors.blue,
                    borderRadius: BorderRadius.all(Radius.circular(16)),
                    boxShadow: <BoxShadow>[
                      BoxShadow(
                          color: Colors.grey.shade200,
                          offset: Offset(2, 4),
                          blurRadius: 5,
                          spreadRadius: 2)
                    ],
                  ),
                  child: Text('payment dialog',style: TextStyle(color: Colors.white),)),
              onTap: () async {
                var response = await MyFatoorahPay.startPayment(
                  context: context,
                  request: MyfatoorahRequest.test(
                    currencyIso: Country.SaudiArabia,
                    invoiceAmount: 100,
                    language: ApiLanguage.English,
                    token: myFatoorahApi, // 'your api token'
                  ),
                );
                if (response.isSuccess) {
                  // payment success ... do something after payed
                } else {
                  // payment failed ... tell user: try again
                }
              },
            )
          ],
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
5
likes
110
pub points
46%
popularity

Publisher

verified publisherxstationapp.com

implement MyFatoorah Sdk for android & ios devoloped By SMZ team adding redirect automaticly with payment respose=>(PaymenStatus , PaymentId , Url) .

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache-2.0 (LICENSE)

Dependencies

flutter, flutter_inappwebview, http

More

Packages that depend on myfatoorah_pay