diff --git a/advanced_payment_cybersource/README.rst b/advanced_payment_cybersource/README.rst new file mode 100644 index 000000000..991b303b3 --- /dev/null +++ b/advanced_payment_cybersource/README.rst @@ -0,0 +1,44 @@ +.. 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 + +Odoo CyberSource Payment Gateway +================================ +* Odoo CyberSource Payment Gateway for Odoo 15 , This module is used to a safe payment with cybersource. + +Configuration +============= +No additional configuration required + +License +------- +General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developer: (V15) Mufeeda Shirin, +* Contact: odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@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 + +For support and more information, please visit https://www.cybrosys.com + +Further information +=================== +HTML Description: ``__ diff --git a/advanced_payment_cybersource/__init__.py b/advanced_payment_cybersource/__init__.py new file mode 100644 index 000000000..1b154b109 --- /dev/null +++ b/advanced_payment_cybersource/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 controllers +from . import models + diff --git a/advanced_payment_cybersource/__manifest__.py b/advanced_payment_cybersource/__manifest__.py new file mode 100644 index 000000000..ce10659a2 --- /dev/null +++ b/advanced_payment_cybersource/__manifest__.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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': 'Odoo CyberSource Payment Gateway', + 'version': '15.0.1.0.0', + 'category': 'Website,eCommerce ', + 'summary': """cybersource payment gateway as a payment provider in which + is used pay the order through website.""", + 'description': """cybersource payment gateway as a payment provider in which + is used pay the order through website.It provides an easy and fast payment + processing through cybersource.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': 'https://www.cybrosys.com', + 'depends': ['payment', 'website_sale'], + 'data': [ + 'views/payment_templates.xml', + 'data/advanced_payment_cybersource_data.xml', + 'views/payment_provider_views.xml', + 'views/payment_transaction_views.xml', + ], + 'assets': { + 'web.assets_frontend': [ + '/advanced_payment_cybersource/static/src/js/payment_form.js', + ], + }, + 'external_dependencies': { + 'python': ['cybersource-rest-client-python'] + }, + 'images': ['static/description/banner.png'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/advanced_payment_cybersource/controllers/__init__.py b/advanced_payment_cybersource/controllers/__init__.py new file mode 100644 index 000000000..be9f21d69 --- /dev/null +++ b/advanced_payment_cybersource/controllers/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 advanced_payment_cybersource diff --git a/advanced_payment_cybersource/controllers/advanced_payment_cybersource.py b/advanced_payment_cybersource/controllers/advanced_payment_cybersource.py new file mode 100644 index 000000000..2da5a34e2 --- /dev/null +++ b/advanced_payment_cybersource/controllers/advanced_payment_cybersource.py @@ -0,0 +1,153 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 json +import os +from CyberSource import * +from CyberSource.logging.log_configuration import LogConfiguration +from odoo import http, _ +from odoo.exceptions import ValidationError +from odoo.http import request +import logging + +_logger = logging.getLogger(__name__) + + +class WebsiteSaleFormCyberSource(http.Controller): + """This class is used to do the payment""" + + @http.route('/payment/cybersource/simulate_payment', type='json', + auth='public') + def payment_with_flex_token(self, **post): + """This is used for payment processing using the flex token""" + address = request.env['res.partner'].browse( + post.get('values')['partner']) + client_reference_information = Ptsv2paymentsClientReferenceInformation( + code=post.get('reference')) + processing_information_capture = bool(post) + processing_information = Ptsv2paymentsProcessingInformation( + capture=processing_information_capture, + commerce_indicator="vbv" + ) + payment_information_tokenized_card = Ptsv2paymentsPaymentInformationTokenizedCard( + number=post.get('customer_input')['card_num'], + expiration_month=post.get('customer_input')['exp_month'], + expiration_year=post.get('customer_input')['exp_year'], + transaction_type="1" + ) + payment_information = Ptsv2paymentsPaymentInformation( + tokenized_card=payment_information_tokenized_card.__dict__) + order_information_amount_details = Ptsv2paymentsOrderInformationAmountDetails( + total_amount=post.get('values')['amount'], + currency=request.env['res.currency'].browse( + post.get('values')['currency']).name + ) + order_information_bill_to = Ptsv2paymentsOrderInformationBillTo( + first_name=address.name.split(' ')[0] if len( + address.name.split(' ')) > 0 else address.name, + last_name=address.name.split(' ')[1] if len( + address.name.split(' ')) > 1 else address.name, + address1=address.state_id.name or False, + locality=address.city or False, + administrative_area="CA", + postal_code=address.zip or False, + country=address.country_id.name or False, + email=address.email, + phone_number=address.phone + ) + order_information = Ptsv2paymentsOrderInformation( + amount_details=order_information_amount_details.__dict__, + bill_to=order_information_bill_to.__dict__ + ) + consumer_authentication_information = Ptsv2paymentsConsumerAuthenticationInformation( + cavv="AAABCSIIAAAAAAACcwgAEMCoNh+=", + xid="T1Y0OVcxMVJJdkI0WFlBcXptUzE=" + ) + request_obj = CreatePaymentRequest( + client_reference_information=client_reference_information.__dict__, + processing_information=processing_information.__dict__, + payment_information=payment_information.__dict__, + order_information=order_information.__dict__, + consumer_authentication_information=consumer_authentication_information.__dict__ + ) + request_obj = self.del_none(request_obj.__dict__) + request_obj = json.dumps(request_obj) + try: + client_config = self.get_configuration() + api_instance = PaymentsApi(client_config) + return_data, status, body = api_instance.create_payment(request_obj) + status_data = { + 'reference': post.get('reference'), + 'payment_details': post.get('customer_input')['card_num'], + 'simulated_state': 'done' + } + if status == 201: + tx = request.env[ + 'payment.transaction'].sudo()._get_tx_from_feedback_data( + 'cybersource', status_data) + tx._handle_feedback_data('cybersource', status_data) + else: + raise ValidationError(_("Your Payment has not been processed")) + return return_data + except Exception as e: + _logger.info( + "\nException when calling PaymentsApi->create_payment: %s\n" % e) + + def get_configuration(self): + """This is used for Payment provider configuration""" + record = request.env['payment.acquirer'].sudo().search( + [('provider', '=', 'cybersource')]) + configuration_dictionary = { + "authentication_type": "http_signature", + "merchantid": record.cyber_merchant, + "run_environment": "apitest.cybersource.com", + "request_json_path": "", + "key_alias": "testrest", + "key_password": "testrest", + "key_file_name": "testrest", + "keys_directory": os.path.join(os.getcwd(), "resources"), + "merchant_keyid": record.cyber_key, + "merchant_secretkey": record.cyber_secret_key, + "use_metakey": False, + "portfolio_id": "", + "timeout": 1000, + } + log_config = LogConfiguration() + log_config.set_enable_log(True) + log_config.set_log_directory(os.path.join(os.getcwd(), "Logs")) + log_config.set_log_file_name("cybs") + log_config.set_log_maximum_size(10487560) + log_config.set_log_level("Debug") + log_config.set_enable_masking(False) + log_config.set_log_format( + "%(asctime)s - %(name)s - %(levelname)s - %(message)s") + log_config.set_log_date_format("%Y-%m-%d %H:%M:%S") + configuration_dictionary["log_config"] = log_config + return configuration_dictionary + + def del_none(self, data): + """This is used to check and remove any value having null""" + for key, value in list(data.items()): + if value is None: + del data[key] + elif isinstance(value, dict): + self.del_none(value) + return data diff --git a/advanced_payment_cybersource/data/advanced_payment_cybersource_data.xml b/advanced_payment_cybersource/data/advanced_payment_cybersource_data.xml new file mode 100644 index 000000000..971b1ebb6 --- /dev/null +++ b/advanced_payment_cybersource/data/advanced_payment_cybersource_data.xml @@ -0,0 +1,24 @@ + + + + + + cybersource + Cybersource Payment + + + False + False + partial + True + True + + + + Cybersource + cybersource + inbound + + + diff --git a/advanced_payment_cybersource/doc/RELEASE_NOTES.md b/advanced_payment_cybersource/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..d2847e4dc --- /dev/null +++ b/advanced_payment_cybersource/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 12.08.2024 +#### Version 15.0.1.0.0 +##### ADD + +- Initial Commit for Odoo CyberSource Payment Gateway diff --git a/advanced_payment_cybersource/models/__init__.py b/advanced_payment_cybersource/models/__init__.py new file mode 100644 index 000000000..a99a7de59 --- /dev/null +++ b/advanced_payment_cybersource/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 account_payment_method +from . import payment_provider +from . import payment_transaction diff --git a/advanced_payment_cybersource/models/account_payment_method.py b/advanced_payment_cybersource/models/account_payment_method.py new file mode 100644 index 000000000..be58a457d --- /dev/null +++ b/advanced_payment_cybersource/models/account_payment_method.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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, models + + +class AccountPaymentMethod(models.Model): + """"This is the class for Payment method""" + _inherit = 'account.payment.method' + + @api.model + def _get_payment_method_information(self): + """Payment method for cybersource""" + res = super()._get_payment_method_information() + res['cybersource'] = {'mode': 'multi', + 'domain': [('type', '=', 'bank')]} + return res diff --git a/advanced_payment_cybersource/models/payment_provider.py b/advanced_payment_cybersource/models/payment_provider.py new file mode 100644 index 000000000..cccd2c352 --- /dev/null +++ b/advanced_payment_cybersource/models/payment_provider.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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 fields, models + + +class PaymentProvider(models.Model): + """Adding payment provider""" + _inherit = 'payment.acquirer' + + provider = fields.Selection(selection_add=[('cybersource', 'Cybersource')], + ondelete={'cybersource': 'set default'}, + string='Provider', + help='Identifying the payment method in payment' + ' methods') + cyber_merchant = fields.Char(string='Merchant ID', + help='Cybersource merchant id') + cyber_secret_key = fields.Char(string='Secret Key', + help='Cybersource secret key for the payment') + cyber_key = fields.Char(string='Secret Key', + help='Cyber key for the payment') diff --git a/advanced_payment_cybersource/models/payment_transaction.py b/advanced_payment_cybersource/models/payment_transaction.py new file mode 100644 index 000000000..6b658d408 --- /dev/null +++ b/advanced_payment_cybersource/models/payment_transaction.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions() +# +# 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, _ +from odoo.exceptions import ValidationError + + +class PaymentTransaction(models.Model): + """Inheriting payment.transaction""" + _inherit = 'payment.transaction' + + capture_manually = fields.Boolean(related='acquirer_id.capture_manually', + string="Capture Manually", + help='Enable manual capturing for the payment transaction') + + def action_cybersource_set_done(self): + """ Set the state of the demo transaction to 'done'.""" + self.handle_notification() + + def action_cybersource_set_canceled(self): + """Set the state of the demo transaction to 'cancel'""" + self.handle_notification() + + def action_cybersource_set_error(self): + """Set the state of the demo transaction to 'error'""" + self.handle_notification() + + def handle_notification(self): + """This is used to handle the notification""" + self.ensure_one() + if self.provider != 'cybersource': + return + notification_data = {'reference': self.reference, + 'simulated_state': 'error'} + self._handle_feedback_data('cybersource', notification_data) + + def _handle_feedback_data(self, provider, notification_data): + """Handle notification data and execute callback""" + received_tx = self._get_tx_from_feedback_data(provider, + notification_data) + received_tx._process_feedback_data(notification_data) + received_tx._execute_callback() + return received_tx + + def _process_feedback_data(self, notification_data): + """Process the notification data.""" + super()._process_feedback_data(notification_data) + if self.provider != 'cybersource': + return + self.acquirer_reference = f'cybersource-{self.reference}' + state = notification_data['simulated_state'] + if state == 'pending': + self._set_pending() + elif state == 'done': + if self.capture_manually and not notification_data.get( + 'manual_capture'): + self._set_authorized() + else: + self._set_done() + # Immediately post-process the transaction if it is a refund, as + # the post-processing + # will not be triggered by a customer browsing the transaction + # from the portal. + if self.operation == 'refund': + self.env.ref( + 'payment.cron_post_process_payment_tx')._trigger() + elif state == 'cancel': + self._set_canceled() + else: # Simulate an error state. + self._set_error( + _("You selected the following demo payment status: %s", state)) + + @api.model + def _get_tx_from_feedback_data(self, provider_code, data): + """ Find the transaction based on the notification data.""" + tx = super()._get_tx_from_feedback_data(provider_code, data) + if provider_code != 'cybersource': + return tx + reference = data.get('reference') + tx = self.search( + [('reference', '=', reference), + ('provider', '=', 'cybersource')]) + if not tx: + raise ValidationError( + "Cyber Source " + ( + "No transaction found matching reference %s.", reference) + ) + return tx diff --git a/advanced_payment_cybersource/static/description/assets/icons/check.png b/advanced_payment_cybersource/static/description/assets/icons/check.png new file mode 100644 index 000000000..e9d54a8f5 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/check.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/chevron.png b/advanced_payment_cybersource/static/description/assets/icons/chevron.png new file mode 100644 index 000000000..2089293d6 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/chevron.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/cogs.png b/advanced_payment_cybersource/static/description/assets/icons/cogs.png new file mode 100644 index 000000000..95d0bad62 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/cogs.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/consultation.png b/advanced_payment_cybersource/static/description/assets/icons/consultation.png new file mode 100644 index 000000000..8319d4baa Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/consultation.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/ecom-black.png b/advanced_payment_cybersource/static/description/assets/icons/ecom-black.png new file mode 100644 index 000000000..a9385ff13 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/ecom-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/education-black.png b/advanced_payment_cybersource/static/description/assets/icons/education-black.png new file mode 100644 index 000000000..3eb09b27b Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/education-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/hotel-black.png b/advanced_payment_cybersource/static/description/assets/icons/hotel-black.png new file mode 100644 index 000000000..130f613be Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/hotel-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/license.png b/advanced_payment_cybersource/static/description/assets/icons/license.png new file mode 100644 index 000000000..a5869797e Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/license.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/lifebuoy.png b/advanced_payment_cybersource/static/description/assets/icons/lifebuoy.png new file mode 100644 index 000000000..658d56ccc Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/lifebuoy.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/logo.png b/advanced_payment_cybersource/static/description/assets/icons/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/logo.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/manufacturing-black.png b/advanced_payment_cybersource/static/description/assets/icons/manufacturing-black.png new file mode 100644 index 000000000..697eb0e9f Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/manufacturing-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/pos-black.png b/advanced_payment_cybersource/static/description/assets/icons/pos-black.png new file mode 100644 index 000000000..97c0f90c1 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/pos-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/puzzle.png b/advanced_payment_cybersource/static/description/assets/icons/puzzle.png new file mode 100644 index 000000000..65cf854e7 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/puzzle.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/restaurant-black.png b/advanced_payment_cybersource/static/description/assets/icons/restaurant-black.png new file mode 100644 index 000000000..4a35eb939 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/restaurant-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/service-black.png b/advanced_payment_cybersource/static/description/assets/icons/service-black.png new file mode 100644 index 000000000..301ab51cb Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/service-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/trading-black.png b/advanced_payment_cybersource/static/description/assets/icons/trading-black.png new file mode 100644 index 000000000..9398ba2f1 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/trading-black.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/training.png b/advanced_payment_cybersource/static/description/assets/icons/training.png new file mode 100644 index 000000000..884ca024d Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/training.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/update.png b/advanced_payment_cybersource/static/description/assets/icons/update.png new file mode 100644 index 000000000..ecbc5a01a Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/update.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/user.png b/advanced_payment_cybersource/static/description/assets/icons/user.png new file mode 100644 index 000000000..6ffb23d9f Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/user.png differ diff --git a/advanced_payment_cybersource/static/description/assets/icons/wrench.png b/advanced_payment_cybersource/static/description/assets/icons/wrench.png new file mode 100644 index 000000000..6c04dea0f Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/wrench.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/categories.png b/advanced_payment_cybersource/static/description/assets/misc/categories.png new file mode 100644 index 000000000..bedf1e0b1 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/categories.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/check-box.png b/advanced_payment_cybersource/static/description/assets/misc/check-box.png new file mode 100644 index 000000000..42caf24b9 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/check-box.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/compass.png b/advanced_payment_cybersource/static/description/assets/misc/compass.png new file mode 100644 index 000000000..d5fed8faa Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/compass.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/corporate.png b/advanced_payment_cybersource/static/description/assets/misc/corporate.png new file mode 100644 index 000000000..2eb13edbf Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/corporate.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/customer-support.png b/advanced_payment_cybersource/static/description/assets/misc/customer-support.png new file mode 100644 index 000000000..79efc72ed Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/customer-support.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/cybrosys-logo.png b/advanced_payment_cybersource/static/description/assets/misc/cybrosys-logo.png new file mode 100644 index 000000000..cc3cc0ccf Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/cybrosys-logo.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/features.png b/advanced_payment_cybersource/static/description/assets/misc/features.png new file mode 100644 index 000000000..b41769f77 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/features.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/logo.png b/advanced_payment_cybersource/static/description/assets/misc/logo.png new file mode 100644 index 000000000..478462d3e Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/logo.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/pictures.png b/advanced_payment_cybersource/static/description/assets/misc/pictures.png new file mode 100644 index 000000000..56d255fe9 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/pictures.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/pie-chart.png b/advanced_payment_cybersource/static/description/assets/misc/pie-chart.png new file mode 100644 index 000000000..426e05244 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/pie-chart.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/right-arrow.png b/advanced_payment_cybersource/static/description/assets/misc/right-arrow.png new file mode 100644 index 000000000..730984a06 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/right-arrow.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/star.png b/advanced_payment_cybersource/static/description/assets/misc/star.png new file mode 100644 index 000000000..2eb9ab29f Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/star.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/support.png b/advanced_payment_cybersource/static/description/assets/misc/support.png new file mode 100644 index 000000000..4f18b8b82 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/support.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/whatsapp.png b/advanced_payment_cybersource/static/description/assets/misc/whatsapp.png new file mode 100644 index 000000000..d513a5356 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/whatsapp.png differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/1.png b/advanced_payment_cybersource/static/description/assets/modules/1.png new file mode 100644 index 000000000..f3038d908 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/1.png differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/2.png b/advanced_payment_cybersource/static/description/assets/modules/2.png new file mode 100644 index 000000000..038886630 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/2.png differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/3.png b/advanced_payment_cybersource/static/description/assets/modules/3.png new file mode 100644 index 000000000..70f9f2026 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/3.png differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/4.png b/advanced_payment_cybersource/static/description/assets/modules/4.png new file mode 100644 index 000000000..309a9ab64 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/4.png differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/5.png b/advanced_payment_cybersource/static/description/assets/modules/5.png new file mode 100644 index 000000000..fd1059dec Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/5.png differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/6.png b/advanced_payment_cybersource/static/description/assets/modules/6.png new file mode 100644 index 000000000..6c38c9e40 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/6.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource01.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource01.png new file mode 100644 index 000000000..a82c1c663 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource01.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource02.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource02.png new file mode 100644 index 000000000..1211eb019 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource02.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource03.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource03.png new file mode 100644 index 000000000..e24baa53f Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource03.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource04.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource04.png new file mode 100644 index 000000000..18f6366fa Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource04.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource05.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource05.png new file mode 100644 index 000000000..447623c3a Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource05.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource06.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource06.png new file mode 100644 index 000000000..0a3a2de14 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource06.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource07.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource07.png new file mode 100644 index 000000000..dac7c6d6c Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource07.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource08.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource08.png new file mode 100644 index 000000000..6af97f68c Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource08.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource09.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource09.png new file mode 100644 index 000000000..7f0586a34 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource09.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource10.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource10.png new file mode 100644 index 000000000..7b7ca3927 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource10.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource11.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource11.png new file mode 100644 index 000000000..6afc0ca03 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource11.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/cybersource12.png b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource12.png new file mode 100644 index 000000000..a9260de04 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/cybersource12.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/hero.gif b/advanced_payment_cybersource/static/description/assets/screenshots/hero.gif new file mode 100644 index 000000000..526f39721 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/hero.gif differ diff --git a/advanced_payment_cybersource/static/description/banner.png b/advanced_payment_cybersource/static/description/banner.png new file mode 100644 index 000000000..074bf21e6 Binary files /dev/null and b/advanced_payment_cybersource/static/description/banner.png differ diff --git a/advanced_payment_cybersource/static/description/icon.png b/advanced_payment_cybersource/static/description/icon.png new file mode 100644 index 000000000..16e4aac52 Binary files /dev/null and b/advanced_payment_cybersource/static/description/icon.png differ diff --git a/advanced_payment_cybersource/static/description/index.html b/advanced_payment_cybersource/static/description/index.html new file mode 100644 index 000000000..a7c611228 --- /dev/null +++ b/advanced_payment_cybersource/static/description/index.html @@ -0,0 +1,729 @@ +
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+ +
+
+
+

