my_payment_ozow_package 0.1.0 copy "my_payment_ozow_package: ^0.1.0" to clipboard
my_payment_ozow_package: ^0.1.0 copied to clipboard

A Dart package facilitating seamless integration with the Ozow payment gateway. Simplify online payments by securely processing transactions in your Flutter applications.

example/lib/main.dart

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

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    PaymentConfig paymentConfig = PaymentConfig(
      apiKey: "aUcwYW4cpx2xAOaMu8DEnJmQ9JUvJHVD",
      privateKey: "lX06ZseA7zKKSX3QxOvEC4GkF86OIRwR",
      siteCode: "SOF-SOF-008",
    );

    PaymentService paymentService = PaymentService(config: paymentConfig);

    return MaterialApp(
      title: 'Payment Example',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Payment Example'),
        ),
        body: Center(
          child: PayButton(paymentService: paymentService),
        ),
      ),
    );
  }
}

class PayButton extends StatelessWidget {
  final PaymentService paymentService;

  const PayButton({Key? key, required this.paymentService}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return ElevatedButton(
      onPressed: () {
        makePayment();
      },
      child: Text('Pay Now Ozow'),
    );
  }

  void makePayment() async {
    await paymentService.makePaymentRequest(
      amount: 0.08, // Provide the required amount
      cancelUrl: "http://test.i-pay.co.za/responsetest.php",
      notifyUrl: "http://test.i-pay.co.za/responsetest.php",
      successUrl: "http://test.i-pay.co.za/responsetest.php",
    );
  }
}
16
likes
0
points
31
downloads

Publisher

unverified uploader

Weekly Downloads

A Dart package facilitating seamless integration with the Ozow payment gateway. Simplify online payments by securely processing transactions in your Flutter applications.

License

unknown (license)

Dependencies

crypto, flutter, http, url_launcher

More

Packages that depend on my_payment_ozow_package