restructure local modules setup

This commit is contained in:
David Remer 2020-06-29 11:26:18 +03:00
parent e61ea5f735
commit 011a4d2d45
12 changed files with 9360 additions and 13532 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -44,7 +44,7 @@ return [
},
'button.url' => static function (ContainerInterface $container): string {
return plugins_url(
'/modules/ppcp-button/',
'/modules.local/ppcp-button/',
dirname(__FILE__, 3) . '/woocommerce-paypal-commerce-gateway.php'
);
},

View file

@ -175,7 +175,6 @@ class SmartButton implements SmartButtonInterface
private function localizeScript(): array
{
the_post_thumbnail();
$localize = [
'script_attributes' => $this->attributes(),
'redirect' => wc_get_checkout_url(),

File diff suppressed because it is too large Load diff

View file

@ -1,50 +1,2 @@
const onboardingCallback = (authCode, sharedId) => {
console.log(authCode);
console.log(sharedId);
fetch(PayPalCommerceGatewayOnboarding.endpoint, {
method: 'POST',
headers: {
'content-type': 'application/json'
},
body: JSON.stringify({
authCode: authCode,
sharedId: sharedId,
nonce: PayPalCommerceGatewayOnboarding.nonce
})
});
}
/*
const bootstrap = () => {
if (!typeof (PayPalCommerceGatewayOnboarding)) {
console.error('PayPal onboarding could not be configured.');
return;
}
const link = document.createElement('a');
link.innerText = PayPalCommerceGatewayOnboarding.link.text;
Object.entries(PayPalCommerceGatewayOnboarding.link.attributes).forEach(
(keyValue) => {
link.setAttribute(keyValue[0], keyValue[1]);
}
);
link.setAttribute('data-paypal-onboard-complete', 'onboardingCallback');
const table = document.querySelector('.form-table');
const wrapper = table.parentNode;
//wrapper.insertBefore(link, table);
const script = document.createElement('script');
Object.entries(PayPalCommerceGatewayOnboarding.script.attributes).forEach(
(keyValue) => {
script.setAttribute(keyValue[0], keyValue[1]);
}
);
wrapper.insertBefore(script, table);
};
bootstrap();
*/
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t){(()=>{const e=document.createElement("a");e.innerText=PayPalCommerceGatewayOnboarding.link.text,Object.entries(PayPalCommerceGatewayOnboarding.link.attributes).forEach(t=>{e.setAttribute(t[0],t[1])});e.setAttribute("data-paypal-onboard-complete",(e,t)=>{console.log(e),console.log(t),fetch(PayPalCommerceGatewayOnboarding.endpoint,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({authCode:e,sharedId:t,nonce:PayPalCommerceGatewayOnboarding.nonce})}).then((function(e){response.ok||alert("Something went wrong!")}))});const t=document.querySelector(".form-table");t.parentNode.insertBefore(e,t);const n=document.createElement("script");Object.entries(PayPalCommerceGatewayOnboarding.script.attributes).forEach(e=>{n.setAttribute(e[0],e[1])}),document.body.append(n)})()}]);
//# sourceMappingURL=onboarding.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -66,7 +66,7 @@ return [
'onboarding.url' => static function (ContainerInterface $container): string {
return plugins_url(
'/modules/ppcp-onboarding/',
'/modules.local/ppcp-onboarding/',
dirname(__FILE__, 3) . '/woocommerce-paypal-commerce-gateway.php'
);
},

File diff suppressed because it is too large Load diff