Skip to content
/ sagepay Public
forked from oolayemi/sagepay

A flutter package for sagepay checkout

License

Notifications You must be signed in to change notification settings

sanxy/sagepay

 
 

Repository files navigation

Flutter plugin for sagepay SDK

Getting started

To use this plugin, add sagepay as a dependency in your pubspec.yaml file.

How to Use

This plugin uses two APIs

  1. Create a SagePay instance by calling the constructor SagePay. The constructor accepts a required instance of the following: context, business, reference, callbackUrl, amount, token It returns an instance of SagePay which we then call the async method .chargeTransaction() on.
import 'package:sagepay/sagepay.dart';
final sagePay = SagePay(
      context: context,
      amount: 100,
      reference: "jDSiFGdidHSddd",
      callbackUrl: "http://cspydo.com.ng",
      token: "SCSec-L-573d15f6************71ca6ecee9f6",
      business: Business(name: "Tech4Me2", email: "csamsonok@gmail.com"),
    );

PaymentResponse response = await sagePay.chargeTransaction();
  1. Handle the response Calling the .chargeTransaction() method returns a Future of PaymentResponse which we await for the actual response as seen above.
const like = 'sample';

Additional information

About

A flutter package for sagepay checkout

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%