pgw_sdk 4.0.7 copy "pgw_sdk: ^4.0.7" to clipboard
pgw_sdk: ^4.0.7 copied to clipboard

2C2P PGW SDK for flutter and allows merchants to build an excellent payment experience within their mobile apps by integrating easily with 2C2P's payment gateway.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:pgw_sdk_example/apis/info_api.dart';
import 'package:pgw_sdk_example/apis/payment_api.dart';
import 'package:pgw_sdk_example/constants.dart';
import 'package:pgw_sdk_example/scenes/home_screen.dart';

/// PGW SDK feature examples
final infoApi = InfoApi();
final paymentApi = PaymentApi();
final List infoApiList = [];
final List paymentApiList = [];

void main() async {

  ///Note: Important due to PGW SDK has to initialize before request APIs.
  await infoApi.initialize().whenComplete(() {

    initFeatureList();

    runApp(const MyApp());
  });
}

void initFeatureList() {

  infoApiList.clear();
  infoApiList.add((Constants.apiClientId, infoApi.clientId, Icons.cloud_outlined));
  infoApiList.add((Constants.apiConfiguration, infoApi.configuration, Icons.cloud_outlined));
  infoApiList.add((Constants.apiPaymentOption, infoApi.paymentOption, Icons.cloud_outlined));
  infoApiList.add((Constants.apiPaymentOptionDetail, infoApi.paymentOptionDetail, Icons.cloud_outlined));
  infoApiList.add((Constants.apiCustomerTokenInfo, infoApi.customerTokenInfo, Icons.cloud_outlined));
  infoApiList.add((Constants.apiExchangeRate, infoApi.exchangeRate, Icons.cloud_outlined));
  infoApiList.add((Constants.apiUserPreference, infoApi.userPreference, Icons.cloud_outlined));
  infoApiList.add((Constants.apiTransactionStatus, infoApi.transactionStatus, Icons.cloud_outlined));
  infoApiList.add((Constants.apiSystemInitialization, infoApi.systemInitialization, Icons.cloud_outlined));
  infoApiList.add((Constants.apiPaymentNotification, infoApi.paymentNotification, Icons.cloud_outlined));
  infoApiList.add((Constants.apiCancelTransaction, infoApi.cancelTransaction, Icons.cloud_outlined));
  infoApiList.add((Constants.apiLoyaltyPointInfo, infoApi.loyaltyPointInfo, Icons.cloud_outlined));

  paymentApiList.clear();
  paymentApiList.add((Constants.paymentGlobalCreditDebitCard, paymentApi.globalCreditDebitCard, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentLocalCreditDebitCard, paymentApi.localCreditDebitCard, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentCustomerTokenization, paymentApi.customerTokenization, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentCustomerTokenizationWithoutAuthorisation, paymentApi.customerTokenizationWithoutAuthorisation, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentCustomerToken, paymentApi.customerToken, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentInstallmentPaymentPlan, paymentApi.installmentPaymentPlan, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentRecurringPaymentPlan, paymentApi.recurringPaymentPlan, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentThirdPartyPayment, paymentApi.thirdPartyPayment, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentUserAddressForPayment, paymentApi.userAddressForPayment, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentOnlineDirectDebit, paymentApi.onlineDirectDebit, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentDeepLinkPayment, paymentApi.deepLinkPayment, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentInternetBanking, paymentApi.internetBanking, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentWebPayment, paymentApi.webPayment, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentPayAtCounter, paymentApi.payAtCounter, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentSelfServiceMachines, paymentApi.selfServiceMachines, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentQRPayment, paymentApi.qrPayment, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentBuyNowPayLater, paymentApi.buyNowPayLater, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentDigitalPayment, paymentApi.digitalPayment, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentLinePay, paymentApi.linePay, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentApplePay, paymentApi.applePay, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentGooglePay, paymentApi.googlePay, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentCardLoyaltyPointPayment, paymentApi.cardLoyaltyPointPayment, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentZaloPay, paymentApi.zaloPay, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentCryptocurrency, paymentApi.cryptocurrency, Icons.energy_savings_leaf_outlined));
  paymentApiList.add((Constants.paymentWebPaymentCard, paymentApi.webPaymentCard, Icons.energy_savings_leaf_outlined));
}

class MyApp extends StatelessWidget {

  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      title: Constants.titleAppName,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.lightBlue),
        useMaterial3: true,
      ),
        home: const CustomTabBar()
    );
  }
}
6
likes
140
pub points
78%
popularity

Publisher

verified publisher2c2p.com

2C2P PGW SDK for flutter and allows merchants to build an excellent payment experience within their mobile apps by integrating easily with 2C2P's payment gateway.

Homepage

Documentation

API reference

License

MIT (license)

Dependencies

flutter, pigeon, webview_flutter

More

Packages that depend on pgw_sdk