diff --git a/tap_payment_gateway/README.rst b/tap_payment_gateway/README.rst new file mode 100644 index 000000000..4ce239dc8 --- /dev/null +++ b/tap_payment_gateway/README.rst @@ -0,0 +1,47 @@ +.. image:: https://img.shields.io/badge/license-LGPL--3-green.svg + :target: https://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 + +Tap Payment Gateway +=================== +Tap Payment Gateway Integration for Odoo 16 + +Installation +============ + - www.odoo.com/documentation/16.0/setup/install.html + - Install our custom addon + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer:(V16) Jumana Jabin MP @cybrosys, Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/tap_payment_gateway/__init__.py b/tap_payment_gateway/__init__.py new file mode 100644 index 000000000..d6db989dd --- /dev/null +++ b/tap_payment_gateway/__init__.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models +from . import controllers +from odoo.addons.payment import setup_provider, reset_payment_provider + + +def post_init_hook(cr, registry): + setup_provider(cr, registry, 'tap') + + +def uninstall_hook(cr, registry): + reset_payment_provider(cr, registry, 'tap') diff --git a/tap_payment_gateway/__manifest__.py b/tap_payment_gateway/__manifest__.py new file mode 100644 index 000000000..ff8f1972b --- /dev/null +++ b/tap_payment_gateway/__manifest__.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': 'Tap Payment Gateway', + 'version': '16.0.1.0.0', + 'category': 'ExtraTools', + 'summary': 'Tap Payment Gateway Integration for Odoo 16', + 'description': 'This module integrates Tap payment gateway ' + 'with Odoo, allowing customers to securely make payments ' + 'using Tap on your website.', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['base', 'payment', 'account', 'website_sale'], + 'data': [ + 'views/tap_payment_templates.xml', + 'data/payment_provider_data.xml', + 'views/payment_provider_views.xml', + ], + 'assets': { + 'web.assets_frontend': [ + 'tap_payment_gateway/static/src/js/payment_form.js' + ] + }, + 'post_init_hook': 'post_init_hook', + 'uninstall_hook': 'uninstall_hook', + 'images': [ + 'static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/tap_payment_gateway/controllers/__init__.py b/tap_payment_gateway/controllers/__init__.py new file mode 100644 index 000000000..553e756a4 --- /dev/null +++ b/tap_payment_gateway/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import tap_payment_gateway diff --git a/tap_payment_gateway/controllers/tap_payment_gateway.py b/tap_payment_gateway/controllers/tap_payment_gateway.py new file mode 100644 index 000000000..c5aadf4b3 --- /dev/null +++ b/tap_payment_gateway/controllers/tap_payment_gateway.py @@ -0,0 +1,127 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +import logging +import re +import requests +from odoo import http, _ +from odoo.exceptions import ValidationError +from odoo.http import request + +_logger = logging.getLogger(__name__) + + +class TapPaymentGateway(http.Controller): + """Controller for handling payment processing using the Tap Payment + Gateway.""" + + @http.route('/tap', type='json', auth='public', methods=['POST'], + csrf=False) + def generate_tap_token(self, card_number, exp_month, exp_year, cvc, + cardholder_name): + """Generate a Tap Payment Gateway token for a given credit card.""" + special_chars_regex = re.compile( + r'[@#$%^&*()_+\-=\[\]{};:"\\|,.<>\/?]+') + if special_chars_regex.search(cardholder_name): + raise ValidationError(_('Invalid Card Holder Name')) + tap_credentials = http.request.env.ref( + 'tap_payment_gateway.payment_provider_tap').sudo() + token_url = "https://api.tap.company/v2/tokens" + payload = { + "card": { + "number": card_number, + "exp_month": exp_month, + "exp_year": exp_year, + "cvc": cvc, + "name": cardholder_name, + }, + "client_ip": http.request.httprequest.remote_addr + } + headers = { + "accept": "application/json", + "content-type": "application/json", + "Authorization": f"Bearer {tap_credentials.tap_secret_key}" + } + try: + response = requests.post(token_url, json=payload, headers=headers) + if response.status_code == 200: + token_data = response.json() + return token_data['id'] + else: + error_message = response.json().get('message', + 'Token creation failed') + _logger.error(f"Token creation failed: {error_message}") + return None + except Exception as e: + _logger.error(f"An error occurred: {str(e)}") + return None + + @http.route('/payment/tap/process_payment', type='json', auth='public') + def tap_process_payment(self, payload, data): + """Process a payment using the Tap Payment Gateway.""" + tap_credentials = http.request.env.ref( + 'tap_payment_gateway.payment_provider_tap').sudo() + card_token = payload + payment_url = "https://api.tap.company/v2/charges" + partner = request.env['res.partner'].sudo().browse(data['partner_id']) + redirect_url = request.httprequest.host_url + 'payment/status' + payload = { + "amount": str(data['amount']), + "currency": data.get('currency', 'KWD'), + "description": data['reference'], + "source": { + "id": card_token, + "type": "card" + }, + "customer": { + "first_name": partner.sudo().name, + "last_name": "", + "email": partner.sudo().email, + "phone": { + "number": partner.sudo().phone + } + }, + "redirect": {"url": redirect_url}} + headers = { + "accept": "application/json", + "content-type": "application/json", + "Authorization": f"Bearer {tap_credentials.tap_secret_key}" + } + try: + response = requests.post(payment_url, json=payload, + headers=headers) + if response.status_code == 200: + payment_data = response.json() + tap_sudo = (request.env['payment.transaction'].sudo() + ._get_tx_from_notification_data('tap', + payment_data)) + tap_sudo._process_notification_data(payment_data) + payment_url = payment_data['redirect']['url'] + return {'success': True, 'payment_url': payment_url} + else: + error_message = response.json().get('message', + 'Payment processing failed') + _logger.error(f"Payment processing failed: {error_message}") + return False + except Exception as e: + _logger.error( + f"An error occurred during payment processing: {str(e)}") + return False diff --git a/tap_payment_gateway/data/payment_provider_data.xml b/tap_payment_gateway/data/payment_provider_data.xml new file mode 100644 index 000000000..d9421dc96 --- /dev/null +++ b/tap_payment_gateway/data/payment_provider_data.xml @@ -0,0 +1,15 @@ + + + + + + Tap + tap + Tap + + + + + + + diff --git a/tap_payment_gateway/doc/RELEASE_NOTES.md b/tap_payment_gateway/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..f8f69a6bd --- /dev/null +++ b/tap_payment_gateway/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 01.03.2024 +#### Version 16.0.1.0.0 +#### ADD +- Initial Commit for Tap Payment Gateway diff --git a/tap_payment_gateway/models/__init__.py b/tap_payment_gateway/models/__init__.py new file mode 100644 index 000000000..4108403ae --- /dev/null +++ b/tap_payment_gateway/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import payment_transaction +from . import payment_provider diff --git a/tap_payment_gateway/models/payment_provider.py b/tap_payment_gateway/models/payment_provider.py new file mode 100644 index 000000000..8f410ad0b --- /dev/null +++ b/tap_payment_gateway/models/payment_provider.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import api, fields, models + + +class PaymentProvider(models.Model): + """ Payment Provider Model for Tap """ + _inherit = 'payment.provider' + + code = fields.Selection(selection_add=[('tap', "Tap")], + ondelete={'tap': 'set default'}, + string="Provider Code", + help="The code that represents the Tap payment" + " provider.") + tap_secret_key = fields.Char(string="Tap Secret Key", required=True, + default="sk_test_XKokBfNWv6FIYuTMg5sLPjhJ", + help="The secret key provided by Tap for API" + " authentication.") + tap_publishable_key = fields.Char(string="Tap Publishable Key", + required=True, + default="pk_test_EtHFV4BuPQokJT6jiROls87Y", + help="The publishable key provided by" + " Tap for API authentication.") + + @api.model + def _get_payment_method_information(self): + """ Get Payment Method Information for Tap """ + res = super()._get_payment_method_information() + res['tap'] = {'mode': 'unique', + 'domain': [('type', '=', 'bank')]} + return res diff --git a/tap_payment_gateway/models/payment_transaction.py b/tap_payment_gateway/models/payment_transaction.py new file mode 100644 index 000000000..f402fe114 --- /dev/null +++ b/tap_payment_gateway/models/payment_transaction.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author:Jumana Jabin MP (odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo import models, _ +from odoo.exceptions import ValidationError + + +class PaymentTransaction(models.Model): + """Payment Transaction Model for handling transactions with payment + providers.""" + _inherit = 'payment.transaction' + + def _get_tx_from_notification_data(self, provider_code, notification_data): + """Get the transaction from notification data.""" + tx = super()._get_tx_from_notification_data(provider_code, + notification_data) + if provider_code != 'tap' or len(tx) == 1: + return tx + reference = notification_data.get( + 'description').split('-')[0] + tx = self.search( + [('reference', '=', reference), ('provider_code', '=', 'tap')]) + if not tx: + raise ValidationError( + "Tap: " + _("No transaction found matching reference %s.", + reference)) + return tx + + def _process_notification_data(self, notification_data): + """Process the notification data received from Tap""" + super()._process_notification_data(notification_data) + if self.provider_code != 'tap': + return + self._set_done() diff --git a/tap_payment_gateway/static/src/description/assets/icons/check.png b/tap_payment_gateway/static/src/description/assets/icons/check.png new file mode 100644 index 000000000..c8e85f51d Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/check.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/chevron.png b/tap_payment_gateway/static/src/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/chevron.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/cogs.png b/tap_payment_gateway/static/src/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/cogs.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/consultation.png b/tap_payment_gateway/static/src/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/consultation.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/ecom-black.png b/tap_payment_gateway/static/src/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/ecom-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/education-black.png b/tap_payment_gateway/static/src/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/education-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/hotel-black.png b/tap_payment_gateway/static/src/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/hotel-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/license.png b/tap_payment_gateway/static/src/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/license.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/lifebuoy.png b/tap_payment_gateway/static/src/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/lifebuoy.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/manufacturing-black.png b/tap_payment_gateway/static/src/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/manufacturing-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/pos-black.png b/tap_payment_gateway/static/src/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/pos-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/puzzle.png b/tap_payment_gateway/static/src/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/puzzle.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/restaurant-black.png b/tap_payment_gateway/static/src/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/restaurant-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/service-black.png b/tap_payment_gateway/static/src/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/service-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/trading-black.png b/tap_payment_gateway/static/src/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/trading-black.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/training.png b/tap_payment_gateway/static/src/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/training.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/update.png b/tap_payment_gateway/static/src/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/update.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/user.png b/tap_payment_gateway/static/src/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/user.png differ diff --git a/tap_payment_gateway/static/src/description/assets/icons/wrench.png b/tap_payment_gateway/static/src/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/icons/wrench.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/categories.png b/tap_payment_gateway/static/src/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/categories.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/check-box.png b/tap_payment_gateway/static/src/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/check-box.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/compass.png b/tap_payment_gateway/static/src/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/compass.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/corporate.png b/tap_payment_gateway/static/src/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/corporate.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/customer-support.png b/tap_payment_gateway/static/src/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/customer-support.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/cybrosys-logo.png b/tap_payment_gateway/static/src/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/cybrosys-logo.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/features.png b/tap_payment_gateway/static/src/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/features.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/logo.png b/tap_payment_gateway/static/src/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/logo.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/pictures.png b/tap_payment_gateway/static/src/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/pictures.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/pie-chart.png b/tap_payment_gateway/static/src/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/pie-chart.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/right-arrow.png b/tap_payment_gateway/static/src/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/right-arrow.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/star.png b/tap_payment_gateway/static/src/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/star.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/support.png b/tap_payment_gateway/static/src/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/support.png differ diff --git a/tap_payment_gateway/static/src/description/assets/misc/whatsapp.png b/tap_payment_gateway/static/src/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/misc/whatsapp.png differ diff --git a/tap_payment_gateway/static/src/description/assets/modules/11.png b/tap_payment_gateway/static/src/description/assets/modules/11.png new file mode 100644 index 000000000..ed11bd818 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/modules/11.png differ diff --git a/tap_payment_gateway/static/src/description/assets/modules/12.png b/tap_payment_gateway/static/src/description/assets/modules/12.png new file mode 100644 index 000000000..6c3f4e8c3 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/modules/12.png differ diff --git a/tap_payment_gateway/static/src/description/assets/modules/13.png b/tap_payment_gateway/static/src/description/assets/modules/13.png new file mode 100644 index 000000000..e76acf229 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/modules/13.png differ diff --git a/tap_payment_gateway/static/src/description/assets/modules/14.png b/tap_payment_gateway/static/src/description/assets/modules/14.png new file mode 100644 index 000000000..5738a486e Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/modules/14.png differ diff --git a/tap_payment_gateway/static/src/description/assets/modules/15.png b/tap_payment_gateway/static/src/description/assets/modules/15.png new file mode 100644 index 000000000..023f7926e Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/modules/15.png differ diff --git a/tap_payment_gateway/static/src/description/assets/modules/16.png b/tap_payment_gateway/static/src/description/assets/modules/16.png new file mode 100644 index 000000000..1c98e213f Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/modules/16.png differ diff --git a/tap_payment_gateway/static/src/description/assets/screenshots/1.png b/tap_payment_gateway/static/src/description/assets/screenshots/1.png new file mode 100644 index 000000000..72c25a0c6 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/screenshots/1.png differ diff --git a/tap_payment_gateway/static/src/description/assets/screenshots/2.png b/tap_payment_gateway/static/src/description/assets/screenshots/2.png new file mode 100644 index 000000000..7a29394cb Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/screenshots/2.png differ diff --git a/tap_payment_gateway/static/src/description/assets/screenshots/4.png b/tap_payment_gateway/static/src/description/assets/screenshots/4.png new file mode 100644 index 000000000..52853f5f7 Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/screenshots/4.png differ diff --git a/tap_payment_gateway/static/src/description/assets/screenshots/5.png b/tap_payment_gateway/static/src/description/assets/screenshots/5.png new file mode 100644 index 000000000..f7a0ea18d Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/screenshots/5.png differ diff --git a/tap_payment_gateway/static/src/description/assets/screenshots/hero.gif b/tap_payment_gateway/static/src/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..4719295ef Binary files /dev/null and b/tap_payment_gateway/static/src/description/assets/screenshots/hero.gif differ diff --git a/tap_payment_gateway/static/src/description/banner.jpg b/tap_payment_gateway/static/src/description/banner.jpg new file mode 100644 index 000000000..aca26ad29 Binary files /dev/null and b/tap_payment_gateway/static/src/description/banner.jpg differ diff --git a/tap_payment_gateway/static/src/description/icon.png b/tap_payment_gateway/static/src/description/icon.png new file mode 100644 index 000000000..4f3794f2e Binary files /dev/null and b/tap_payment_gateway/static/src/description/icon.png differ diff --git a/tap_payment_gateway/static/src/description/icon1.png b/tap_payment_gateway/static/src/description/icon1.png new file mode 100644 index 000000000..a65854375 Binary files /dev/null and b/tap_payment_gateway/static/src/description/icon1.png differ diff --git a/tap_payment_gateway/static/src/description/index.html b/tap_payment_gateway/static/src/description/index.html new file mode 100644 index 000000000..a6d5d0aaf --- /dev/null +++ b/tap_payment_gateway/static/src/description/index.html @@ -0,0 +1,639 @@ +
+ +
+ +
+
Community +
+
Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+ +

+ Tap Payment Gateway

+

+ Make Payments on the Website Through Tap Gateway

+ + + +
+
+
+
+ + +
+
+ +
+

+ Explore This + Module

+
+ + + + +
+
+ +
+

+ Overview +

+
+
+
+ Tap Payment Gateway is a method which is used to simplifies the online + payments. +
+
+ + + +
+
+ +
+

+ Features +

+
+
+
+
+ + Community & Enterprise Support +
+
+ + Accepts Credit/Debit Card Transactions +
+
+ + Through ACS Emulator, User Can Verify Their Payment Details. +
+
+
+ + + +
+
+ +
+

+ Screenshots +

+
+
+
+ +
+

+ Log in to your + Tap account. + + Create account

+ +
+

+ After installing the + module go to, Website --> Configuration --> Payment + Provider.After activating the Tap Acquirer fill + in the Secret Key and Published Key +

+ +
+

+ Select 'Tap' option on checkout.Fill in the card + details and click 'Pay Now' button +

+ +
+

+ After a successful + transaction you will be redirected to this window +

+ +
+
+
+ + +
+
+ +
+

+ Related + Products +

+
+
+
+ +
+
+ + + + +
+
+ +
+

+ Our Services +

+
+ +
+
+
+
+ +
+
+ Odoo + Customization
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Support
+
+ + +
+
+ +
+
+ Hire + Odoo + Developer
+
+ +
+
+ +
+
+ Odoo + Integration
+
+ +
+
+ +
+
+ Odoo + Migration
+
+ + +
+
+ +
+
+ Odoo + Consultancy
+
+ +
+
+ +
+
+ Odoo + Implementation
+
+ +
+
+ +
+
+ Odoo + Licensing Consultancy
+
+
+ +
+ + + + + +
+
+ +
+

