private static bool BookingIsGuaranteeAndDeposit(HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations) { if (WBSPGHelper.BookingIsGuaranteeOnly(objHotelBookingPaymentAllocations) || WBSPGHelper.BookingIsDepositOnly(objHotelBookingPaymentAllocations)) return false; return true; }
private static bool BookingIsGuaranteeOnly(HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations) { for (int i = 0; i < objHotelBookingPaymentAllocations.Length; i++) { if (objHotelBookingPaymentAllocations[i].Amount != 0) return false; } return true; }
public static bool IsOnlinePayment(PaymentGatewayInfo[] objPaymentGatewayInfos, HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations, string strPaymentCardType) { if (WBSPGHelper.BookingIsGuaranteeOnly(objHotelBookingPaymentAllocations)) return false; if (!WBSPGHelper.IsOnlineCardType(objPaymentGatewayInfos, strPaymentCardType)) return false; return true; }
public static bool IsPaymentGatewayPreSelectRequired(PaymentGatewayInfo[] objPaymentGatewayInfos, HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations) { if (WBSPGHelper.BookingIsGuaranteeOnly(objHotelBookingPaymentAllocations)) return false; if (objPaymentGatewayInfos == null || objPaymentGatewayInfos.Length <= 1) return false; bool bPaymentGatewayCapturesCardDetails = false; for (int i = 0; i < objPaymentGatewayInfos.Length; i++) { if (objPaymentGatewayInfos[i].Mode == PaymentGatewayMode.PaymentGatewayCapturesCardDetails) { bPaymentGatewayCapturesCardDetails = true; break; } } if (!bPaymentGatewayCapturesCardDetails) return false; return true; }
public static decimal GetTotalPaymentCardPayment(HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations) { decimal decPaymentTotal = 0; for (int i = 0; i < objHotelBookingPaymentAllocations.Length; i++) decPaymentTotal += objHotelBookingPaymentAllocations[i].Amount; return decPaymentTotal; }
public static PaymentCardApplication GetPaymentCardApplicationStatus(HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations) { if (WBSPGHelper.BookingIsGuaranteeOnly(objHotelBookingPaymentAllocations)) return PaymentCardApplication.GuaranteeOnly; if (WBSPGHelper.BookingIsDepositOnly(objHotelBookingPaymentAllocations)) return PaymentCardApplication.DepositOnly; return PaymentCardApplication.GuaranteeAndDeposit; }
public static HotelBookingPaymentAllocation[] GetPaymentAllocations(HotelPricing[] objHotelPricing) { HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocation = new HotelBookingPaymentAllocation[objHotelPricing.Length]; for (int i = 0; i < objHotelPricing.Length; i++) { objHotelBookingPaymentAllocation[i] = new HotelBookingPaymentAllocation(); objHotelBookingPaymentAllocation[i].SegmentRefID = objHotelPricing[i].SegmentRefID; objHotelBookingPaymentAllocation[i].Amount = objHotelPricing[i].TotalDeposit; } return objHotelBookingPaymentAllocation; }
public static HotelPaymentRQ GetHotelPaymentRQ(PaymentGatewayInfo objPaymentGatewayInfo, HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations, HotelDescriptiveInfo objHotelDescriptiveInfo, GuestDetailsEntryInfo objGuestDetailsEntryInfo, string strCultureCode, string strUICultureCode) { HotelPaymentRQ objHotelPaymentRQ = new HotelPaymentRQ(); objHotelPaymentRQ.RequestTransID = Guid.NewGuid().ToString(); objHotelPaymentRQ.PaymentGateway = objPaymentGatewayInfo; objHotelPaymentRQ.PaymentType = PaymentType.Payment; objHotelPaymentRQ.PaymentMethod = PaymentMethod.PaymentCard; objHotelPaymentRQ.PaymentAmounts = objHotelBookingPaymentAllocations; objHotelPaymentRQ.PaymentTransRefID = DateTime.UtcNow.Ticks.ToString("00000000000000000000"); objHotelPaymentRQ.PaymentTransInfo = "Hotel Accommodation"; objHotelPaymentRQ.PaymentCard = new HotelBookingPaymentCard(); if (objPaymentGatewayInfo.Mode == PaymentGatewayMode.MerchantSiteCapturesCardDetails) { objHotelPaymentRQ.PaymentCard.PaymentCardType = objGuestDetailsEntryInfo.PaymentCardType; objHotelPaymentRQ.PaymentCard.PaymentCardNumber = objGuestDetailsEntryInfo.PaymentCardNumber; objHotelPaymentRQ.PaymentCard.PaymentCardHolder = objGuestDetailsEntryInfo.PaymentCardHolder; objHotelPaymentRQ.PaymentCard.PaymentCardEffectiveDate = objGuestDetailsEntryInfo.PaymentCardEffectiveDate; objHotelPaymentRQ.PaymentCard.PaymentCardExpireDate = objGuestDetailsEntryInfo.PaymentCardExpireDate; objHotelPaymentRQ.PaymentCard.PaymentCardIssueNumber = objGuestDetailsEntryInfo.PaymentCardIssueNumber; objHotelPaymentRQ.PaymentCard.PaymentCardSecurityCode = objGuestDetailsEntryInfo.PaymentCardSecurityCode; } else if (objPaymentGatewayInfo.Mode == PaymentGatewayMode.PaymentGatewayCapturesCardDetails) { objHotelPaymentRQ.PaymentCard.PaymentCardType = ""; objHotelPaymentRQ.PaymentCard.PaymentCardNumber = ""; objHotelPaymentRQ.PaymentCard.PaymentCardHolder = ""; objHotelPaymentRQ.PaymentCard.PaymentCardEffectiveDate = ""; objHotelPaymentRQ.PaymentCard.PaymentCardExpireDate = ""; objHotelPaymentRQ.PaymentCard.PaymentCardIssueNumber = ""; objHotelPaymentRQ.PaymentCard.PaymentCardSecurityCode = ""; } objHotelPaymentRQ.HotelCode = objHotelDescriptiveInfo.HotelCode; objHotelPaymentRQ.CurrencyCode = objHotelDescriptiveInfo.CurrencyCode; objHotelPaymentRQ.CultureCode = strCultureCode; objHotelPaymentRQ.UICultureCode = strUICultureCode; return objHotelPaymentRQ; }
public static decimal GetBookingSegmentPayment(HotelBookingPaymentAllocation[] objHotelBookingPaymentAllocations, string strSegmentRefID) { decimal decBookingSegmentPayment = 0; for (int i = 0; i < objHotelBookingPaymentAllocations.Length; i++) { if (objHotelBookingPaymentAllocations[i].SegmentRefID == strSegmentRefID) { decBookingSegmentPayment = objHotelBookingPaymentAllocations[i].Amount; break; } } return decBookingSegmentPayment; }