import Client from "../client" ; import getJsonResponse from "../helpers/getJsonResponse" ; import Service from "../service" ; import { ApplicationInfo } from "../typings/applicationInfo" ; import { IRequest } from "../typings/requestOptions" ; import AmountUpdates from "./resource/modification/amountUpdates" ; import Cancels from "./resource/modification/cancels" ; import Captures from "./resource/modification/captures" ; import Refunds from "./resource/modification/refunds" ; import Reversals from "./resource/modification/reversals" ; import CancelsStandalone from "./resource/modification/cancelsStandalone" ; import { CreatePaymentAmountUpdateRequest , CreatePaymentCancelRequest , CreatePaymentCaptureRequest , CreatePaymentRefundRequest , CreatePaymentReversalRequest , CreateStandalonePaymentCancelRequest , PaymentAmountUpdateResource , PaymentCancelResource , PaymentCaptureResource , PaymentRefundResource , PaymentReversalResource , StandalonePaymentCancelResource } from "../typings/checkout/models" ; interface AppInfo { applicationInfo ? : ApplicationInfo ; } type GenericRequest < T > = T & AppInfo ; class Modification extends Service { public constructor ( client ) { super ( client ) ; } public amountUpdates ( paymentPspReference , amountUpdatesRequest , requestOptions ? ) { const amountUpdates = new AmountUpdates ( this , paymentPspReference ) ; return getJsonResponse < CreatePaymentAmountUpdateRequest , PaymentAmountUpdateResource > ( amountUpdates , amountUpdatesRequest , requestOptions ) ; } public cancelsStandalone ( cancelsStandaloneRequest , requestOptions ? ) { const cancelsStandalone = new CancelsStandalone ( this ) ; return getJsonResponse < CreateStandalonePaymentCancelRequest , StandalonePaymentCancelResource > ( cancelsStandalone , cancelsStandaloneRequest , requestOptions ) ; } public cancels ( paymentPspReference , cancelsRequest , requestOptions ? ) { const cancels = new Cancels ( this , paymentPspReference ) ; return getJsonResponse < CreatePaymentCancelRequest , PaymentCancelResource > ( cancels , cancelsRequest , requestOptions ) ; } public captures ( paymentPspReference , capturesRequest , requestOptions ? ) { const captures = new Captures ( this , paymentPspReference ) ; return getJsonResponse < CreatePaymentCaptureRequest , PaymentCaptureResource > ( captures , capturesRequest , requestOptions ) ; } public refunds ( paymentPspReference , refundsRequest , requestOptions ? ) { const refunds = new Refunds ( this , paymentPspReference ) ; return getJsonResponse < CreatePaymentRefundRequest , PaymentRefundResource > ( refunds , refundsRequest , requestOptions ) ; } public reversals ( paymentPspReference , reversalsRequest , requestOptions ? ) { const refunds = new Reversals ( this , paymentPspReference ) ; return getJsonResponse < CreatePaymentReversalRequest , PaymentReversalResource > ( refunds , reversalsRequest , requestOptions ) ; } } export default Modification ;