verifyPaymentConsent method
Future<Map>
verifyPaymentConsent(
- String token,
- String paymentConsentId,
- String? descriptor,
- Map<
String, dynamic> ? deviceData, - String requestId,
- String? returnUrl,
- Map<
String, dynamic> ? riskControlOptions, - Map<
String, dynamic> ? verificationOptions,
override
Implementation
@override
Future<Map> verifyPaymentConsent(
String token,
String paymentConsentId,
String? descriptor,
Map<String, dynamic>? deviceData,
String requestId,
String? returnUrl,
Map<String, dynamic>? riskControlOptions,
Map<String, dynamic>? verificationOptions) async {
final baseUrl = await getBaseUrl;
var url = Uri.parse(
"$baseUrl/api/v1/pa/payment_consents/$paymentConsentId/verify");
Map<String, dynamic> bodyData = {
"request_id": requestId,
};
if (descriptor != null) {
bodyData.addAll({"descriptor": descriptor});
}
if (deviceData != null) {
bodyData.addAll({"device_data": deviceData});
}
if (returnUrl != null) {
bodyData.addAll({"return_url": returnUrl});
}
if (riskControlOptions != null) {
bodyData.addAll({"risk_control_options": riskControlOptions});
}
if (verificationOptions != null) {
bodyData.addAll({"verification_options": verificationOptions});
}
var jsonBody = jsonEncode(bodyData);
var response = await http.post(
url,
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer $token"
},
body: jsonBody,
);
var data = jsonDecode(response.body);
return data;
}