bank_alfalah_payment_gateway_integration 1.0.0
bank_alfalah_payment_gateway_integration: ^1.0.0 copied to clipboard
A Flutter package for integrating Bank Alfalah's Payment Gateway(Page Redirection seamlessly using WebView. It simplifies the payment process, handles success and failure responses, and provides an ea [...]
import 'dart:developer';
import 'package:bank_alfalah_payment_gateway_integration/alfalah_payment.dart';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(theme: ThemeData(), home: ProcessPayment());
}
}
class ProcessPayment extends StatelessWidget {
const ProcessPayment({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: AlfalahPaymentIntegration(
onSuccess: () {
log("Transaction Succeed");
},
onFailure: () {
log("Transaction Failed");
},
merchantDetails: MerchantDetails(
firstKey:
'Enter first key here', //You will get keys from bank alfalah
secondKey: 'Enter second key here',
merchantId: 'Enter your merchant id',
storeId: 'Enter your store id',
returnUrl: 'Enter your return url',
merchantHash: 'Enter your merchant hash',
merchantPass: 'Enter merchant pass here',
merchantUserName: 'Enter merchant username here'),
transAmount: "Enter transaction amount here"),
);
}
}