-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #111 from Adyen/develop
Merge for Release 18.2.2
- Loading branch information
Showing
12 changed files
with
296 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
cartridges/int_adyen_SFRA/cartridge/scripts/adyenService.ds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
var Site = require('dw/system/Site'); | ||
var Resource = require('dw/web/Resource'); | ||
var HashMap = require('dw/util/HashMap'); | ||
var Mail = require('dw/net/Mail'); | ||
var Template = require('dw/util/Template'); | ||
var Transaction = require('dw/system/Transaction'); | ||
|
||
|
||
function submit(order){ | ||
var confirmationEmail = new Mail(); | ||
var context = new HashMap(); | ||
|
||
var savedOrderModel = order.custom.Adyen_CustomerEmail; | ||
var orderObject = { order: JSON.parse(savedOrderModel) }; | ||
|
||
confirmationEmail.addTo(order.customerEmail); | ||
confirmationEmail.setSubject(Resource.msg('subject.order.confirmation.email', 'order', null)); | ||
confirmationEmail.setFrom(Site.current.getCustomPreferenceValue('customerServiceEmail') | ||
|| '[email protected]'); | ||
|
||
Object.keys(orderObject).forEach(function (key) { | ||
context.put(key, orderObject[key]); | ||
}); | ||
|
||
var template = new Template('checkout/confirmation/confirmationEmail'); | ||
var content = template.render(context).text; | ||
confirmationEmail.setContent(content, 'text/html', 'UTF-8'); | ||
confirmationEmail.send(); | ||
|
||
Transaction.wrap(function () { | ||
order.custom.Adyen_CustomerEmail = null; | ||
}); | ||
} | ||
|
||
module.exports = { | ||
'submit': submit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
191 changes: 191 additions & 0 deletions
191
...s/int_adyen_SFRA/cartridge/templates/default/checkout/confirmation/confirmationEmail.isml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
<body> | ||
<div> | ||
<p>${Resource.msg('msg.placed.order.thank.you', 'confirmation', null)}</p> | ||
</div> | ||
<p> | ||
<strong>${Resource.msg('label.order.number', 'confirmation', null)}</strong> | ||
<br/> | ||
<span>${pdict.order.orderNumber}</span> | ||
</p> | ||
<p> | ||
<strong>${Resource.msg('label.order.date', 'confirmation', null)}</strong> | ||
<br/> | ||
<span><isprint value="${pdict.order.creationDate}" style="DATE_LONG"/></span> | ||
</p> | ||
|
||
<!--- Shipping Address ---> | ||
<isloop items="${pdict.order.shipping}" var="shippingModel" status="shippingLoop"> | ||
<isinclude template="checkout/confirmation/shippingTitle"/> | ||
<isset name="address" value="${shippingModel.shippingAddress}" scope="page"/> | ||
<isinclude template="checkout/addressSummary" /> | ||
<br/> | ||
<p> | ||
<strong>${Resource.msg('label.order.shipping.method', 'confirmation', null)}</strong> | ||
<br/> | ||
${shippingModel.selectedShippingMethod.displayName} | ||
<isif condition="${shippingModel.selectedShippingMethod.estimatedArrivalTime}"> | ||
(${shippingModel.selectedShippingMethod.estimatedArrivalTime}) | ||
</isif> | ||
</p> | ||
|
||
<isif condition="${shippingModel.isGift}"> | ||
<p> | ||
<strong> | ||
${Resource.msg('heading.gift.message', 'checkout', null)} | ||
</strong> | ||
${shippingModel.giftMessage} | ||
</p> | ||
</isif> | ||
|
||
<isif condition="${pdict.order.shipping.length > 1}"> | ||
<strong>${Resource.msg('label.order.products', 'confirmation', null)}:</strong> <br/> | ||
<isloop items="${shippingModel.productLineItems.items}" var="lineItem" status="loopSate"> | ||
<p> | ||
${Resource.msg('label.order.product.name', 'confirmation', null)}: ${lineItem.productName} | ||
<br/> | ||
|
||
<isif condition="${lineItem.productType === 'bundle'}"> | ||
<isloop items="${lineItem.bundledProductLineItems}" var="bundledLineItem"> | ||
${Resource.msg('label.order.bundled.item.name', 'confirmation', null)}: ${bundledLineItem.productName} | ||
<br/> | ||
<isloop items="${bundledLineItem.variationAttributes}" var="attribute"> | ||
${attribute.displayName}: ${attribute.displayValue} | ||
<br/> | ||
</isloop> | ||
</isloop> | ||
<iselse/> | ||
<isloop items="${lineItem.variationAttributes}" var="attribute"> | ||
${attribute.displayName}: ${attribute.displayValue} | ||
<br/> | ||
</isloop> | ||
</isif> | ||
|
||
<!--- item price ---> | ||
${Resource.msg('label.each.item.price','cart',null)} - | ||
${lineItem.price.formatted || lineItem.price.sales.formatted} | ||
<br/> | ||
<!--- quantity ---> | ||
${Resource.msg('field.selectquantity','cart',null)} | ||
- <isprint value="${lineItem.quantity}" formatter="##" /> | ||
<br/> | ||
|
||
<!--- line item total price ---> | ||
${Resource.msg('label.total.price','cart',null)} | ||
- ${lineItem.priceTotal.price} | ||
<br/> | ||
</p> | ||
</isloop> | ||
</isif> | ||
</isloop> | ||
<p>${pdict.order.totals.totalShippingCost}</p> | ||
<!--- Billing Address ---> | ||
<strong>${Resource.msg('label.order.billing.address', 'confirmation', null)}</strong> | ||
<br/> | ||
<isset name="address" value="${pdict.order.billing.billingAddress.address}" scope="page"/> | ||
<isinclude template="checkout/addressSummary" /> | ||
|
||
<br/> | ||
|
||
<!--- Payment information ---> | ||
<div> | ||
<strong>${Resource.msg('label.order.payment.info', 'confirmation', null)}</strong> | ||
<br/> | ||
<div> | ||
<isloop items="${pdict.order.billing.payment.selectedPaymentInstruments}" var="payment"> | ||
<isif condition="${payment.paymentMethod === 'CREDIT_CARD'}"> | ||
<div> | ||
<span>${Resource.msg('msg.payment.type.credit', 'confirmation', null)} | ||
${payment.type}</span> | ||
</div> | ||
<div> | ||
${payment.maskedCreditCardNumber} | ||
</div> | ||
<div> | ||
<span>${Resource.msg('msg.card.type.ending', 'confirmation', null)} ${payment.expirationMonth}/${payment.expirationYear}</span> | ||
</div> | ||
</isif> | ||
<isif condition="${payment.paymentMethod === 'Adyen'}"> | ||
<div>${payment.selectedAdyenPM}</div> | ||
<isif condition="${payment.selectedIssuerName != null}"> | ||
<div>${payment.selectedIssuerName}</div> | ||
</isif> | ||
</isif> | ||
</isloop> | ||
</div> | ||
</div> | ||
|
||
<p> | ||
${Resource.msgf('label.number.items.in.cart','cart', null, pdict.order.items.totalQuantity)} | ||
<br/> | ||
${pdict.order.totals.subTotal} | ||
</p> | ||
|
||
<br/> | ||
<isif condition="${pdict.order.shipping.length === 1}"> | ||
<strong>${Resource.msg('label.order.products', 'confirmation', null)}:</strong> <br/> | ||
<isloop items="${pdict.order.items.items}" var="lineItem" status="loopSate"> | ||
<p> | ||
${Resource.msg('label.order.product.name', 'confirmation', null)}: ${lineItem.productName} | ||
<br/> | ||
|
||
<isif condition="${lineItem.productType === 'bundle'}"> | ||
<isloop items="${lineItem.bundledProductLineItems}" var="bundledLineItem"> | ||
${Resource.msg('label.order.bundled.item.name', 'confirmation', null)}: ${bundledLineItem.productName} | ||
<br/> | ||
<isloop items="${bundledLineItem.variationAttributes}" var="attribute"> | ||
${attribute.displayName}: ${attribute.displayValue} | ||
<br/> | ||
</isloop> | ||
</isloop> | ||
<iselse/> | ||
<isloop items="${lineItem.variationAttributes}" var="attribute"> | ||
${attribute.displayName}: ${attribute.displayValue} | ||
<br/> | ||
</isloop> | ||
</isif> | ||
|
||
<isif condition="${lineItem.bonusProductLineItemUUID === 'bonus'}"> | ||
<isloop items="${lineItem.bonusProducts}" var="bonusProduct" status="loopstate"> | ||
<isif condition="${loopstate.first}"> | ||
<br/> | ||
${Resource.msg('text.lineitem.bonus.msg','cart',null)} | ||
</isif> | ||
${bonusProduct.productName} | ||
<isloop items="${bonusProduct.variationAttributes}" var="attribute"> | ||
${attribute.displayName}: ${attribute.displayValue} | ||
<br/> | ||
</isloop> | ||
|
||
<!--- item price ---> | ||
${Resource.msg('label.each.item.price','cart',null)} - | ||
${bonusProduct.priceTotal.price} | ||
<br/> | ||
|
||
<!--- quantity ---> | ||
${Resource.msg('field.selectquantity','cart',null)} | ||
- <isprint value="${bonusProduct.quantity}" formatter="##" /> | ||
<br/> | ||
<isif condition="${loopstate.last}"> | ||
<br/> | ||
</isif> | ||
</isloop> | ||
</isif> | ||
|
||
<!--- item price ---> | ||
${Resource.msg('label.each.item.price','cart',null)} - | ||
${lineItem.price.formatted || lineItem.price.sales.formatted} | ||
<br/> | ||
<!--- quantity ---> | ||
${Resource.msg('field.selectquantity','cart',null)} | ||
- <isprint value="${lineItem.quantity}" formatter="##" /> | ||
<br/> | ||
|
||
<!--- line item total price ---> | ||
${Resource.msg('label.total.price','cart',null)} | ||
- ${lineItem.priceTotal.price} | ||
<br/> | ||
</p> | ||
</isloop> | ||
</isif> | ||
<isinclude template="checkout/confirmation/confirmationOrderTotal" /> | ||
</body> |
10 changes: 10 additions & 0 deletions
10
cartridges/int_adyen_controllers/cartridge/scripts/adyenService.ds
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
var app = require('app_storefront_controllers/cartridge/scripts/app'); | ||
var OrderModel = app.getModel('Order'); | ||
|
||
function submit(order){ | ||
OrderModel.submit(order); | ||
} | ||
|
||
module.exports = { | ||
'submit': submit | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.