import ApiConstants from '../../../common/api_constants' ; import RequestBase from '../../../common/request_base' ; class CreateRequest extends RequestBase { buyOrder : string ; sessionId : string ; amount : number ; cvv : number | undefined ; cardNumber : string ; cardExprationDate : string ; constructor ( buyOrder , sessionId , amount , cvv , cardNumber , cardExpirationDate ) { super ( `${ ApiConstants . WEBPAY_ENDPOINT }/transactions` , 'POST' ) ; this . buyOrder = buyOrder ; this . sessionId = sessionId ; this . amount = amount ; this . cvv = cvv ; this . cardNumber = cardNumber ; this . cardExprationDate = cardExpirationDate ; } toJson ( ) { return JSON . stringify ( { buy_order : this . buyOrder , session_id : this . sessionId , amount : this . amount , cvv : this . cvv , card_number : this . cardNumber , card_expiration_date : this . cardExprationDate , } ) ; } } export { CreateRequest } ;