mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
restructure local modules setup
This commit is contained in:
parent
e61ea5f735
commit
011a4d2d45
12 changed files with 9360 additions and 13532 deletions
File diff suppressed because one or more lines are too long
6950
modules.local/ppcp-button/package-lock.json
generated
6950
modules.local/ppcp-button/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -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'
|
||||
);
|
||||
},
|
||||
|
|
|
@ -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(),
|
||||
|
|
4664
modules.local/ppcp-button/yarn.lock
Normal file
4664
modules.local/ppcp-button/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
|
@ -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
6519
modules.local/ppcp-onboarding/package-lock.json
generated
6519
modules.local/ppcp-onboarding/package-lock.json
generated
File diff suppressed because it is too large
Load diff
|
@ -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'
|
||||
);
|
||||
},
|
||||
|
|
4664
modules.local/ppcp-onboarding/yarn.lock
Normal file
4664
modules.local/ppcp-onboarding/yarn.lock
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue