init
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0"?>
|
||||
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
|
||||
<body>
|
||||
<referenceBlock name="checkout.root">
|
||||
<arguments>
|
||||
<argument name="jsLayout" xsi:type="array">
|
||||
<item name="components" xsi:type="array">
|
||||
<item name="checkout" xsi:type="array">
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="steps" xsi:type="array">
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="billing-step" xsi:type="array">
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="payment" xsi:type="array">
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="renders" xsi:type="array">
|
||||
<item name="children" xsi:type="array">
|
||||
<item name="esun_oceanpayment_klarna" xsi:type="array">
|
||||
<item name="component" xsi:type="string">Esun_OceanpaymentKlarna/js/view/payment/klarna</item>
|
||||
<item name="methods" xsi:type="array">
|
||||
<item name="esun_oceanpayment_klarna" xsi:type="array">
|
||||
<item name="isBillingAddressRequired" xsi:type="boolean">true</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</item>
|
||||
</argument>
|
||||
</arguments>
|
||||
</referenceBlock>
|
||||
</body>
|
||||
</page>
|
||||
@@ -0,0 +1,13 @@
|
||||
define([
|
||||
'uiComponent',
|
||||
'Magento_Checkout/js/model/payment/renderer-list'
|
||||
], function (Component, rendererList) {
|
||||
'use strict';
|
||||
|
||||
rendererList.push({
|
||||
type: 'esun_oceanpayment_klarna',
|
||||
component: 'Esun_OceanpaymentKlarna/js/view/payment/method-renderer/klarna-method'
|
||||
});
|
||||
|
||||
return Component.extend({});
|
||||
});
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
define([
|
||||
'Magento_Checkout/js/view/payment/default'
|
||||
], function (Component) {
|
||||
'use strict';
|
||||
|
||||
return Component.extend({
|
||||
defaults: {
|
||||
template: 'Esun_OceanpaymentKlarna/payment/klarna'
|
||||
},
|
||||
|
||||
redirectAfterPlaceOrder: false,
|
||||
|
||||
afterPlaceOrder: function () {
|
||||
window.location.replace(
|
||||
window.checkoutConfig.payment.esun_oceanpayment_klarna.redirectUrl
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,36 @@
|
||||
<div class="payment-method" data-bind="css: {'_active': (getCode() === isChecked())}">
|
||||
<div class="payment-method-title field choice">
|
||||
<input type="radio"
|
||||
name="payment[method]"
|
||||
class="radio"
|
||||
data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()">
|
||||
<label class="label" data-bind="attr: {'for': getCode()}">
|
||||
<span data-bind="text: getTitle()"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div class="payment-method-content">
|
||||
<!-- ko foreach: getRegion('messages') -->
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
<div class="payment-method-billing-address">
|
||||
<!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
</div>
|
||||
<p data-bind="i18n: 'You will be redirected to Klarna to securely complete your payment.'"></p>
|
||||
<div class="checkout-agreements-block">
|
||||
<!-- ko foreach: $parent.getRegion('before-place-order') -->
|
||||
<!-- ko template: getTemplate() --><!-- /ko -->
|
||||
<!-- /ko -->
|
||||
</div>
|
||||
<div class="actions-toolbar">
|
||||
<div class="primary">
|
||||
<button class="action primary checkout"
|
||||
type="submit"
|
||||
data-bind="click: placeOrder, attr: {title: $t('Place Order and Pay')}, css: {disabled: !isPlaceOrderActionAllowed()}, enable: isPlaceOrderActionAllowed()">
|
||||
<span data-bind="i18n: 'Place Order and Pay'"></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user