mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 16:45:49 +01:00
Merge pull request #225188 from DerDennisOP/django-payments
This commit is contained in:
commit
6fe3576821
5 changed files with 129 additions and 3 deletions
|
@ -3679,6 +3679,12 @@
|
|||
githubId = 706758;
|
||||
name = "Christian Gerbrandt";
|
||||
};
|
||||
derdennisop = {
|
||||
email = "dennish@wuitz.de";
|
||||
github = "derdennisop";
|
||||
githubId = 52411861;
|
||||
name = "Dennis";
|
||||
};
|
||||
derekcollison = {
|
||||
email = "derek@nats.io";
|
||||
github = "derekcollison";
|
||||
|
|
73
pkgs/development/python-modules/django-payments/default.nix
Normal file
73
pkgs/development/python-modules/django-payments/default.nix
Normal file
|
@ -0,0 +1,73 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, braintree
|
||||
, cryptography
|
||||
, django
|
||||
, django-phonenumber-field
|
||||
, fetchFromGitHub
|
||||
, mercadopago
|
||||
, pythonOlder
|
||||
, requests
|
||||
, setuptools-scm
|
||||
, sphinx-rtd-theme
|
||||
, stripe
|
||||
, xmltodict
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "django-payments";
|
||||
version = "2.0.0";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jazzband";
|
||||
repo = "django-payments";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-6WPV08CV+rko/tRnsT5GyTGYaJbiIKTvpisfRwizBIo=";
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace setup.py \
|
||||
--replace "django-phonenumber-field[phonenumberslite]" "django-phonenumber-field"
|
||||
'';
|
||||
|
||||
env.SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
||||
|
||||
nativeBuildInputs = [
|
||||
setuptools-scm
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
django
|
||||
django-phonenumber-field
|
||||
requests
|
||||
] ++ django-phonenumber-field.optional-dependencies.phonenumbers;
|
||||
|
||||
# require internet connection
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [
|
||||
"payments"
|
||||
];
|
||||
|
||||
passthru.optional-dependencies = {
|
||||
all = [ braintree /* suds-community */ mercadopago cryptography xmltodict stripe ];
|
||||
braintree = [ braintree ];
|
||||
cybersource = [ /* suds-community */ ];
|
||||
docs = [ sphinx-rtd-theme ];
|
||||
mercadopago = [ mercadopago ];
|
||||
sagepay = [ cryptography ];
|
||||
sofort = [ xmltodict ];
|
||||
stripe = [ stripe ];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Universal payment handling for Django.";
|
||||
homepage = "https://github.com/jazzband/django-payments/";
|
||||
changelog = "https://github.com/jazzband/django-payments/releases/tag/v${version}";
|
||||
license = licenses.bsd3;
|
||||
maintainers = with maintainers; [ derdennisop ];
|
||||
};
|
||||
}
|
|
@ -32,11 +32,10 @@ buildPythonPackage rec {
|
|||
|
||||
propagatedBuildInputs = [
|
||||
django
|
||||
phonenumbers
|
||||
babel
|
||||
];
|
||||
] ++ passthru.optional-dependencies.phonenumbers;
|
||||
|
||||
nativeCheckInputs = [
|
||||
babel
|
||||
djangorestframework
|
||||
];
|
||||
|
||||
|
@ -48,6 +47,10 @@ buildPythonPackage rec {
|
|||
${python.interpreter} -m django test --settings tests.settings
|
||||
'';
|
||||
|
||||
passthru.optional-dependencies = {
|
||||
phonenumbers = [ phonenumbers ];
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "A django model and form field for normalised phone numbers using python-phonenumbers";
|
||||
homepage = "https://github.com/stefanfoulis/django-phonenumber-field/";
|
||||
|
|
40
pkgs/development/python-modules/mercadopago/default.nix
Normal file
40
pkgs/development/python-modules/mercadopago/default.nix
Normal file
|
@ -0,0 +1,40 @@
|
|||
{ lib
|
||||
, buildPythonPackage
|
||||
, fetchFromGitHub
|
||||
, pythonOlder
|
||||
, requests
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
pname = "mercadopago";
|
||||
version = "2.2.0";
|
||||
format = "setuptools";
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mercadopago";
|
||||
repo = "sdk-python";
|
||||
rev = "refs/tags/${version}";
|
||||
hash = "sha256-HtPyIwip/cjvnBDZ0qGpLKJOkwETGSqXvTkH2pcd6cc=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
requests
|
||||
];
|
||||
|
||||
# require internet
|
||||
doCheck = false;
|
||||
|
||||
pythonImportsCheck = [
|
||||
"mercadopago"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "This library provides developers with a simple set of bindings to help you integrate Mercado Pago API to a website and start receiving payments.";
|
||||
homepage = "https://www.mercadopago.com";
|
||||
changelog = "https://github.com/mercadopago/sdk-python/releases/tag/${version}";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ derdennisop ];
|
||||
};
|
||||
}
|
|
@ -2687,6 +2687,8 @@ self: super: with self; {
|
|||
|
||||
django-pattern-library = callPackage ../development/python-modules/django-pattern-library { };
|
||||
|
||||
django-payments = callPackage ../development/python-modules/django-payments { };
|
||||
|
||||
django-pglocks = callPackage ../development/python-modules/django-pglocks { };
|
||||
|
||||
django-phonenumber-field = callPackage ../development/python-modules/django-phonenumber-field { };
|
||||
|
@ -5969,6 +5971,8 @@ self: super: with self; {
|
|||
|
||||
meraki = callPackage ../development/python-modules/meraki { };
|
||||
|
||||
mercadopago = callPackage ../development/python-modules/mercadopago { };
|
||||
|
||||
mercantile = callPackage ../development/python-modules/mercantile { };
|
||||
|
||||
mercurial = toPythonModule (pkgs.mercurial.override {
|
||||
|
|
Loading…
Reference in a new issue