payViaPaygateV2 function
Implementation
Future<NewTransactionResponse> payViaPaygateV2(
String token,
double amount,
String identifier, {
String? description,
String? callbackUrl,
String? phoneNumber,
PaygateProvider? provider,
Color? color,
}) async {
try {
final url = _ParamsNewTransactionV2(
token,
amount,
identifier,
description: description,
callbackUrl: callbackUrl,
phoneNumber: phoneNumber,
provider: provider,
).paygateLink;
if (await canLaunchUrl(url)) {
await launchUrl(url, mode: LaunchMode.inAppBrowserView);
}
return NewTransactionResponse(
null,
status: NewTransactionResponseStatus.success,
identifier: identifier,
);
} catch (e) {
return NewTransactionResponse(
null,
status: NewTransactionResponseStatus.cantLaunchPage,
identifier: identifier,
);
}
}