@@ -95,16 +95,16 @@ impl TryFrom<&ConnectorAuthType> for FiservemeaAuthType {
9595}
9696
9797#[ derive( Debug , Clone , Serialize , Deserialize ) ]
98+ #[ serde( rename_all = "camelCase" ) ]
9899pub struct FiservemeaErrorResponse {
99100 pub code : Option < String > ,
100101 pub message : Option < String > ,
101- #[ serde( rename = "details" ) ]
102102 pub details : Option < Vec < ErrorDetail > > ,
103- #[ serde( rename = "apiTraceId" ) ]
104103 pub api_trace_id : Option < String > ,
105104}
106105
107106#[ derive( Debug , Clone , Serialize , Deserialize ) ]
107+ #[ serde( rename_all = "camelCase" ) ]
108108pub struct ErrorDetail {
109109 pub field : Option < String > ,
110110 pub message : Option < String > ,
@@ -131,40 +131,30 @@ pub enum FiservemeaRequestType {
131131}
132132
133133#[ derive( Debug , Serialize ) ]
134+ #[ serde( rename_all = "camelCase" ) ]
134135pub struct FiservemeaPaymentsRequest < T : PaymentMethodDataTypes > {
135- #[ serde( rename = "requestType" ) ]
136136 pub request_type : FiservemeaRequestType ,
137- #[ serde( rename = "merchantTransactionId" ) ]
138137 pub merchant_transaction_id : String ,
139- #[ serde( rename = "transactionAmount" ) ]
140138 pub transaction_amount : TransactionAmount ,
141- #[ serde( rename = "order" ) ]
142139 pub order : OrderDetails ,
143- #[ serde( rename = "paymentMethod" ) ]
144140 pub payment_method : PaymentMethod < T > ,
145141}
146142
147143#[ derive( Debug , Serialize ) ]
144+ #[ serde( rename_all = "camelCase" ) ]
148145pub struct PaymentCardSaleTransaction < T : PaymentMethodDataTypes > {
149- #[ serde( rename = "requestType" ) ]
150146 pub request_type : FiservemeaRequestType ,
151- #[ serde( rename = "transactionAmount" ) ]
152147 pub transaction_amount : TransactionAmount ,
153- #[ serde( rename = "paymentMethod" ) ]
154148 pub payment_method : PaymentMethod < T > ,
155- #[ serde( rename = "transactionType" ) ]
156149 pub transaction_type : String ,
157150}
158151
159152#[ derive( Debug , Serialize ) ]
153+ #[ serde( rename_all = "camelCase" ) ]
160154pub struct PaymentCardPreAuthTransaction < T : PaymentMethodDataTypes > {
161- #[ serde( rename = "requestType" ) ]
162155 pub request_type : FiservemeaRequestType ,
163- #[ serde( rename = "transactionAmount" ) ]
164156 pub transaction_amount : TransactionAmount ,
165- #[ serde( rename = "paymentMethod" ) ]
166157 pub payment_method : PaymentMethod < T > ,
167- #[ serde( rename = "transactionType" ) ]
168158 pub transaction_type : String ,
169159}
170160
@@ -175,59 +165,54 @@ pub struct TransactionAmount {
175165}
176166
177167#[ derive( Debug , Serialize ) ]
168+ #[ serde( rename_all = "camelCase" ) ]
178169pub struct OrderDetails {
179- #[ serde( rename = "orderId" ) ]
180170 pub order_id : String ,
181171}
182172
183173#[ derive( Debug , Serialize ) ]
184- #[ serde( tag = "paymentCard " ) ]
174+ #[ serde( rename_all = "camelCase " ) ]
185175pub struct PaymentMethod < T : PaymentMethodDataTypes > {
186- #[ serde( rename = "paymentCard" ) ]
187176 pub payment_card : PaymentCard < T > ,
188177}
189178
190179#[ derive( Debug , Serialize ) ]
180+ #[ serde( rename_all = "camelCase" ) ]
191181pub struct PaymentCard < T : PaymentMethodDataTypes > {
192182 pub number : RawCardNumber < T > ,
193- #[ serde( rename = "expiryDate" ) ]
194183 pub expiry_date : ExpiryDate ,
195- #[ serde( rename = "securityCode" ) ]
196184 pub security_code : Option < Secret < String > > ,
197185 #[ serde( skip_serializing_if = "Option::is_none" ) ]
198186 pub holder : Option < Secret < String > > ,
199- #[ serde( skip) ]
200- _phantom : std:: marker:: PhantomData < T > ,
201187}
202188
203189#[ derive( Debug , Serialize , Deserialize ) ]
190+ #[ serde( rename_all = "camelCase" ) ]
204191pub struct ExpiryDate {
205192 pub month : Secret < String > ,
206193 pub year : Secret < String > ,
207194}
208195
209196// Capture Request Structure - PostAuthTransaction for Secondary Transaction endpoint
210197#[ derive( Debug , Serialize ) ]
198+ #[ serde( rename_all = "camelCase" ) ]
211199pub struct PostAuthTransaction {
212- #[ serde( rename = "requestType" ) ]
213200 pub request_type : FiservemeaRequestType ,
214- #[ serde( rename = "transactionAmount" ) ]
215201 pub transaction_amount : TransactionAmount ,
216202}
217203
218204// Refund Request Structure - ReturnTransaction for Secondary Transaction endpoint
219205#[ derive( Debug , Serialize ) ]
206+ #[ serde( rename_all = "camelCase" ) ]
220207pub struct ReturnTransaction {
221- #[ serde( rename = "requestType" ) ]
222208 pub request_type : FiservemeaRequestType ,
223- #[ serde( rename = "transactionAmount" ) ]
224209 pub transaction_amount : TransactionAmount ,
225210}
226211
227212// Void Request Structure - VoidTransaction for Secondary Transaction endpoint
228213#[ derive( Debug , Serialize ) ]
214+ #[ serde( rename_all = "camelCase" ) ]
229215pub struct VoidTransaction {
230- #[ serde( rename = "requestType" ) ]
231216 pub request_type : FiservemeaRequestType ,
232217}
233218
@@ -415,7 +400,6 @@ impl<T: PaymentMethodDataTypes>
415400 } ,
416401 security_code : Some ( card_data. card_cvc . clone ( ) ) ,
417402 holder : item. request . customer_name . clone ( ) . map ( Secret :: new) ,
418- _phantom : std:: marker:: PhantomData ,
419403 } ;
420404 PaymentMethod { payment_card }
421405 }
@@ -716,23 +700,15 @@ fn map_refund_status(
716700#[ derive( Debug , Deserialize , Serialize ) ]
717701#[ serde( rename_all = "camelCase" ) ]
718702pub struct FiservemeaPaymentsResponse {
719- #[ serde( rename = "clientRequestId" ) ]
720703 pub client_request_id : Option < String > ,
721- #[ serde( rename = "apiTraceId" ) ]
722704 pub api_trace_id : Option < String > ,
723- #[ serde( rename = "responseType" ) ]
724705 pub response_type : Option < String > ,
725706 #[ serde( rename = "type" ) ]
726707 pub response_type_field : Option < String > ,
727- #[ serde( rename = "ipgTransactionId" ) ]
728708 pub ipg_transaction_id : String ,
729- #[ serde( rename = "orderId" ) ]
730709 pub order_id : Option < String > ,
731- #[ serde( rename = "userId" ) ]
732710 pub user_id : Option < String > ,
733- #[ serde( rename = "transactionType" ) ]
734711 pub transaction_type : FiservemeaTransactionType ,
735- #[ serde( rename = "transactionOrigin" ) ]
736712 pub transaction_origin : Option < FiservemeaTransactionOrigin > ,
737713 pub payment_method_details : Option < FiservemeaPaymentMethodDetails > ,
738714 pub country : Option < Secret < String > > ,
@@ -742,24 +718,21 @@ pub struct FiservemeaPaymentsResponse {
742718 pub transaction_time : Option < i64 > ,
743719 pub approved_amount : Option < AmountDetails > ,
744720 pub transaction_amount : Option < AmountDetails > ,
745- #[ serde( rename = "transactionStatus" ) ]
746721 pub transaction_status : Option < FiservemeaPaymentStatus > ,
747- #[ serde( rename = "transactionResult" ) ]
748722 pub transaction_result : Option < FiservemeaPaymentResult > ,
749723 pub approval_code : Option < String > ,
750724 pub error_message : Option < String > ,
751725 pub transaction_state : Option < String > ,
752726 pub scheme_transaction_id : Option < String > ,
753727 pub processor : Option < Processor > ,
754- #[ serde( rename = "paymentToken" ) ]
755728 pub payment_token : Option < PaymentToken > ,
756729}
757730
758731#[ derive( Debug , Deserialize , Serialize ) ]
732+ #[ serde( rename_all = "camelCase" ) ]
759733pub struct PaymentToken {
760734 pub value : Option < String > ,
761735 pub reusable : Option < bool > ,
762- #[ serde( rename = "declineDuplicates" ) ]
763736 pub decline_duplicates : Option < bool > ,
764737}
765738
0 commit comments