From 3751379f1e9a4c215fb6eb898b4ccc67659b9ace Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 10 May 2022 21:51:50 +0700 Subject: initial commit 2 --- .../static/src/js/adyen_account_fields.js | 20 ++++ .../static/src/js/adyen_account_views.js | 63 +++++++++++ .../static/src/js/adyen_transactions.js | 33 ++++++ .../static/src/xml/adyen_account_templates.xml | 125 +++++++++++++++++++++ .../src/xml/adyen_transactions_templates.xml | 10 ++ 5 files changed, 251 insertions(+) create mode 100644 addons/adyen_platforms/static/src/js/adyen_account_fields.js create mode 100644 addons/adyen_platforms/static/src/js/adyen_account_views.js create mode 100644 addons/adyen_platforms/static/src/js/adyen_transactions.js create mode 100644 addons/adyen_platforms/static/src/xml/adyen_account_templates.xml create mode 100644 addons/adyen_platforms/static/src/xml/adyen_transactions_templates.xml (limited to 'addons/adyen_platforms/static/src') diff --git a/addons/adyen_platforms/static/src/js/adyen_account_fields.js b/addons/adyen_platforms/static/src/js/adyen_account_fields.js new file mode 100644 index 00000000..804f27ea --- /dev/null +++ b/addons/adyen_platforms/static/src/js/adyen_account_fields.js @@ -0,0 +1,20 @@ +odoo.define('adyen_platforms.fields', function (require) { +"use strict"; + +var core = require('web.core'); +var FieldSelection = require('web.relational_fields').FieldSelection; +var field_registry = require('web.field_registry'); + +var qweb = core.qweb; + +var AdyenKYCStatusTag = FieldSelection.extend({ + _render: function () { + this.$el.append(qweb.render('AdyenKYCStatusTag', { + value: this.value, + })); + }, +}); + +field_registry.add("adyen_kyc_status_tag", AdyenKYCStatusTag); + +}); diff --git a/addons/adyen_platforms/static/src/js/adyen_account_views.js b/addons/adyen_platforms/static/src/js/adyen_account_views.js new file mode 100644 index 00000000..8921a993 --- /dev/null +++ b/addons/adyen_platforms/static/src/js/adyen_account_views.js @@ -0,0 +1,63 @@ +odoo.define('adyen_platforms.account_views', function (require) { +"use strict"; + +var core = require('web.core'); +var Dialog = require('web.Dialog'); +var FormController = require('web.FormController'); +var FormView = require('web.FormView'); +var viewRegistry = require('web.view_registry'); + +var _t = core._t; +var QWeb = core.qweb; + +var AdyenAccountFormController = FormController.extend({ + _saveRecord: function (recordID, options) { + if(this.model.isNew(this.handle) && this.canBeSaved()) { + var _super = this._super.bind(this, recordID, options); + var buttons = [ + { + text: _t("Create"), + classes: 'btn-primary o_adyen_confirm', + close: true, + disabled: true, + click: function () { + this.close(); + _super(); + }, + }, + { + text: _t("Cancel"), + close: true, + } + ]; + + var dialog = new Dialog(this, { + size: 'extra-large', + buttons: buttons, + title: _t("Confirm your Adyen Account Creation"), + $content: QWeb.render('AdyenAccountCreationConfirmation', { + data: this.model.get(this.handle).data, + }), + }); + + dialog.open().opened(function () { + dialog.$el.on('change', '.opt_in_checkbox', function (ev) { + ev.preventDefault(); + dialog.$footer.find('.o_adyen_confirm')[0].disabled = !ev.currentTarget.checked; + }); + }); + } else if (!this.model.isNew(this.handle)) { + return this._super.apply(this, arguments); + } + }, +}); + +var AdyenAccountFormView = FormView.extend({ + config: _.extend({}, FormView.prototype.config, { + Controller: AdyenAccountFormController, + }), +}); + +viewRegistry.add('adyen_account_form', AdyenAccountFormView); + +}); diff --git a/addons/adyen_platforms/static/src/js/adyen_transactions.js b/addons/adyen_platforms/static/src/js/adyen_transactions.js new file mode 100644 index 00000000..3a6fe896 --- /dev/null +++ b/addons/adyen_platforms/static/src/js/adyen_transactions.js @@ -0,0 +1,33 @@ +odoo.define('adyen_platforms.transactions', function (require) { +"use strict"; + +var ListController = require('web.ListController'); +var ListView = require('web.ListView'); +var viewRegistry = require('web.view_registry'); + +var TransactionsListController = ListController.extend({ + buttons_template: 'AdyenTransactionsListView.buttons', + events: _.extend({}, ListController.prototype.events, { + 'click .o_button_sync_transactions': '_onTransactionsSync', + }), + + _onTransactionsSync: function () { + var self = this; + this._rpc({ + model: 'adyen.transaction', + method: 'sync_adyen_transactions', + args: [], + }).then(function () { + self.trigger_up('reload'); + }); + } +}); + +var TransactionsListView = ListView.extend({ + config: _.extend({}, ListView.prototype.config, { + Controller: TransactionsListController, + }), +}); + +viewRegistry.add('adyen_transactions_tree', TransactionsListView); +}); diff --git a/addons/adyen_platforms/static/src/xml/adyen_account_templates.xml b/addons/adyen_platforms/static/src/xml/adyen_account_templates.xml new file mode 100644 index 00000000..f37ba5e9 --- /dev/null +++ b/addons/adyen_platforms/static/src/xml/adyen_account_templates.xml @@ -0,0 +1,125 @@ + + + +
+
+ You can start processing payments as soon as your application is sent.
+ Payouts will be blocked until your application has been accepted.
+ We will notify you when the status of the review changes, or if additional data is required.
+
+ +

