Skip to content

Commit

Permalink
Redirect to confirmation page for POS (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
zenit2001 authored Nov 29, 2024
1 parent 2da8193 commit 09b755e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ export async function initializeCheckout() {
paymentMethodsResponse.adyenDescriptions,
);

renderPosTerminals(paymentMethodsResponse.adyenConnectedTerminals);

renderGiftCardLogo(paymentMethodsResponse.imagePath);

const firstPaymentMethod = document.querySelector(
Expand All @@ -275,6 +273,11 @@ export async function initializeCheckout() {
helpers.displaySelectedMethod(firstPaymentMethod.value);
}

if (paymentMethodsResponse.adyenConnectedTerminals) {
renderPosTerminals(paymentMethodsResponse.adyenConnectedTerminals);
document.querySelector('button[value="submit-payment"]').disabled = false;
}

helpers.createShowConfirmationForm(
window.ShowConfirmationPaymentFromComponent,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,11 @@ function placeOrder(req, res, next) {
// Handles payment authorization
var handlePaymentResult = adyenHelpers.handlePayments(order);

const mainPaymentInstrument = order.getPaymentInstruments(
AdyenHelper.getOrderMainPaymentInstrumentType(order)
)[0];

let mainPaymentInstrument;
if (giftCardsAdded) {
mainPaymentInstrument = order.getPaymentInstruments(
AdyenHelper.getOrderMainPaymentInstrumentType(order)
)[0];
giftCardsAdded.forEach((giftCard) => {
const divideBy = AdyenHelper.getDivisorForCurrency(mainPaymentInstrument.paymentTransaction.getAmount());
const amount = {
Expand Down

0 comments on commit 09b755e

Please sign in to comment.