+ Odoo CyberSource Payment Gateway

+

+ Pay Online For Website Orders Through CyberSource Payment + Gateway +

+ +
+
+ + + + +
+
+

+ Overview +

+
+ +
+

+ This module helps users to pay online through CyberSource + payment gateway from Odoo Website. +

+ +
+
+ +
+
+ +
+

+ Features +

+
+
+
+
+ + Available in Odoo 15.0 Community, Enterprise and Odoo.sh +
+
+ + Cybersource can process payments in more than 190 countries and 40 different currencies. +
+
+ + It accept a variety of different cards and payment types. +
+
+ + + Able to connect to around 100 acquirers/processors worldwide. + +
+ +
+
+ +
+
+

+ Screenshots +

+
+
+

+ Account Set Up

+

+ Create a test account + in the cybersource sandbox.

+ Cybersource + Account Link + +
+
+

+

+ +
+
+

+ Key And Secret Key

+

After Creating The Test Account They Will provide You The Key + And Shared Secret. + +

+
+

+ Merchant Id

+

+ After generation of the account we can get the merchant id. +

+ +
+
+

+ The payment gateway.

+

Cybersource Payment Gateway in Payment Acquirers

+ +
+
+

+ Credentials

+

Give the appropriate credentials for the payment provider

+ +
+
+

