Implemented Razorpay Payment Gateway integration - April 17, 2026, 5:56 PM

This commit is contained in:
Sarankumar committed 2026-04-17 17:58:26 +05:30
1 parent ece167ea75
commit 41d7cfa8c6
11 files changed
+826 -425

No files matched your search

+1
View File
@@ -27,4 +27,5 @@ class ConstsApi {
"$baseUrl/api/notification/un_read_count";
static const String dashboard = "$baseUrl/api/get_dashboard_data";
static const String proformaaccept = "$baseUrl/api/proforma/accept";
static const String payNow = "$baseUrl/api/pay_now";
}
+30
View File
@@ -861,6 +861,36 @@ debugPrint('📦 KYC Response Body: ${response.body}');
}
}
Future<Map<String, dynamic>> payNow({required int id}) async {
try {
final token = await _localStore.getToken();
final uri = Uri.parse(ConstsApi.payNow).replace(
queryParameters: {'id': id.toString()},
);
final response = await http.post(
uri,
headers: {
'Authorization': 'Bearer $token',
'Accept': 'application/json',
},
);
final data = jsonDecode(response.body);
debugPrint("🚀 Pay Now API Response: $data");
print("🚀 Pay Now API Response: $data"); // Force print as well
if (response.statusCode != 200 && response.statusCode != 201) {
throw data['message'] ?? 'Failed to process payment';
}
return data;
} catch (e) {
debugPrint('❌ Pay Now API Error: $e');
rethrow;
}
}
Future<void> proformaaccept({required int proformaId}) async {
try {
final token = await _localStore.getToken();