init
This commit is contained in:
@@ -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