diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 21:51:50 +0700 |
| commit | 3751379f1e9a4c215fb6eb898b4ccc67659b9ace (patch) | |
| tree | a44932296ef4a9b71d5f010906253d8c53727726 /addons/adyen_platforms/static/src | |
| parent | 0a15094050bfde69a06d6eff798e9a8ddf2b8c21 (diff) | |
initial commit 2
Diffstat (limited to 'addons/adyen_platforms/static/src')
5 files changed, 251 insertions, 0 deletions
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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates> + <t t-name="AdyenAccountCreationConfirmation"> + <main> + <div class="alert alert-info"> + You can start processing payments as soon as your application is sent.<br/> + Payouts will be blocked until your application has been accepted.<br/> + We will notify you when the status of the review changes, or if additional data is required.<br/> + </div> + + <h3>Submitted data</h3> + <table class="table table-sm"> + <t t-if="data.is_business"> + <tr> + <td>Legal Entity</td> + <td>Business</td> + </tr> + <tr> + <td>Legal Business Name</td> + <td t-esc="data.legal_business_name"/> + </tr> + <tr> + <td>Doing Business As</td> + <td t-esc="data.doing_business_as"/> + </tr> + <tr> + <td>Registration Number</td> + <td t-esc="data.registration_number"/> + </tr> + </t> + <t t-else=""> + <tr> + <td>Legal Entity</td> + <td>Individual</td> + </tr> + <tr> + <td>First Name</td> + <td t-esc="data.first_name"/> + </tr> + <tr> + <td>Last Name</td> + <td t-esc="data.last_name"/> + </tr> + <tr> + <td>Date of Birth</td> + <td t-esc="data.date_of_birth.format('YYYY-MM-DD')"/> + </tr> + </t> + <tr> + <td>Email</td> + <td t-esc="data.email"/> + </tr> + <tr> + <td>Phone Number</td> + <td t-esc="data.phone_number"/> + </tr> + <tr> + <td>Address</td> + <td> + <t t-esc="data.street"/> <t t-esc="data.house_number_or_name"/>, + <t t-esc="data.city"/> <t t-if="data.state_code" t-esc="data.state_code"/> <t t-esc="data.zip"/>, + <t t-esc="data.country_code"/> + </td> + </tr> + </table> + + <h3>Disclaimers</h3> + <p>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 + <a href="https://www.odoo.com/odoo_adyen/static/src/pdf/marketpay_prohibited_products_and_services.pdf"> + Prohibited Products and Services List of our Processor</a>. 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.</p> + + <h3>Contractual Relationship</h3> + <p>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.</p> + + <h3>Pricing</h3> + <ul> + <li>Payment and processing fees are listed on <a href="http://www.adyen.com/pricing">adyen.com/pricing</a>.</li> + <li>Payouts cost 0.20€ (EU) or 0.22$ (US) each.</li> + <li>Chargebacks cost 7.5€ each.</li> + <li>Onboarding and KYC cost 5€.</li> + </ul> + + <input type="checkbox" class="opt_in_checkbox"/> + I confirm I have taken notice of and accept the following terms and restrictions: + <ul> + <li>Adyen MarketPay Terms and Conditions (click <a href="https://www.odoo.com/odoo_adyen/static/src/pdf/marketpay_terms_and_conditions.pdf">here</a> to download and review)</li> + <li>Adyen Restricted and Prohibited Products and Services list (click <a href="https://www.odoo.com/odoo_adyen/static/src/pdf/marketpay_prohibited_products_and_services.pdf">here</a> to download and review)</li> + </ul> + </main> + </t> + + <t t-name="AdyenKYCStatusTag"> + <t t-if="value === 'awaiting_data'"> + <span class="badge badge-pill badge-warning">Data to provide</span> + </t> + <t t-if="value === 'pending'"> + <span class="badge badge-pill badge-info">Waiting for validation</span> + </t> + <t t-if="value === 'passed'"> + <span class="badge badge-pill badge-success">Confirmed</span> + </t> + <t t-if="value === 'failed'"> + <span class="badge badge-pill badge-danger">Failed</span> + </t> + </t> +</templates> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<templates> + <t t-extend="ListView.buttons" t-name="AdyenTransactionsListView.buttons"> + <t t-jquery="button.o_list_button_discard" t-operation="after"> + <button type="button" class="btn btn-primary o_button_sync_transactions"> + Sync Transactions + </button> + </t> + </t> +</templates> |
