diff --git a/advanced_payment_cybersource/README.rst b/advanced_payment_cybersource/README.rst new file mode 100644 index 000000000..514aa066c --- /dev/null +++ b/advanced_payment_cybersource/README.rst @@ -0,0 +1,48 @@ +.. 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 +================================ +This module is used to make payments using Cybersource payment provider from website shop. + +Configuration +============= +* No Additional configuration is needed. + +License +------- +Lesser General Public License, Version 3 (LGPL v3). +(https://www.gnu.org/licenses/lgpl-3.0-standalone.html) + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: (V16) Gayathri V, + (V17) Aysha Shalin + 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/advanced_payment_cybersource/__init__.py b/advanced_payment_cybersource/__init__.py new file mode 100644 index 000000000..82bbf18fa --- /dev/null +++ b/advanced_payment_cybersource/__init__.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin () +# +# 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 model + +from odoo.addons.payment import setup_provider, reset_payment_provider + + +def post_init_hook(env): + """ Create `account.payment.method` records for the installed payment + providers. """ + setup_provider(env, 'cybersource') + + +def uninstall_hook(env): + """ Delete `account.payment.method` records created for the installed + payment providers. """ + reset_payment_provider(env, 'cybersource') diff --git a/advanced_payment_cybersource/__manifest__.py b/advanced_payment_cybersource/__manifest__.py new file mode 100644 index 000000000..c955500d8 --- /dev/null +++ b/advanced_payment_cybersource/__manifest__.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin () +# +# 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': '17.0.1.0.0', + 'category': 'eCommerce ', + 'summary': """Make payments using Cybersource payment provider from website + shop.""", + 'description': """This module enables customers to pay for their order from + the website through the Cybersource payment gateway, which is a payment + provider. It provides 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/cybersource_payment_method_data.xml', + 'data/cybersource_payment_provider_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'] + }, + '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/advanced_payment_cybersource/controllers/__init__.py b/advanced_payment_cybersource/controllers/__init__.py new file mode 100644 index 000000000..6d82444df --- /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: Aysha Shalin () +# +# 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..392a58dee --- /dev/null +++ b/advanced_payment_cybersource/controllers/advanced_payment_cybersource.py @@ -0,0 +1,150 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin () +# +# 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 = False + if post: + processing_information_capture = True + 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] or address.name, + last_name=address.name.split(' ')[ + 1] or 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: + _logger.info("Creating payment request") + 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: + request.env[ + 'payment.transaction'].sudo()._handle_notification_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) + + if __name__ == "__main__": + """This is used to Payment processing using the flex token""" + payment_with_flex_token() + + def get_configuration(self): + """ This is used for Payment provider configuration """ + record = request.env['payment.provider'].sudo().search( + [('code', '=', '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 checks 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/cybersource_payment_method_data.xml b/advanced_payment_cybersource/data/cybersource_payment_method_data.xml new file mode 100644 index 000000000..c44071ff9 --- /dev/null +++ b/advanced_payment_cybersource/data/cybersource_payment_method_data.xml @@ -0,0 +1,14 @@ + + + + + Cybersource + cybersource + + 12 + True + False + partial + + \ No newline at end of file diff --git a/advanced_payment_cybersource/data/cybersource_payment_provider_data.xml b/advanced_payment_cybersource/data/cybersource_payment_provider_data.xml new file mode 100644 index 000000000..5c76098b9 --- /dev/null +++ b/advanced_payment_cybersource/data/cybersource_payment_provider_data.xml @@ -0,0 +1,15 @@ + + + + + Cybersource Payment + cybersource + + + + + + + \ No newline at end of file diff --git a/advanced_payment_cybersource/doc/RELEASE_NOTES.md b/advanced_payment_cybersource/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..109494a32 --- /dev/null +++ b/advanced_payment_cybersource/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 29.07.2024 +#### Version 17.0.1.0.0 +##### ADD + +- Initial Commit for Odoo CyberSource Payment Gateway diff --git a/advanced_payment_cybersource/model/__init__.py b/advanced_payment_cybersource/model/__init__.py new file mode 100644 index 000000000..324de8ddf --- /dev/null +++ b/advanced_payment_cybersource/model/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin () +# +# 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/model/account_payment_method.py b/advanced_payment_cybersource/model/account_payment_method.py new file mode 100644 index 000000000..257153fad --- /dev/null +++ b/advanced_payment_cybersource/model/account_payment_method.py @@ -0,0 +1,34 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin () +# +# 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): + """" Inherits account payment method to add cybersource 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/model/payment_provider.py b/advanced_payment_cybersource/model/payment_provider.py new file mode 100644 index 000000000..a522dd4de --- /dev/null +++ b/advanced_payment_cybersource/model/payment_provider.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin () +# +# 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): + """ Inherits payment.provide model for adding provider details """ + _inherit = 'payment.provider' + + code = fields.Selection(selection_add=[('cybersource', 'Cybersource')], + ondelete={'cybersource': 'set default'}, + string='Code', + help='Identifying the payment method') + cyber_merchant = fields.Char(string='Merchant ID', + help='Cybersource merchant id') + cyber_secret_key = fields.Char(string='Secret Key', + help='Cybersource secret key') + cyber_key = fields.Char(string='Secret Key', help='Cyber key') diff --git a/advanced_payment_cybersource/model/payment_transaction.py b/advanced_payment_cybersource/model/payment_transaction.py new file mode 100644 index 000000000..7cce84965 --- /dev/null +++ b/advanced_payment_cybersource/model/payment_transaction.py @@ -0,0 +1,106 @@ +# -*- coding: utf-8 -*- +############################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies() +# Author: Aysha Shalin () +# +# 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): + """ Inherits payment.transaction """ + _inherit = 'payment.transaction' + + capture_manually = fields.Boolean(related='provider_id.capture_manually', + string="Capture Manually", + help='Enable manual capturing') + + 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_code != 'cybersource': + return + notification_data = {'reference': self.reference, + 'simulated_state': 'error'} + self._handle_notification_data('cybersource', notification_data) + + @api.model + def _get_tx_from_notification_data(self, provider_code, data): + """ Find the transaction based on the notification data.""" + tx = super()._get_tx_from_notification_data(provider_code, data) + if provider_code != 'cybersource': + return tx + reference = data.get('reference') + tx = self.search( + [('reference', '=', reference), + ('provider_code', '=', 'cybersource')]) + if not tx: + raise ValidationError( + "Cyber Source " + _( + "No transaction found matching reference %s.", reference) + ) + return tx + + def _process_notification_data(self, notification_data): + """ Update the transaction state and the provider reference based on the + notification data. + This method should usually not be called directly. The correct method to + call upon receiving + notification data is :meth:`_handle_notification_data`. + For a provider to handle transaction processing, it must overwrite this + method and process + the notification data. + """ + super()._process_notification_data(notification_data) + if self.provider_code != 'cybersource': + return + self.provider_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)) diff --git a/advanced_payment_cybersource/static/description/assets/icons/capture (1).png b/advanced_payment_cybersource/static/description/assets/icons/capture (1).png new file mode 100644 index 000000000..8824deafc Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/capture (1).png differ 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..c8e85f51d 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/img.png b/advanced_payment_cybersource/static/description/assets/icons/img.png new file mode 100644 index 000000000..70197f477 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/img.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/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/photo-capture.png b/advanced_payment_cybersource/static/description/assets/icons/photo-capture.png new file mode 100644 index 000000000..06c111758 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/icons/photo-capture.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/Cybrosys R.png b/advanced_payment_cybersource/static/description/assets/misc/Cybrosys R.png new file mode 100644 index 000000000..da4058087 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/misc/Cybrosys R.png differ diff --git a/advanced_payment_cybersource/static/description/assets/misc/email.svg b/advanced_payment_cybersource/static/description/assets/misc/email.svg new file mode 100644 index 000000000..15291cdc3 --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/email.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/advanced_payment_cybersource/static/description/assets/misc/phone.svg b/advanced_payment_cybersource/static/description/assets/misc/phone.svg new file mode 100644 index 000000000..b7bd7f251 --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/phone.svg @@ -0,0 +1,3 @@ + + + diff --git a/advanced_payment_cybersource/static/description/assets/misc/star (1) 2.svg b/advanced_payment_cybersource/static/description/assets/misc/star (1) 2.svg new file mode 100644 index 000000000..5ae9f507a --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/star (1) 2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_payment_cybersource/static/description/assets/misc/support (1) 1.svg b/advanced_payment_cybersource/static/description/assets/misc/support (1) 1.svg new file mode 100644 index 000000000..7d37a8f30 --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/support (1) 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_payment_cybersource/static/description/assets/misc/support-email.svg b/advanced_payment_cybersource/static/description/assets/misc/support-email.svg new file mode 100644 index 000000000..eb70370d6 --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/support-email.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/advanced_payment_cybersource/static/description/assets/misc/tick-mark.svg b/advanced_payment_cybersource/static/description/assets/misc/tick-mark.svg new file mode 100644 index 000000000..2dbb40187 --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/tick-mark.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/advanced_payment_cybersource/static/description/assets/misc/whatsapp 1.svg b/advanced_payment_cybersource/static/description/assets/misc/whatsapp 1.svg new file mode 100644 index 000000000..0bfaf8fc6 --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/whatsapp 1.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/advanced_payment_cybersource/static/description/assets/misc/whatsapp.svg b/advanced_payment_cybersource/static/description/assets/misc/whatsapp.svg new file mode 100644 index 000000000..b618aea1d --- /dev/null +++ b/advanced_payment_cybersource/static/description/assets/misc/whatsapp.svg @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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..0a4e1042a 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.jpg b/advanced_payment_cybersource/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..a094e97b6 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/2.jpg differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/3.jpg b/advanced_payment_cybersource/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..f85e160cd Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/3.jpg differ diff --git a/advanced_payment_cybersource/static/description/assets/modules/4.jpg b/advanced_payment_cybersource/static/description/assets/modules/4.jpg new file mode 100644 index 000000000..7995b26b9 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/4.jpg 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..ba91094e4 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.jpg b/advanced_payment_cybersource/static/description/assets/modules/6.jpg new file mode 100644 index 000000000..31f2bc9f5 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/modules/6.jpg differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/1.png b/advanced_payment_cybersource/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..1dbe06bb5 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/1.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/2.png b/advanced_payment_cybersource/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..50956eb34 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/2.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/3.png b/advanced_payment_cybersource/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..6155ae4d1 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/3.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/4.png b/advanced_payment_cybersource/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..cf609ecd6 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/4.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/5.png b/advanced_payment_cybersource/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..83cee8611 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/5.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/6.png b/advanced_payment_cybersource/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..de5ae2eb5 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/6.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/7.png b/advanced_payment_cybersource/static/description/assets/screenshots/7.png new file mode 100644 index 000000000..c4550098e Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/7.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/8.png b/advanced_payment_cybersource/static/description/assets/screenshots/8.png new file mode 100644 index 000000000..2648d8752 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/8.png differ diff --git a/advanced_payment_cybersource/static/description/assets/screenshots/9.png b/advanced_payment_cybersource/static/description/assets/screenshots/9.png new file mode 100644 index 000000000..bdf029486 Binary files /dev/null and b/advanced_payment_cybersource/static/description/assets/screenshots/9.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..6bee87b36 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.jpg b/advanced_payment_cybersource/static/description/banner.jpg new file mode 100644 index 000000000..c3eb7d51e Binary files /dev/null and b/advanced_payment_cybersource/static/description/banner.jpg 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..d2a51a1ef Binary files /dev/null and b/advanced_payment_cybersource/static/description/icon.png differ diff --git a/advanced_payment_cybersource/static/description/images/arrows-transparent.png b/advanced_payment_cybersource/static/description/images/arrows-transparent.png new file mode 100644 index 000000000..f2973bb02 Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/arrows-transparent.png differ diff --git a/advanced_payment_cybersource/static/description/images/cybro_logo.png b/advanced_payment_cybersource/static/description/images/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/cybro_logo.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/ecom.png b/advanced_payment_cybersource/static/description/images/icons/ecom.png new file mode 100644 index 000000000..6e720d50e Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/ecom.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/education.png b/advanced_payment_cybersource/static/description/images/icons/education.png new file mode 100644 index 000000000..f0de98eb0 Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/education.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/hotel.png b/advanced_payment_cybersource/static/description/images/icons/hotel.png new file mode 100644 index 000000000..917c6a63e Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/hotel.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/manufacturing.png b/advanced_payment_cybersource/static/description/images/icons/manufacturing.png new file mode 100644 index 000000000..68c3722f8 Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/manufacturing.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/pos.png b/advanced_payment_cybersource/static/description/images/icons/pos.png new file mode 100644 index 000000000..600bfe4f9 Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/pos.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/restaurant.png b/advanced_payment_cybersource/static/description/images/icons/restaurant.png new file mode 100644 index 000000000..680acf29e Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/restaurant.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/service.png b/advanced_payment_cybersource/static/description/images/icons/service.png new file mode 100644 index 000000000..bfbe7a6d2 Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/service.png differ diff --git a/advanced_payment_cybersource/static/description/images/icons/trading.png b/advanced_payment_cybersource/static/description/images/icons/trading.png new file mode 100644 index 000000000..a741219b5 Binary files /dev/null and b/advanced_payment_cybersource/static/description/images/icons/trading.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..3c14a62b9 --- /dev/null +++ b/advanced_payment_cybersource/static/description/index.html @@ -0,0 +1,673 @@ + + + + + + Odoo App 3 Index + + + + + + + + +
+
+
+
+
+ +
+
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+
+
+
+

+ Odoo CyberSource Payment Gateway

+

+ Make Payments using Cybersource Payment Provider from Website Shop. +

+
+ +
+
+
+
+
+

Key Highlights +

+
+
+
+
+
+ +
+
+

Safe and Secure Online Payment.

+

Odoo CyberSource Payment Gateway enables + your customers to make a safe and secure online payment. +

+
+
+
+
+
+
+ +
+
+

Easy to Install.

+

Can be easily installed and no need of additional configurations. +

+
+
+
+
+
+
+ +
+
+

Able to Process Payments in more than 190 Countries and 40 different Currencies.

+
+
+
+
+
+
+ +
+
+

Accepts a Variety of Cards and Payment Types.

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

+ Account Set up.

+

+ Create a test account in Cybersource Sandbox. + Cybersource Account Link +

+
+
+
+
+
+
+ +
+
+

+ Key And Secret Key.

+

+ After creating the test account they will provide Key and Shared secret key. +

+
+
+
+
+
+
+ +
+
+

+ Merchant Id.

+

+ After generation of the account Merchant id will be generated. +

+
+
+
+
+
+
+ +
+
+

+ Cybersource Payment Provider.

+
+
+
+
+
+
+ +
+
+

+ Credentials.

+

+ Give the Credentials of the Payment Provider. +

+
+
+
+
+
+
+ +
+
+

+ Enable and Publish in the Website.

+
+
+
+
+
+
+ +
+
+

+ Payment from Website.

+

+ Select the Payment Provider and fill the Card details +

+
+
+
+
+
+
+ +
+
+

+ Payment Status.

+
+
+
+
+
+
+ +
+
+

+ Corresponding Sale Order from Website.

+
+
+
+
+
+
+
    +
  • + Safe and Secure Online Payments. +
  • +
  • + Cybersource is able to Process Payments in more than 190 Countries and 40 different Currencies. +
  • +
  • + Accepts a variety of cards and payment types. +
  • +
  • + Able to Connect to around 100 Acquirers/Processors Worldwide. +
  • +
+
+
+
+
+
+
Version + 17.0.1.0.0|Released on:30th July 2024 +
+

+ Initial Commit for Odoo CyberSource Payment Gateway.

+
+
+
+
+
+ +
+
+

Related Products

+
+
+ +
+
+

Our Services

+
+
+
+
+
+
+
+
+ service-icon +
+
+

Odoo Customization

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Support

+
+
+
+
+
+
+ service-icon +
+
+

Hire Odoo Developer

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Integration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Migration

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Consultancy

+
+
+
+
+
+
+ service-icon +
+
+

Odoo Implementation

+
+
+
+
+
+
+ service-icon +
+
+

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 + 99456767686
+
+
+
+
+
+
+
+
+ + + + + + 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/img/payumoney_icon.png b/advanced_payment_cybersource/static/src/img/payumoney_icon.png new file mode 100644 index 000000000..4055c6248 Binary files /dev/null and b/advanced_payment_cybersource/static/src/img/payumoney_icon.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..487e05978 --- /dev/null +++ b/advanced_payment_cybersource/static/src/js/payment_form.js @@ -0,0 +1,63 @@ +/** @odoo-module */ +import { _t } from "@web/core/l10n/translation"; +import paymentForm from '@payment/js/payment_form'; +import { Dialog } from "@web/core/dialog/dialog"; +import { jsonrpc } from "@web/core/network/rpc_service"; + +// Payment process with cybersource +paymentForm.include({ + _processRedirectFlow(providerCode, paymentOptionId, paymentMethodCode, processingValues) { + if (providerCode !== '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; + // Display error if card number is null + if(customerInputNumber == "") { + this._displayErrorDialog( + _t("Server Error"), + _t("We are not able to process your payment Card Number not entered") + ); + } + // Display error if card is expired + else if(expYear <= 2022) { + var self = this; + self._displayErrorDialog( + _t("Server Error"), + _t("We are not able to process your payment. Expiry year is not valid") + ); + } + // Display error if card expiry month is not a valid one + else if(expMonth == 0) { + var self = this; + self._displayErrorDialog( + _t("Server Error"), + _t("We are not able to process your payment. Expiry month not valid.") + ); + } + // If details are correct process the payment + else { + return jsonrpc( + '/payment/cybersource/simulate_payment', + { + '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'); + } + }, +}) 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..196d1d3e3 --- /dev/null +++ b/advanced_payment_cybersource/views/payment_provider_views.xml @@ -0,0 +1,24 @@ + + + + + payment.provider.view.form.inherit.advanced.payment.cybersource + payment.provider + + + + + + + + + + + + \ No newline at end of file diff --git a/advanced_payment_cybersource/views/payment_templates.xml b/advanced_payment_cybersource/views/payment_templates.xml new file mode 100644 index 000000000..b92a162b1 --- /dev/null +++ b/advanced_payment_cybersource/views/payment_templates.xml @@ -0,0 +1,60 @@ + + + + + \ 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..01ef2325c --- /dev/null +++ b/advanced_payment_cybersource/views/payment_transaction_views.xml @@ -0,0 +1,32 @@ + + + + + payment.transaction.view.form.inherit.advanced.payment.cybersource + payment.transaction + + +
+ +
+
+
+
\ No newline at end of file