Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lib/core/flutterwave.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,29 @@ class Flutterwave {
this.meta,
this.style});

/// [url] paymentLink generated from backend server
static Future<ChargeResponse> fromPaymentLink({
required BuildContext context,
required String link,
required String txRef,
}) async {

final response = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => StandardPaymentWidget(webUrl: link),
),
);

if (response != null) return response!;

return ChargeResponse(
txRef: txRef,
status: "cancelled",
success: false,
);
}

/// Starts a transaction by calling the Standard service
Future<ChargeResponse> charge() async {
final request = StandardRequest(
Expand Down
Loading