createPayment method
Future<Map<String, dynamic> >
createPayment({
- required YookassaPaymentModel paymentModel,
- required String username,
- required String password,
- required String idempotenceKey,
Implementation
Future<Map<String, dynamic>> createPayment({
required YookassaPaymentModel paymentModel,
required String username,
required String password,
required String idempotenceKey,
}) async {
final mapView = paymentModel.toJson();
final result = await dio.post(
"https://api.yookassa.ru/v3/payments",
options: Options(
headers: {"Idempotence-Key": idempotenceKey},
),
data: mapView,
);
return result.data;
}