@@ -151,53 +151,7 @@ private Call cancelPendingOrderValidateBeforeCall(String merchantPaymentId) thro
151151 */
152152 public RefundDetails refundPayment (Refund refund ) throws ApiException {
153153 ApiUtil .validateObject (validator , refund );
154- ApiResponse <RefundDetails > resp = refundPaymentWithHttpInfo (refund );
155- return resp .getData ();
156- }
157-
158- /**
159- * Refund a payment
160- *
161- * @param refund Refund
162- * @return ApiResponse<PaymentDetails>
163- * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body
164- */
165- protected ApiResponse <RefundDetails > refundPaymentWithHttpInfo (Refund refund ) throws ApiException {
166- Call call = refundPaymentCall (refund );
167- Type localVarReturnType = new TypeToken <RefundDetails >() {
168- }.getType ();
169- return apiClient .execute (call , localVarReturnType , ApiNameConstants .REFUND_REQUEST_ORDER );
170- }
171-
172- /**
173- * Build call for refundPayment
174- *
175- * @param refund Refund
176- * @return Call to execute
177- * @throws ApiException If fail to serialize the request payment object
178- */
179- private Call refundPaymentCall (Refund refund ) throws ApiException {
180-
181- String localVarPath = "/v1/requestOrder/refunds" ;
182- List <Pair > localVarQueryParams = new ArrayList <>();
183- List <Pair > localVarCollectionQueryParams = new ArrayList <>();
184- Map <String , String > localVarHeaderParams = new HashMap <>();
185- Map <String , Object > localVarFormParams = new HashMap <>();
186-
187- final String [] localVarAccepts = {
188- ApiConstants .APPLICATION_JSON
189- };
190- final String localVarAccept = apiClient .selectHeaderAccept (localVarAccepts );
191- if (localVarAccept != null ) localVarHeaderParams .put (ApiConstants .ACCEPT , localVarAccept );
192-
193- final String [] localVarContentTypes = {
194-
195- };
196- final String localVarContentType = apiClient .selectHeaderContentType (localVarContentTypes );
197- localVarHeaderParams .put (ApiConstants .CONTENT_TYPE , localVarContentType );
198- String [] localVarAuthNames = new String []{ApiConstants .HMAC_AUTH };
199- apiClient .setReadTimeout (30 );
200- return apiClient .buildCall (localVarPath , "POST" , localVarQueryParams , localVarCollectionQueryParams , refund , localVarHeaderParams , localVarFormParams , localVarAuthNames );
154+ return paymentApi .refundPayment (refund );
201155 }
202156
203157 /**
0 commit comments