mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
restructure local modules setup
This commit is contained in:
parent
e61ea5f735
commit
011a4d2d45
12 changed files with 9360 additions and 13532 deletions
|
@ -15,18 +15,14 @@
|
|||
{
|
||||
"type": "composer",
|
||||
"url": "https://repo.packagist.com/inpsyde/ppc-platform/"
|
||||
},
|
||||
{
|
||||
"type": "path",
|
||||
"url": "modules.local/ppcp-onboarding"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"dhii/module-interface": "0.2.x-dev",
|
||||
"psr/container": "^1.0",
|
||||
"inpsyde/ppcp-onboarding": "dev-master",
|
||||
"inpsyde/ppcp-button": "dev-master",
|
||||
"inpsyde/ppcp-wc-gateway": "dev-master",
|
||||
"inpsyde/ppcp-admin-notices": "dev-master",
|
||||
"inpsyde/ppcp-api-client": "dev-master",
|
||||
"inpsyde/ppcp-session": "dev-master",
|
||||
"oomphinc/composer-installers-extender": "^1.1",
|
||||
"container-interop/service-provider": "^0.4.0",
|
||||
"dhii/containers": "dev-develop",
|
||||
|
@ -41,7 +37,8 @@
|
|||
"psr-4": {
|
||||
"Inpsyde\\PayPalCommerce\\": "src/",
|
||||
"Inpsyde\\PayPalCommerce\\Button\\": "modules.local/ppcp-button/src/",
|
||||
"Inpsyde\\PayPalCommerce\\WcGateway\\": "modules.local/ppcp-wc-gateway/src/"
|
||||
"Inpsyde\\PayPalCommerce\\WcGateway\\": "modules.local/ppcp-wc-gateway/src/",
|
||||
"Inpsyde\\PayPalCommerce\\Onboarding\\": "modules.local/ppcp-onboarding/src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
|
|
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
21
package.json
Normal file
21
package.json
Normal file
|
@ -0,0 +1,21 @@
|
|||
{
|
||||
"name": "izettle-woocommerce",
|
||||
"version": "0.1.0",
|
||||
"description": "iZettle WooCommerce",
|
||||
"repository": "https://github.com/inpsyde/izettle-woocommerce",
|
||||
"license": "GPL-2.0",
|
||||
"author": "Inpsyde GmbH",
|
||||
"scripts": {
|
||||
"install:assets:ppcp-button": "cd modules.local/ppcp-button && yarn install",
|
||||
"install:assets:ppcp-onboarding" : "cd modules.local/ppcp-onboarding && yarn install",
|
||||
"install:assets": "yarn run install:assets:ppcp-button && yarn run install:assets:ppcp-onboarding",
|
||||
"build:assets:ppcp-button": "cd modules.local/ppcp-button && yarn run build",
|
||||
"build:assets:ppcp-onboarding" : "cd modules.local/ppcp-onboarding && yarn run build",
|
||||
"build:assets": "yarn run build:assets:ppcp-button && yarn run build:assets:ppcp-onboarding",
|
||||
"build": "yarn run install:assets && yarn run build:assets"
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue