From 8414f1705fbccf0a8be23c839efc143e4c8837a8 Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Tue, 16 Jul 2024 21:36:43 +0800 Subject: [PATCH] payments onboard and extension purchasing flow completed --- .eslintignore | 10 + .gitignore | 15 +- .stylelintignore | 4 + addon/components/extension-card.hbs | 8 +- addon/components/extension-card.js | 157 ++++++++++++- .../modals/confirm-extension-purchase.hbs | 5 + .../modals/confirm-extension-purchase.js | 3 + .../modals/extension-purchase-form.hbs | 5 + .../modals/extension-purchase-form.js | 3 + .../controllers/developers/extensions/edit.js | 4 +- .../controllers/developers/payments/index.js | 6 + .../developers/payments/onboard.js | 67 ++++++ addon/models/registry-extension.js | 2 + addon/routes.js | 5 +- addon/routes/developers/payments/index.js | 15 ++ addon/routes/developers/payments/onboard.js | 21 ++ addon/services/stripe.js | 83 +++++++ addon/styles/registry-bridge-engine.css | 25 ++ addon/templates/application.hbs | 1 - .../templates/developers/extensions/edit.hbs | 1 + addon/templates/developers/payments/index.hbs | 17 ++ .../templates/developers/payments/onboard.hbs | 48 ++++ .../modals/confirm-extension-purchase.js | 1 + .../modals/extension-purchase-form.js | 1 + app/controllers/developers/payments/index.js | 1 + .../developers/payments/onboard.js | 1 + app/routes/developers/payments/index.js | 1 + app/routes/developers/payments/onboard.js | 1 + app/services/stripe.js | 1 + app/templates/developers/payments/index.js | 1 + app/templates/developers/payments/onboard.js | 1 + composer.json | 4 +- config/environment.js | 7 + package.json | 5 +- pnpm-lock.yaml | 13 +- server/config/registry-bridge.php | 8 +- ...51614_create_registry_extensions_table.php | 1 + ...00_create_registry_extension_purchases.php | 41 ++++ .../v1/RegistryPaymentsController.php | 197 ++++++++++++++++ server/src/Models/RegistryExtension.php | 221 +++++++++++++++--- .../src/Models/RegistryExtensionPurchase.php | 85 +++++++ server/src/Support/Utils.php | 19 ++ server/src/routes.php | 7 + .../modals/confirm-extension-purchase-test.js | 26 +++ .../modals/extension-purchase-form-test.js | 26 +++ .../developers/payments/index-test.js | 12 + .../developers/payments/onboard-test.js | 12 + .../routes/developers/payments/index-test.js | 11 + .../developers/payments/onboard-test.js | 11 + tests/unit/services/stripe-test.js | 12 + 50 files changed, 1189 insertions(+), 43 deletions(-) create mode 100644 addon/components/modals/confirm-extension-purchase.hbs create mode 100644 addon/components/modals/confirm-extension-purchase.js create mode 100644 addon/components/modals/extension-purchase-form.hbs create mode 100644 addon/components/modals/extension-purchase-form.js create mode 100644 addon/controllers/developers/payments/index.js create mode 100644 addon/controllers/developers/payments/onboard.js create mode 100644 addon/routes/developers/payments/index.js create mode 100644 addon/routes/developers/payments/onboard.js create mode 100644 addon/services/stripe.js create mode 100644 addon/templates/developers/payments/index.hbs create mode 100644 addon/templates/developers/payments/onboard.hbs create mode 100644 app/components/modals/confirm-extension-purchase.js create mode 100644 app/components/modals/extension-purchase-form.js create mode 100644 app/controllers/developers/payments/index.js create mode 100644 app/controllers/developers/payments/onboard.js create mode 100644 app/routes/developers/payments/index.js create mode 100644 app/routes/developers/payments/onboard.js create mode 100644 app/services/stripe.js create mode 100644 app/templates/developers/payments/index.js create mode 100644 app/templates/developers/payments/onboard.js create mode 100644 server/migrations/2024_07_16_155000_create_registry_extension_purchases.php create mode 100644 server/src/Http/Controllers/Internal/v1/RegistryPaymentsController.php create mode 100644 server/src/Models/RegistryExtensionPurchase.php create mode 100644 server/src/Support/Utils.php create mode 100644 tests/integration/components/modals/confirm-extension-purchase-test.js create mode 100644 tests/integration/components/modals/extension-purchase-form-test.js create mode 100644 tests/unit/controllers/developers/payments/index-test.js create mode 100644 tests/unit/controllers/developers/payments/onboard-test.js create mode 100644 tests/unit/routes/developers/payments/index-test.js create mode 100644 tests/unit/routes/developers/payments/onboard-test.js create mode 100644 tests/unit/services/stripe-test.js diff --git a/.eslintignore b/.eslintignore index 9385391..02adf1b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -6,8 +6,18 @@ # misc /coverage/ +/scripts/ !.* .*/ # ember-try /.node_modules.ember-try/ +/bower.json.ember-try +/npm-shrinkwrap.json.ember-try +/package.json.ember-try +/package-lock.json.ember-try +/yarn.lock.ember-try + +#server +/server +/server_vendor diff --git a/.gitignore b/.gitignore index a944ffb..c840f41 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ # dependencies /node_modules/ +/scripts/node_modules/ # misc /.env* @@ -13,7 +14,6 @@ /npm-debug.log* /testem.log /yarn-error.log -/.php-cs-fixer.cache # ember-try /.node_modules.ember-try/ @@ -24,3 +24,16 @@ # broccoli-debug /DEBUG/ + +# server +.idea/* +.idea/codeStyleSettings.xml +composer.lock +/server_vendor +/server/vendor/ +.phpunit.result.cache +.php_cs.cache +.php-cs-fixer.cache +*.swp +*.swo +.DS_Store diff --git a/.stylelintignore b/.stylelintignore index a0cf71c..29348e2 100644 --- a/.stylelintignore +++ b/.stylelintignore @@ -6,3 +6,7 @@ # addons /.node_modules.ember-try/ + +# server +/server/ +/server_vendor/ diff --git a/addon/components/extension-card.hbs b/addon/components/extension-card.hbs index ddb0c3b..b7ffc79 100644 --- a/addon/components/extension-card.hbs +++ b/addon/components/extension-card.hbs @@ -1,4 +1,10 @@ -