my_payment_ozow_package 0.3.2 copy "my_payment_ozow_package: ^0.3.2" to clipboard
my_payment_ozow_package: ^0.3.2 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: "",
      privateKey: "",
      siteCode: "",
    );

    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();
      //  print(paymentService.generateRef()); How to get refrerence 
      },
      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
130
points
43
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.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

crypto, flutter, http, url_launcher, url_launcher_web

More

Packages that depend on my_payment_ozow_package