{"id":44315532,"url":"https://github.com/fccn/ecommerce-plugin-paygate","last_synced_at":"2026-02-11T05:08:07.025Z","repository":{"id":187345579,"uuid":"673262271","full_name":"fccn/ecommerce-plugin-paygate","owner":"fccn","description":"PayGate payment processor for Open edX Ecommerce used by NAU Ecommerce","archived":false,"fork":false,"pushed_at":"2025-12-04T11:24:38.000Z","size":133,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-12-07T19:29:00.528Z","etag":null,"topics":["django","ecommerce","openedx","paygate"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fccn.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-01T08:33:47.000Z","updated_at":"2025-12-04T11:24:43.000Z","dependencies_parsed_at":"2024-02-26T17:47:17.292Z","dependency_job_id":"11493203-3df6-4e7a-8f90-bd05c4d168de","html_url":"https://github.com/fccn/ecommerce-plugin-paygate","commit_stats":null,"previous_names":["fccn/ecommerce-plugin-paygate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fccn/ecommerce-plugin-paygate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fecommerce-plugin-paygate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fecommerce-plugin-paygate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fecommerce-plugin-paygate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fecommerce-plugin-paygate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fccn","download_url":"https://codeload.github.com/fccn/ecommerce-plugin-paygate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fccn%2Fecommerce-plugin-paygate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29327111,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T03:52:29.695Z","status":"ssl_error","status_checked_at":"2026-02-11T03:52:23.094Z","response_time":97,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["django","ecommerce","openedx","paygate"],"created_at":"2026-02-11T05:08:06.890Z","updated_at":"2026-02-11T05:08:07.017Z","avatar_url":"https://github.com/fccn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"==================================================================================\nPayGate payment processor for Open edX\n==================================================================================\n\n\nThis is a placeholder payment processor for the `Ecommerce \u003chttps://edx-ecommerce.readthedocs.io/en/latest/\u003e`__ \napplication from `Open edX \u003chttps://open.edx.org/\u003e`__.\n\nThis plugin was bootstraped by `eduNEXT \u003chttps://www.edunext.co/\u003e`__ and \nimplemented by the `NAU FCCN team \u003chttps://www.fccn.pt\u003e`__ to work specifically with \nthe `Tutor \u003chttps://docs.tutor.overhang.io/\u003e`__ Open edX distribution. \nThe following installation instructions should work wit the \n`tutor-ecommerce plugin \u003chttps://github.com/overhangio/tutor-ecommerce\u003e`__, \nbut there is no reason to believe that it shouldn't also work with the Open edX native installation.\n\nThis guide is based in the `openedx-saferpay \u003chttps://github.com/epfl-cede/openedx-saferpay/tree/master\u003e`__ README.\n\nOther projects that this project receive inspiration:\n- https://github.com/epfl-cede/openedx-saferpay\n- https://github.com/nelc/ecommerce-hyperpay\n- https://github.com/eduNEXT/ecommerce-extensions/tree/ee25624582c8e42b7eb998fda54358a7025c2dce/ecommerce_extensions/payment/processors\n- https://github.com/open-craft/ecommerce-paytabs\n\nTutor\n===============\n\nInstall the following version of tutor-ecommerce as it contains special code to avoid the usage of discovery service for development purposes:\n\n    pip install git+https://github.com/eduNEXT/tutor-ecommerce@nau/v14.0.1#egg=tutor-ecommerce==v14.0.1\n\nMake sure that the ecommerce plugin is enabled::\n\n    tutor plugins enable ecommerce\n\nMake sure that the discovery and mfe plugins are disabled::\n\n    tutor plugins disable mfe\n    tutor plugins disable discovery\n\nAdd the PayGate payment processor to the Docker image::\n\n    tutor config save \\\n        --set 'ECOMMERCE_EXTRA_PIP_REQUIREMENTS=[\"https://github.com/fccn/ecommerce-plugin-paygate\"]'\n    tutor images build ecommerce\n\nThen configure your Ecommerce instance to use the PayGate payment processor::\n\n    tutor config save --set 'ECOMMERCE_ENABLED_PAYMENT_PROCESSORS=[\"paygate\"]'\n    tutor config save --set 'ECOMMERCE_EXTRA_PAYMENT_PROCESSOR_CLASSES=[\"paygate.processor.PayGate\"]'\n    tutor config save --set 'ECOMMERCE_EXTRA_PAYMENT_PROCESSOR_URLS={\"paygate\": \"paygate.urls\"}'\n\nSave your PayGate credentials to paygate.yml::\n\n    $ cat paygate.yml\n    paygate:\n        access_token: PwdX_XXXX_YYYY\n        merchant_code: NAU\n        api_checkout_url: https://lab.optimistic.blue/paygateWS/api/CheckOut\n        api_checkout_req_timeout_sec: 10 # optional\n        api_back_search_transactions: https://lab.optimistic.blue/paygateWS/api/BackOfficeSearchTransactions\n        api_back_search_transactions_timeout_seconds: 10 # optional\n        api_basic_auth_user: username\n        api_basic_auth_pass: password\n        cancel_checkout_path: /checkout/cancel-checkout/ # optional\n        error_path: /checkout/error/ # optional\n        title: PayGate # optional\n        payment_types: [\"VISA\", \"MASTERCARD\", \"AMEX\", \"PAYPAL\", \"MBWAY\", \"REFMB\", \"DUC\"]\n    $ tutor config save --set \"ECOMMERCE_PAYMENT_PROCESSORS=$(cat paygate.yml)\"\n\n    The `cancel_checkout_path` and `error_path` are optional.\n\nRun initialization scripts::\n\n    tutor local quickstart\n\nEnable the PayGate payment backend::\n\n    tutor local run ecommerce ./manage.py waffle_switch --create payment_processor_active_paygate on\n\nAll payments will then proceed through the PayGate payment processor.\n\n\nDevstack\n===============\n\nNext, it is described the instructions to run the development environmen using the Open edX `Devstack \u003chttps://github.com/openedx/devstack\u003e`__.\n\nIf you are using some internal FCCN IaaS VM, please use FCCN forked `Devstack \u003chttps://github.com/fccn/devstack\u003e`__ for that Open edX release.\n\n\nTroubleshooting\n-----------------\n\nIf the service `frontend-app-payment` didn't start and has this on the docker logs::\n\n    sh: 1: fedx-scripts: not found\n\nThe reason was because the `npm install` were raising some error::\n\n    Invalid tag name \"\u003e=^16.0.0\" of package \"react@\u003e=^16.0.0\": Tags may not have any characters that encodeURIComponent encodes.\n\nTo fix run this inside the container::\n\n    npm install --legacy-peer-deps\n\nConfiguration\n===============\n\nTo develop using the devstack edit the `ecommerce/settings/private.py` file add change to::\n\n    PAYMENT_PROCESSOR_CONFIG = {\n        \"edx\": {\n            \"paygate\": {\n                \"access_token\": 'PwdX_XXXX_YYYY',\n                \"merchant_code\": \"NAU\",\n                \"api_checkout_url\": 'https://lab.optimistic.blue/paygateWS/api/CheckOut',\n                \"api_basic_auth_user\": \"NAU\",\n                \"api_basic_auth_pass\": \"APassword\",\n                \"payment_types\": [\"VISA\", \"MASTERCARD\", \"AMEX\", \"PAYPAL\", \"MBWAY\", \"REFMB\", \"DUC\"]\n            }\n        }\n    }\n    PAYMENT_PROCESSORS = (\"paygate.processors.PayGate\",)\n    EXTRA_PAYMENT_PROCESSOR_URLS = {\"paygate\": \"paygate.urls\"}\n    OSCAR_DEFAULT_CURRENCY = 'EUR'\n    \n    LANGUAGE_CODE = \"pt\"\n    from django.utils.translation import ugettext_lazy as _\n    LANGUAGES = (\n        ('pt-pt', _('Português')),\n        ('en', _('English')),\n    )\n    LOGO_URL = \"https://lms.nau.edu.pt/static/nau-basic/images/nau_azul.svg\"\n\n    # Use custom tax strategy\n    NAU_EXTENSION_OSCAR_STRATEGY_CLASS = \"ecommerce_plugin_paygate.strategy.DefaultStrategy\"\n\n    # Configure tax as 23% used in Portugal\n    NAU_EXTENSION_TAX_RATE = \"0.298701299\" # = 0.23/0.77\n\n\nClone the repository https://github.com/fccn/ecommerce-plugin-paygate to the `src` folder of the devstack (the parent `src` folder of the devstack folder)\n\nInstall this plugin inside the ecommerce container::\n\n    make dev.shell.ecommerce\n    pip install -e /edx/src/ecommerce-plugin-paygate\n\nRestart ecommerce application::\n\n    make dev.restart-container.ecommerce\n\nOn the Open edX Ecommerce user interface it is need to activate the PayGate payment processor.\nTo activate the `paygate` add switch with the name `payment_processor_active_paygate` on\nhttp://localhost:18130/admin/waffle/switch/.\n\nOn ecommerce Django admin site configuration,\nhttp://localhost:18130/admin/core/siteconfiguration/1/change/\n- disable Microfrontend for Basket Page\n- replace payment processors from `cybersource,paypal` to `paygate`\n\nTo run the tests and linting inside the Ecommerce container using Devstack run::\n    make -C /edx/src/ecommerce-plugin-paygate/ test lint\n\nCallbacks\n===============\n\nThere are different callbacks that the PayGate uses.\nThe success, cancel and failure callbacks are used to redirect the user after he has payed with success,\nhas cancel the payment inside the PayGate user interface or some error has been raised.\n\nAdditionally, there is also a server-to-server callback, the PayGate calls the Ecommerce informing\nthat some payment reference has been payed.\n\nExample of the server callback, change the `payment_ref` with your basked identification::\n\n    curl -d '{\"statusCode\":\"C\", \"success\":\"true\", \"MerchantCode\":\"NAUFCCN\", \"returnCode\":\"ABCDEFGHI\", \"shortMsg\":\"Opera%C3%A7%C3%A3o%20bem%20sucedida\", \"name\": \"edx\", \"is_paid\": \"true\", \"paymentValue\": \"1.00\", \"payment_ref\": \"EDX-100019\"}' -H \"Content-Type: application/json\" -X POST http://localhost:18130/payment/paygate/callback/server/\n\nVSCode\n======\n\nTo make the isort work properly inside the Visual Studio Code, you should add this to your Workspace settings JSON::\n\n    \"isort.args\":[\"--settings-file\", \"\u003cpath to ecommerce project on host\u003e/.isort.cfg\"],\n\nLicense\n=======\n\nThis work is licensed under the terms of the `GNU Affero General Public License (AGPL) \u003chttps://github.com/fccn/ecommerce-plugin-paygate/blob/master/LICENSE.txt\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffccn%2Fecommerce-plugin-paygate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffccn%2Fecommerce-plugin-paygate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffccn%2Fecommerce-plugin-paygate/lists"}