Package: vipps
Vipps Python LibraryThe Unofficial* Vipps Python library provides convenient access to theVipps AS APIfrom applications written in the Python language.Currently Supports:Vipps eCom API v2Vipps Signup API v1DocumentationSee theVipps Developers resourcesInstallationpip install vippsRequirementsTest onPython3.7Python 3.7requests 2+UsageVipps eCommerce API version 2. Initiate payment and get redirect Url:fromvippsimportVippsEcomApipayment=VippsEcomApi(client_id="fb492b5e-7907-4d83-ba20-c7fb60ca35de",client_secret="Y8Kteew6GE2ZmeycEt6egg==",vipps_subscription_key="0f14ebcab0ec4b29ae0cb90d91b4a84a",merchant_serial_number="123456",vipps_server="https://apitest.vipps.no",callback_prefix="https://example.com/vipps/callbacks-for-payment-updates"fall_back="https://example.com/vipps/fallback-order-result-page/acme-shop-123-order123abc")# Initiate paymentinitiate=payment.init_payment(order_id="acme-shop-123-order123abc",amount=200,transaction_text="One pair of Vipps socks",)# Redirect Urlredirect_url=initiate.get("url")# Capture Paymentcapture=payment.capture_payment(order_id="acme-shop-123-order123abc",amount=200,transaction_text="One pair of Vipps socks",)# Cancel Paymentcancel=payment.cancel_payment(order_id="acme-shop-123-order123abc",transaction_text="One pair of Vipps socks",)# Refund Paymentrefund=payment.refund_payment(order_id="acme-shop-123-order123abc",amount=200,transaction_text="One pair of Vipps socks",)# Payment detailsdetails=payment.details_payment(order_id="acme-shop-123-order123abc")*UnofficialI am not affiliate or associate of the Vipps AS in any possible way. Used publicly available info to build this software.Create PyPI packageDocs:packaging.python.orgI'l do it in docker:touch Dockerfilenano Dockerfile# DockerfileFROMpython:latestRUNaptupdateENVPYTHONDONTWRITEBYTECODE1ENVPYTHONUNBUFFERED1RUNpipinstall--upgradepipdocker build -t ipy .docker run -it -v ${PWD}:/home --name py ipy bashSetup:mkdir /home/vipps-pythoncd /home/vipps-pythonmkdir vippsmkdir teststouch vipps/__init__.pytouch LICENSEtouch README.mdtouch pyproject.tomltouch setup.cfgtouch setup.pynano pyproject.toml# pyproject.toml[build-system]requires=["setuptools>=42","wheel"]build-backend="setuptools.build_meta"nano setup.cfg# setup.cfg[metadata]name=vippsversion=0.3author=AlmazKunpeissovauthor_email=hi@akun.devdescription=PythonbindingsfortheVippsAPIlong_description=file:README.mdlong_description_content_type=text/markdownurl=https://github.com/almazkun/vipps-pythonkeywords=vippsapipaymentslicense=MITLicenselicense_files=LICENSEproject_urls=Documentation=https://github.com/almazkun/vipps-pythonSource=https://github.com/almazkun/vipps-pythonTracker=https://github.com/almazkun/vipps-python/issuesclassifiers=DevelopmentStatus::2-Pre-AlphaIntendedAudience::DevelopersOperatingSystem::OSIndependentProgrammingLanguage::Python::3::OnlyProgrammingLanguage::Python::3.7ProgrammingLanguage::Python::Implementation::PyPyTopic::SoftwareDevelopment::Libraries::PythonModules[options]packages=find:python_requires=>=3.7include_package_data=truezip_safe=falseinstall_requires=requests>=2[options.packages.find]exclude=teststests.*nano setup.pyfromsetuptoolsimportsetupsetup()Creating distribution archivespython3 -m pip install --upgrade buildpython3 -m buildUpload to Test.PyPI:python3 -m pip install --user --upgrade twinepython3 -m twine upload --repository testpypi dist/*username:token, password: yourtest PyPI tokencurl https://test.pypi.org/project/vipps/0.1/Installing package:python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps vippspython3import vippsUpload to the PyPI:python3 -m twine upload dist/*username:token, password: yourPyPI token