server/src/Entity/booking.js
/**
    * Method to create and capture the payment for the booking.
    * @param transactionId: the transaction id of the booking.
    * @param amount: The amount of the booking.
    * @returns {Promise<unknown>}
    * @private
    */
Method to create and capture the payment for the booking.
@param transactionId: the transaction id of the booking.
@param amount: The amount of the booking.
@returns {Promise}
@private
Method to create and capture the payment for the booking . @param transactionId : the transaction id of the booking . @param amount : The amount of the booking . @returns { Promise } @private
_createPaymentForBooking(transactionId, amount) {
      return new Promise((resolve, reject) => {
         const payment = new Payment(this._bookingId, transactionId, amount);
         payment.createPayment(this._customerId).then(paymentId => {
            printer.printHighlightedLog("Payment Created for booking: " + this._bookingId);
            resolve(paymentId);
         }).catch(err => {
            printer.printError(err);
            printer.printError("Payment not created for booking ID: " + this._bookingId);
            reject(err);
         });
      });
   }
_createPaymentForBooking ( transactionId , amount ) { return new Promise ( ( resolve , reject ) => { const payment = new Payment ( this . _bookingId , transactionId , amount ) ; payment . createPayment ( this . _customerId ) . then ( paymentId => { printer . printHighlightedLog ( "Payment Created for booking: " + this . _bookingId ) ; resolve ( paymentId ) ; } ) . catch ( err => { printer . printError ( err ) ; printer . printError ( "Payment not created for booking ID: " + this . _bookingId ) ; reject ( err ) ; } ) ; } ) ; }
Method to create and capture the payment for the booking.
Method to create and capture the payment for the booking .