Skip to content

Wrapper library built around the Payfast payment intergration that allows for different types of payments to be setup and made from Flutter apps.

Notifications You must be signed in to change notification settings

PieterWvdV/payfast

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payfast

Open-source wrapper library built to make using the Payfast API with Flutter much easier.

N.B. Has only been tested in Payfast Sandbox!

Usage

Add import

import 'package:payfast/payfast.dart';

Setup simple payment

var payfast = Payfast(
merchantId: 'merchant-id',
merchantKey: 'merchant-key',
passphrase: 'passphrase-set-in-sandbox',
paymentType: PaymentType.SimplePayment,
production: true || false,
);

payfast.createSimplePayment(
amount: 100,
itemName: 'Soap',
);

Setup recurring payment

var payfast = Payfast(
merchantId: 'merchant-id',
merchantKey: 'merchant-key',
passphrase: 'passphrase-set-in-sandbox',
paymentType: PaymentType.RecurringBilling,
production: true || false,
);

payfast.createSubsriptionPayment(
amount: 100,
itemName: 'CAS',
subscriptionType: SubscriptionType.subscription,
billingDate: '2022-07-06',
cycles: 2,
cyclePeriod: FrequencyCyclePeriod.Monthly,
recurringAmount: 100,
);

Generate Url

print(payfast.generateURL());

Inspired by https://github.com/GetTruck/payfast-js

About

Wrapper library built around the Payfast payment intergration that allows for different types of payments to be setup and made from Flutter apps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%