+ Payment Journal.

+

+ Add the journal to your provider +

+ +
+
+

+ Publish it in the website.

+ +
+
+

+ Payment

+

Select the payment provider and fill the card details +

+ +
+
+

+ The payment status

+ +
+
+

+ Corresponding Payment Transaction in the backend +

+ +
+
+

+ Corresponding sale order from website

+

+ you can create invoice from the sale order. +

+ +
+ +
+ + + +
+
+

Suggested 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

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

Need Help?

+
+
+
+ + +
+ +
+ +
+ +
+ WhatsApp +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/advanced_payment_cybersource/static/src/img/logo-cybersource.png b/advanced_payment_cybersource/static/src/img/logo-cybersource.png new file mode 100644 index 000000000..dd203e4e5 Binary files /dev/null and b/advanced_payment_cybersource/static/src/img/logo-cybersource.png differ diff --git a/advanced_payment_cybersource/static/src/js/payment_form.js b/advanced_payment_cybersource/static/src/js/payment_form.js new file mode 100644 index 000000000..474cfee2c --- /dev/null +++ b/advanced_payment_cybersource/static/src/js/payment_form.js @@ -0,0 +1,62 @@ +/** @odoo-module */ + +import core from "web.core"; +import checkoutForm from 'payment.checkout_form'; +import manageForm from 'payment.manage_form'; +const _t = core._t; +//Payment process with cybersource +const acceptCyberSourceMixin = { + _processRedirectPayment: function (code, providerId, processingValues) { + if (code !== 'cybersource') { + return this._super(...arguments); + } + var customerInputNumber = parseInt($('#customer_input_number').val()); + const customerInputName = $('#customer_input_name').val(); + const expMonth = $('#customer_input_month').val(); + const expYear = $('#customer_input_year').val(); + var self = this; + if(customerInputNumber == "") + { + self._displayError( + _t("Server Error"), + _t("We are not able to process your payment Card Number not entered") + ); + } + else if(expYear <= 2022) + { + self._displayError( + _t("Server Error"), + _t("We are not able to process your payment Expiry year is not valid") + ); + } + else if(expMonth == 0) + { + self._displayError( + _t("Server Error"), + _t("We are not able to process your payment Expiry month not valid.") + ); + } + else { + return this._rpc({ + route: '/payment/cybersource/simulate_payment', + params: { + 'reference': processingValues.reference, + 'customer_input': {'exp_year': expYear, + 'exp_month': expMonth, + 'name':customerInputName, + 'card_num':customerInputNumber, + }, + 'values':{'amount': processingValues.amount, + 'currency': processingValues.currency_id, + 'partner': processingValues.partner_id, + 'order': processingValues.reference + }, + }, + }) + .then(() => window.location = '/payment/status'); + } + }, +}; +checkoutForm.include(acceptCyberSourceMixin); +manageForm.include(acceptCyberSourceMixin); + diff --git a/advanced_payment_cybersource/views/payment_provider_views.xml b/advanced_payment_cybersource/views/payment_provider_views.xml new file mode 100644 index 000000000..07b4423d8 --- /dev/null +++ b/advanced_payment_cybersource/views/payment_provider_views.xml @@ -0,0 +1,29 @@ + + + + + + payment.provider.view.form.inherit.advanced.payment.cybersource + + payment.acquirer + + + + + + + + + + + + diff --git a/advanced_payment_cybersource/views/payment_templates.xml b/advanced_payment_cybersource/views/payment_templates.xml new file mode 100644 index 000000000..f9b06a7ab --- /dev/null +++ b/advanced_payment_cybersource/views/payment_templates.xml @@ -0,0 +1,59 @@ + + + + + \ No newline at end of file diff --git a/advanced_payment_cybersource/views/payment_transaction_views.xml b/advanced_payment_cybersource/views/payment_transaction_views.xml new file mode 100644 index 000000000..be627c46c --- /dev/null +++ b/advanced_payment_cybersource/views/payment_transaction_views.xml @@ -0,0 +1,35 @@ + + + + + + payment.transaction.view.form.inherit.advanced.payment.cybersource + + payment.transaction + + +
+ +
+
+
+