paymentStatusTransition method
Implementation
@override
Future<Map> paymentStatusTransition(String token, String paymentId,
String? failureType, String nextStatus) async {
final String baseUrl = await getBaseUrl;
var url =
Uri.parse("$baseUrl/api/v1/simulation/payments/$paymentId/transition");
var bodyData = {"next_status": nextStatus};
if (failureType != null) {
bodyData.addAll({"failure_type": failureType});
}
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;
}