Submitted data

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Legal EntityBusiness
Legal Business Name +
Doing Business As +
Registration Number +
Legal EntityIndividual
First Name +
Last Name +
Date of Birth +
Email +
Phone Number +
Address + , + , + +
+ +

Disclaimers

+

WARNING: Please note that the right to use the payment services is only for + sales in your own name. You may not resell, hire or on any other basis allow third + parties to use the payment services to enable such third parties to be paid for their + services. You may not use the payment services for different types of product and + services than as registered with your application. In particular you confirm that you + will not use the payment services for any type of product or service appearing in the + + Prohibited Products and Services List of our Processor. If we or our + Processor at any time discover that the information you provided about your + business is incorrect or has changed without informing us or if you violate any of + these conditions, the services may be suspended and/or terminated with + immediate effect and fines may be applied by the Credit Card Schemes and/or the + authorities for unregistered or inappropriate use of payment services which will in + such case be payable by you.

+ +

Contractual Relationship

+

The payment processing services ordered by you by placing this order will be + provided to you by Adyen N.V. (hereafter “Processor”), with which you are + entering into a direct agreement by confirming this order. Odoo S.A. + (hereafter “We /Us”) will assist and support you in your use of the services to be + provided by the Processor and we will provide you first line assistance with and + enable you to connect to the systems of Processor to be able to use its services. + For this purpose, you hereby instruct Processor to provide us access to your data + and setting in Processor’s systems which are used by Processor to provide the + services and authorise us to manage these on your behalf.

+ +

Pricing

+
    +
  • Payment and processing fees are listed on adyen.com/pricing.
  • +
  • Payouts cost 0.20€ (EU) or 0.22$ (US) each.
  • +
  • Chargebacks cost 7.5€ each.
  • +
  • Onboarding and KYC cost 5€.
  • +
+ + + I confirm I have taken notice of and accept the following terms and restrictions: +
    +
  • Adyen MarketPay Terms and Conditions (click here to download and review)
  • +
  • Adyen Restricted and Prohibited Products and Services list (click here to download and review)
  • +
+
+
+ + + + Data to provide + + + Waiting for validation + + + Confirmed + + + Failed + + +
diff --git a/addons/adyen_platforms/static/src/xml/adyen_transactions_templates.xml b/addons/adyen_platforms/static/src/xml/adyen_transactions_templates.xml new file mode 100644 index 00000000..50552e80 --- /dev/null +++ b/addons/adyen_platforms/static/src/xml/adyen_transactions_templates.xml @@ -0,0 +1,10 @@ + + + + + + + + -- cgit v1.2.3