v1.5.0
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
const payanywaySettings = window.wc.wcSettings.getSetting('payanyway_data', {});
|
||||
const payanywaySettingsLabel = window.wp.htmlEntities.decodeEntities(payanywaySettings.title) || window.wp.i18n.__('Оплата через PayAnyWay', 'payanyway')
|
||||
|
||||
const PayanywayContent = () => {
|
||||
return window.wp.htmlEntities.decodeEntities(payanywaySettings.description || '');
|
||||
};
|
||||
|
||||
const PayanywayLabel = () => {
|
||||
return window.wp.element.createElement(
|
||||
'span',
|
||||
{style: {width: '100%'}},
|
||||
payanywaySettingsLabel,
|
||||
window.wp.element.createElement('img', {
|
||||
src: payanywaySettings.icon,
|
||||
style: {float: 'right', marginRight: '20px'},
|
||||
alt: payanywaySettings.title,
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
const Payanyway_Block_Gateway = {
|
||||
name: 'payanyway',
|
||||
label: window.wp.element.createElement(PayanywayLabel),
|
||||
content: window.wp.element.createElement(PayanywayContent),
|
||||
edit: window.wp.element.createElement(PayanywayContent),
|
||||
canMakePayment: () => true,
|
||||
ariaLabel: payanywaySettingsLabel,
|
||||
supports: {
|
||||
features: payanywaySettings.supports,
|
||||
},
|
||||
};
|
||||
|
||||
window.wc.wcBlocksRegistry.registerPaymentMethod(Payanyway_Block_Gateway);
|
||||
Reference in New Issue
Block a user