From 8eae689bc05ae64e7bc6fbfff984b571cfcc7ae9 Mon Sep 17 00:00:00 2001 From: aayushagarwal2001 Date: Wed, 11 Dec 2024 21:08:27 +0530 Subject: [PATCH] backend/enhc : order creation dump --- .../External/Payment/Juspay/Types/CreateOrder.hs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/mobility-core/src/Kernel/External/Payment/Juspay/Types/CreateOrder.hs b/lib/mobility-core/src/Kernel/External/Payment/Juspay/Types/CreateOrder.hs index 9bdf6b9c0..9c76a1976 100644 --- a/lib/mobility-core/src/Kernel/External/Payment/Juspay/Types/CreateOrder.hs +++ b/lib/mobility-core/src/Kernel/External/Payment/Juspay/Types/CreateOrder.hs @@ -72,10 +72,21 @@ data CreateOrderResp = CreateOrderResp id :: Text, order_id :: Text, payment_links :: Maybe PaymentLinks, - sdk_payload :: SDKPayload + sdk_payload :: SDKPayload, + sdk_payload_json :: Maybe Value } deriving stock (Show, Generic) - deriving anyclass (FromJSON, ToJSON, ToSchema) + deriving anyclass (ToJSON, ToSchema) + +instance FromJSON CreateOrderResp where + parseJSON = withObject "CreateOrderResp" $ \v -> do + status <- v .: "status" + order_id <- v .: "order_id" + id <- v .: "id" + payment_links <- v .: "payment_links" + sdk_payload <- v .: "sdk_payload" + sdk_payload_json <- v .: "sdk_payload" + return (CreateOrderResp status id order_id payment_links sdk_payload sdk_payload_json) data PaymentLinks = PaymentLinks { web :: Maybe BaseUrl,