+ Our + Industries +

+
+ +
+
+
+
+ +
+ Trading +
+

+ Easily procure + and + sell your products

+
+
+ +
+
+ +
+ POS +
+

+ Easy + configuration + and convivial experience

+
+
+ +
+
+ +
+ Education +
+

+ A platform for + educational management

+
+
+ +
+
+ +
+ Manufacturing +
+

+ Plan, track and + schedule your operations

+
+
+ +
+
+ +
+ E-commerce & Website +
+

+ Mobile + friendly, + awe-inspiring product pages

+
+
+ +
+
+ +
+ Service Management +
+

+ Keep track of + services and invoice

+
+
+ +
+
+ +
+ Restaurant +
+

+ Run your bar or + restaurant methodically

+
+
+ +
+
+ +
+ Hotel Management +
+

+ An + all-inclusive + hotel management application

+
+
+
+
+ + + + +
+
+ +
+

+ Support +

+
+
+
+
+
+
+ +
+
+

Need Help?

+

Got questions or need help? + Get in touch.

+ +

+ odoo@cybrosys.com

+
+
+
+
+
+
+
+ +
+
+

WhatsApp

+

Say hi to us on WhatsApp!

+ +

+ +91 86068 + 27707

+
+
+
+
+
+
+
+ +
+
+
+ \ No newline at end of file diff --git a/tap_payment_gateway/static/src/js/payment_form.js b/tap_payment_gateway/static/src/js/payment_form.js new file mode 100644 index 000000000..3e0ff2beb --- /dev/null +++ b/tap_payment_gateway/static/src/js/payment_form.js @@ -0,0 +1,63 @@ +odoo.define('tap_payment_gateway.payment_form', function (require) { + "use strict"; + /** + * Tap Payment Gateway Payment Form Module + * + * This module extends the payment checkout form and payment manage form + * for processing payments with the Tap payment provider. + */ + const core = require('web.core'); + const ajax = require('web.ajax'); + const _t = core._t; + const checkoutForm = require('payment.checkout_form'); + const manageForm = require('payment.manage_form'); + const tapMixin = { + /** + * Process Redirect Payment for Tap Provider + * + * @param {string} provider - The payment provider. + * @param {string} acquirerId - The acquirer ID. + * @param {Object} processingValues - The processing values. + * @returns {Promise} A promise that resolves when the payment is processed. + */ + _processRedirectPayment: function (provider, acquirerId, processingValues) { + if (provider !== 'tap') { + return this._super(...arguments); + } + const self = this; + return ajax.jsonRpc("/tap", 'call', { + card_number: self.$('#cc_number').val(), + exp_month: self.$('#cc_expiry_month').val(), + exp_year: self.$('#cc_expiry_year').val(), + cvc: self.$('#cc_cvv').val(), + cardholder_name: self.$('#cc_holder_name').val(), + total_amount: self.txContext.amount, + reference: processingValues['reference'] + }).then(token => { + if (token) { + ajax.jsonRpc("/payment/tap/process_payment", 'call', { + payload: token, + data: processingValues + }).then(response => { + if (response.success) { + const payment_url = response.payment_url; + window.location.href = payment_url; + } else { + const error_message = response.error_message || 'Payment processing failed'; + } + }); + } + }); + }, + _prepareInlineForm: function (provider, paymentOptionId, flow) { + if (provider !== 'tap') { + return this._super(...arguments); + } + if (flow === 'token') { + return Promise.resolve(); + } + }, + }; + checkoutForm.include(tapMixin); + manageForm.include(tapMixin); +}); diff --git a/tap_payment_gateway/views/payment_provider_views.xml b/tap_payment_gateway/views/payment_provider_views.xml new file mode 100644 index 000000000..4ad5b0e4c --- /dev/null +++ b/tap_payment_gateway/views/payment_provider_views.xml @@ -0,0 +1,20 @@ + + + + + payment.provider.form.inherit + payment.provider + + + + + + + + + + + diff --git a/tap_payment_gateway/views/tap_payment_templates.xml b/tap_payment_gateway/views/tap_payment_templates.xml new file mode 100644 index 000000000..a9f0d59b0 --- /dev/null +++ b/tap_payment_gateway/views/tap_payment_templates.xml @@ -0,0 +1,44 @@ + + + + + + +