From 7dbfbd6bd5bdc3fffd0b8175df7491c98ce44a16 Mon Sep 17 00:00:00 2001 From: Fatur Muhammad Date: Wed, 24 Apr 2024 22:16:45 +0700 Subject: [PATCH] fix status code --- src/module/payment/services/payment_processing.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/module/payment/services/payment_processing.hpp b/src/module/payment/services/payment_processing.hpp index 29c77ab..f891a0b 100644 --- a/src/module/payment/services/payment_processing.hpp +++ b/src/module/payment/services/payment_processing.hpp @@ -46,7 +46,7 @@ namespace gaboot #define TRANSACTION_BEGIN_CLAUSE(json, midtrans) g_payment_processing->start_payment(json); if (g_payment_processing->make_payment(midtrans)) { #define TRANSACTION_END_CLAUSE } - #define TRANSACTION_FAILED(midtrans) auto response = HttpResponse::newHttpJsonResponse(midtrans.to_json()); response->setStatusCode((HttpStatusCode)midtrans.m_data.status_code); return response; + #define TRANSACTION_FAILED(midtrans) auto response = HttpResponse::newHttpJsonResponse(midtrans.to_json()); response->setStatusCode((HttpStatusCode)midtrans.m_data.m_status.status_code); return response; #define TRANSACTION_SUCCESS(midtrans) auto response = HttpResponse::newHttpJsonResponse(midtrans.to_json()); response->setStatusCode((HttpStatusCode)midtrans.m_data.status_code); return response; #define TRANSACTION_ERROR(msg) return CustomException(fmt::format("Unable to create payment, error caught on {}", msg)).response(); }