Commit 5dc0e526 by Damien Moulard

Paiement par CB: achat de monnaie & cotisations

parent 6c790f14
......@@ -33,3 +33,11 @@ CORS_ALLOW_ORIGIN=^https?://localhost(:[0-9]+)?$
#JWT_PUBLIC_KEY=%kernel.project_dir%/config/jwt/public.pem
#JWT_PASSPHRASE=2162f52d0600275e618fccd274c080f2
###< lexik/jwt-authentication-bundle ###
## PAYUM GATEWAYS CONFIGURATION ##
###> payum-payzen ###
PAZEN_SITE_ID=ChangeMeWithYourPayzenCredentials
PAYZEN_CERTIFICATE=ChangeMeWithYourPayzenCredentials
PAYZEN_CTX_MODE=PRODUCTION
PAYZEN_DEBUG=false
###< payum-payzen ###
......@@ -35,3 +35,7 @@ yarn-error.log
/mlc.test-access.log
/mlc.test-error.log
###< symfony/webpack-encore-bundle ###
###> payum ###
/transactions/
###< payum ###
......@@ -14,29 +14,35 @@
"php": "^7.4",
"ext-ctype": "*",
"ext-iconv": "*",
"ext-intl" : "*",
"ext-intl": "*",
"api-platform/api-pack": "^1.2",
"beberlei/doctrineextensions": "^1.2",
"doctrine/annotations": "^1.8",
"doctrine/migrations": "^3.0",
"doctrine/doctrine-fixtures-bundle": "^3.0",
"doctrine/doctrine-migrations-bundle": "^3.0",
"doctrine/migrations": "^3.0",
"ekyna/payum-payzen": "@dev",
"friendsofsymfony/user-bundle": "^2.1",
"geocoder-php/cache-provider": "^4.1",
"geocoder-php/google-maps-provider": "^4.3",
"geocoder-php/nominatim-provider": "^5.0",
"hautelook/alice-bundle": "^2.3",
"knplabs/knp-paginator-bundle": "^2.8",
"lexik/translation-bundle": "~4.0",
"liip/imagine-bundle": "^2.1",
"nelmio/api-doc-bundle": "^3.3",
"payum/offline": "^1.6",
"payum/payum-bundle": "^2.4",
"php-http/guzzle6-adapter": "^2.0",
"php-http/message": "^1.7",
"pixassociates/sortable-behavior-bundle": "^1.5",
"prodigious/sonata-menu-bundle": "^3.0",
"sensio/framework-extra-bundle": "^5.1",
"sensiolabs/security-checker": "^5.0",
"sonata-project/admin-bundle": "^3.65",
"sonata-project/block-bundle": "^3.18",
"sonata-project/core-bundle": "^3.18",
"sonata-project/classification-bundle": "^3.11",
"sonata-project/core-bundle": "^3.18",
"sonata-project/doctrine-orm-admin-bundle": "^3.6",
"sonata-project/easy-extends-bundle": "^2.5",
"sonata-project/formatter-bundle": "^4.1",
......@@ -49,6 +55,7 @@
"symfony/asset": "4.4.*",
"symfony/cache": "4.4.*",
"symfony/console": "4.4.*",
"symfony/dotenv": "4.4.*",
"symfony/expression-language": "4.4.*",
"symfony/flex": "^1.1",
"symfony/form": "4.4.*",
......@@ -67,11 +74,7 @@
"symfony/webpack-encore-bundle": "^1.7",
"symfony/yaml": "4.4.*",
"vich/uploader-bundle": "^1.8",
"willdurand/geocoder-bundle": "^5.0",
"doctrine/doctrine-fixtures-bundle": "^3.0",
"symfony/dotenv": "4.4.*",
"sensiolabs/security-checker": "^5.0",
"hautelook/alice-bundle": "^2.3"
"willdurand/geocoder-bundle": "^5.0"
},
"require-dev": {
"symfony/browser-kit": "4.4.*",
......@@ -126,8 +129,14 @@
},
"extra": {
"symfony": {
"allow-contrib": false,
"allow-contrib": true,
"require": "4.4.*"
}
},
"repositories": [
{
"type": "vcs",
"url": "https://damienmoulard:7748456c803670933eaa313cff6837eeb84273a2@github.com/damienmoulard/PayumPayzen"
}
]
}
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "9ad1e1c8dfb7b89b9c6cc6be310ee478",
"content-hash": "32f8ec4a89548646a1756d5ac4bc2ba1",
"packages": [
{
"name": "api-platform/api-pack",
......@@ -2081,6 +2081,44 @@
"time": "2020-06-16T20:11:17+00:00"
},
{
"name": "ekyna/payum-payzen",
"version": "1.5.x-dev",
"source": {
"type": "git",
"url": "https://damienmoulard:7748456c803670933eaa313cff6837eeb84273a2@github.com/damienmoulard/PayumPayzen",
"reference": "17c280ea86308a430cc355578264a1c1f0800edd"
},
"require": {
"payum/core": "^1.5",
"php": "^7.0",
"php-http/guzzle6-adapter": "^2.0",
"psr/log": "~1.0",
"symfony/process": "4.4.*"
},
"type": "component",
"autoload": {
"psr-4": {
"Ekyna\\Component\\Payum\\Payzen\\": ""
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Etienne Dauvergne",
"homepage": "http://ekyna.com"
}
],
"description": "PayZen Payum gateway",
"homepage": "https://github.com/ekyna/PayumPayzen",
"keywords": [
"payum",
"payzen"
],
"time": "2020-07-06T11:57:24+00:00"
},
{
"name": "exsyst/swagger",
"version": "v0.4.1",
"source": {
......@@ -3928,6 +3966,481 @@
"time": "2020-05-20T16:45:56+00:00"
},
{
"name": "league/uri",
"version": "5.3.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri.git",
"reference": "f2bceb755f1108758cf4cf925e4cd7699ce686aa"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri/zipball/f2bceb755f1108758cf4cf925e4cd7699ce686aa",
"reference": "f2bceb755f1108758cf4cf925e4cd7699ce686aa",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"ext-intl": "*",
"ext-mbstring": "*",
"league/uri-components": "^1.8",
"league/uri-hostname-parser": "^1.1",
"league/uri-interfaces": "^1.0",
"league/uri-manipulations": "^1.5",
"league/uri-parser": "^1.4",
"league/uri-schemes": "^1.2",
"php": ">=7.0.13",
"psr/http-message": "^1.0"
},
"type": "metapackage",
"extra": {
"branch-alias": {
"dev-master": "5.x-dev"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "URI manipulation library",
"homepage": "http://uri.thephpleague.com",
"keywords": [
"data-uri",
"file-uri",
"ftp",
"hostname",
"http",
"https",
"middleware",
"parse_str",
"parse_url",
"psr-7",
"query-string",
"querystring",
"rfc3986",
"rfc3987",
"uri",
"url",
"ws"
],
"time": "2018-03-14T17:19:39+00:00"
},
{
"name": "league/uri-components",
"version": "1.8.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-components.git",
"reference": "d0412fd730a54a8284009664188cf239070eae64"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-components/zipball/d0412fd730a54a8284009664188cf239070eae64",
"reference": "d0412fd730a54a8284009664188cf239070eae64",
"shasum": ""
},
"require": {
"ext-curl": "*",
"ext-fileinfo": "*",
"ext-intl": "*",
"league/uri-hostname-parser": "^1.1.0",
"php": ">=7.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.3",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.9.4",
"phpstan/phpstan-strict-rules": "^0.9.0",
"phpunit/phpunit": "^6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "URI components manipulation library",
"homepage": "http://uri.thephpleague.com",
"keywords": [
"authority",
"components",
"fragment",
"host",
"path",
"port",
"query",
"rfc3986",
"scheme",
"uri",
"url",
"userinfo"
],
"time": "2018-10-24T11:31:02+00:00"
},
{
"name": "league/uri-hostname-parser",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-hostname-parser.git",
"reference": "7a6be3d06d0ed08dcb51f666aa60f3b66cd51325"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-hostname-parser/zipball/7a6be3d06d0ed08dcb51f666aa60f3b66cd51325",
"reference": "7a6be3d06d0ed08dcb51f666aa60f3b66cd51325",
"shasum": ""
},
"require": {
"ext-intl": "*",
"php": ">=7.0",
"psr/simple-cache": "^1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.7",
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^6.3"
},
"suggest": {
"ext-curl": "To use the bundle cURL HTTP client",
"psr/simple-cache-implementation": "To enable using other cache providers"
},
"bin": [
"bin/update-psl-icann-section"
],
"type": "library",
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jeremy Kendall",
"homepage": "http://about.me/jeremykendall",
"role": "Developer"
},
{
"name": "Ignace Nyamagana Butera",
"homepage": "http://nyamsprod.com",
"role": "Developer"
},
{
"name": "Contributors",
"homepage": "https://github.com/phpleague/uri-hostname-parser/graphs/contributors"
}
],
"description": "ICANN base hostname parsing implemented in PHP.",
"homepage": "https://github.com/thephphleague/uri-hostname-parser",
"keywords": [
"Public Suffix List",
"domain parsing",
"icann"
],
"time": "2018-02-16T07:29:26+00:00"
},
{
"name": "league/uri-interfaces",
"version": "1.1.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-interfaces.git",
"reference": "081760c53a4ce76c9935a755a21353610f5495f6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/081760c53a4ce76c9935a755a21353610f5495f6",
"reference": "081760c53a4ce76c9935a755a21353610f5495f6",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "Common interface for URI representation",
"homepage": "http://github.com/thephpleague/uri-interfaces",
"keywords": [
"rfc3986",
"rfc3987",
"uri",
"url"
],
"time": "2018-11-05T14:00:06+00:00"
},
{
"name": "league/uri-manipulations",
"version": "1.5.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-manipulations.git",
"reference": "ae8d49a3203ccf7a1e39aaf7fae9f08bfbc454a2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-manipulations/zipball/ae8d49a3203ccf7a1e39aaf7fae9f08bfbc454a2",
"reference": "ae8d49a3203ccf7a1e39aaf7fae9f08bfbc454a2",
"shasum": ""
},
"require": {
"ext-intl": "*",
"league/uri-components": "^1.8.0",
"league/uri-interfaces": "^1.0",
"php": ">=7.0",
"psr/http-message": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"guzzlehttp/psr7": "^1.2",
"league/uri-schemes": "^1.2",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.9.4",
"phpstan/phpstan-strict-rules": "^0.9.0",
"phpunit/phpunit": "^6.0",
"zendframework/zend-diactoros": "1.4.0"
},
"suggest": {
"league/uri-schemes": "Allow manipulating URI objects"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "URI manipulation library",
"homepage": "http://url.thephpleague.com",
"keywords": [
"formatter",
"manipulation",
"manipulations",
"middlewares",
"modifiers",
"psr-7",
"references",
"rfc3986",
"rfc3987",
"uri",
"url"
],
"time": "2018-03-14T16:44:57+00:00"
},
{
"name": "league/uri-parser",
"version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-parser.git",
"reference": "671548427e4c932352d9b9279fdfa345bf63fa00"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-parser/zipball/671548427e4c932352d9b9279fdfa345bf63fa00",
"reference": "671548427e4c932352d9b9279fdfa345bf63fa00",
"shasum": ""
},
"require": {
"php": ">=7.0.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.9.4",
"phpstan/phpstan-strict-rules": "^0.9.0",
"phpunit/phpunit": "^6.0"
},
"suggest": {
"ext-intl": "Allow parsing RFC3987 compliant hosts",
"league/uri-schemes": "Allow validating and normalizing URI parsing results"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "userland URI parser RFC 3986 compliant",
"homepage": "https://github.com/thephpleague/uri-parser",
"keywords": [
"parse_url",
"parser",
"rfc3986",
"rfc3987",
"uri",
"url"
],
"time": "2018-11-22T07:55:51+00:00"
},
{
"name": "league/uri-schemes",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/uri-schemes.git",
"reference": "f821a444785724bcc9bc244b1173b9d6ca4d71e6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/uri-schemes/zipball/f821a444785724bcc9bc244b1173b9d6ca4d71e6",
"reference": "f821a444785724bcc9bc244b1173b9d6ca4d71e6",
"shasum": ""
},
"require": {
"ext-fileinfo": "*",
"league/uri-interfaces": "^1.1",
"league/uri-parser": "^1.4.0",
"php": ">=7.0.13",
"psr/http-message": "^1.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.0",
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.9.4",
"phpstan/phpstan-strict-rules": "^0.9.0",
"phpunit/phpunit": "^6.0"
},
"suggest": {
"ext-intl": "Allow parsing RFC3987 compliant hosts",
"league/uri-manipulations": "Needed to easily manipulate URI objects"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
}
},
"autoload": {
"psr-4": {
"League\\Uri\\": "src"
},
"files": [
"src/functions_include.php"
]
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Ignace Nyamagana Butera",
"email": "nyamsprod@gmail.com",
"homepage": "https://nyamsprod.com"
}
],
"description": "URI manipulation library",
"homepage": "http://uri.thephpleague.com",
"keywords": [
"data-uri",
"file",
"ftp",
"http",
"https",
"parse_url",
"psr-7",
"rfc3986",
"uri",
"url",
"ws",
"wss"
],
"time": "2018-11-26T08:09:30+00:00"
},
{
"name": "lexik/translation-bundle",
"version": "v4.0.14",
"source": {
......@@ -4661,6 +5174,342 @@
"time": "2020-04-13T14:42:16+00:00"
},
{
"name": "payum/core",
"version": "1.6.0",
"target-dir": "Payum/Core",
"source": {
"type": "git",
"url": "https://github.com/Payum/Core.git",
"reference": "43954de6415e1a29fa09d7ca7949b071741afbc6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Payum/Core/zipball/43954de6415e1a29fa09d7ca7949b071741afbc6",
"reference": "43954de6415e1a29fa09d7ca7949b071741afbc6",
"shasum": ""
},
"require": {
"league/uri": "^5.0",
"payum/iso4217": "^1.0",
"php": "^7.0",
"php-http/client-implementation": "^1.0",
"php-http/message": "^1.0",
"twig/twig": "^1.0|^2.0"
},
"require-dev": {
"defuse/php-encryption": "^2",
"doctrine/orm": "2.*",
"ext-curl": "*",
"ext-pdo_sqlite": "*",
"omnipay/common": "^3@dev",
"omnipay/dummy": "^3@alpha",
"payum/omnipay-v3-bridge": "^1@alpha",
"php-http/guzzle6-adapter": "^1.0",
"phpunit/phpunit": "^5.7",
"propel/propel1": "~1.7",
"psr/log": "~1.0",
"symfony/dependency-injection": "^4.4|^5.0",
"symfony/form": "^4.4|^5.0",
"symfony/http-foundation": "^4.4|^5.0",
"symfony/http-kernel": "^4.4|^5.0",
"symfony/phpunit-bridge": "^4.4|^5.0",
"symfony/routing": "^4.4|^5.0",
"symfony/validator": "^4.4|^5.0",
"zendframework/zend-db": "~2"
},
"suggest": {
"defuse/php-encryption": "^2 If you want to encrypt gateways credentials in database",
"doctrine/mongodb-odm": "~1.1 If you want to store models to mongo doctrin2 ODM",
"doctrine/orm": "~2.3 If you want to store models to database using doctrin2 ORM",
"monolog/monolog": "~1.0 If you want to use PSR-3 logger",
"payum/authorize-net-aim": "self.version If you want to use Authorize.Net AIM payment gateway",
"payum/be2bill": "self.version If you want to use be2bill payment gateway",
"payum/omnipay-v3-bridge": "^1 If you want to use omnipay's gateways",
"payum/payex": "self.version If you want to use payex payment gateway",
"payum/paypal-express-checkout-nvp": "self.version If you want to use paypal express checkout, digital goods or recurring payments",
"payum/paypal-ipn": "self.version If you want to use paypal instant payment notifications(Paypal IPN)",
"payum/paypal-pro-checkout-nvp": "self.version If you want to use paypal pro checkout",
"payum/paypal-rest": "self.version If you want to use paypal rest gateway",
"propel/propel": "If you want to store models to Propel2 ORM",
"propel/propel1": "~1.7 If you want to store models to Propel1 ORM",
"symfony/dependency-injection": "~2.8|~3.0 If you want to use container aware stuff",
"symfony/form": "~2.8|~3.0 If you want to use forms",
"symfony/http-foundation": "~2.8|~3.0 If you want to use HttpRequestVerifier or HttpResponse reply from symfony's bridge",
"symfony/http-kernel": "~2.8|~3.0 If you want to use HttpRequestVerifier from symfony's bridge",
"symfony/routing": "~2.8|~3.0 If you want to use TokenFactory from symfony's bridge",
"zendframework/zend-db": "~2.0 If you want to store models to Zend Db ORM"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"autoload": {
"psr-0": {
"Payum\\Core\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kotlyar Maksim",
"email": "kotlyar.maksim@gmail.com"
},
{
"name": "Payum project",
"homepage": "https://payum.forma-pro.com/"
},
{
"name": "Community contributions",
"homepage": "https://github.com/Payum/Payum/contributors"
}
],
"description": "One million downloads of Payum already! Payum offers everything you need to work with payments. Friendly for all PHP frameworks (Symfony, Laravel, Zend, Yii, Silex). Check more visiting site.",
"homepage": "https://payum.forma-pro.com/",
"keywords": [
"authorize",
"capture",
"notify",
"payment",
"payout",
"recurring payment",
"refund",
"subscription",
"withdrawal"
],
"time": "2020-02-11T22:12:10+00:00"
},
{
"name": "payum/iso4217",
"version": "1.0.1",
"source": {
"type": "git",
"url": "https://github.com/Payum/iso4217.git",
"reference": "6a45480e2818350dea58b7a076d0115aa7ff5789"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Payum/iso4217/zipball/6a45480e2818350dea58b7a076d0115aa7ff5789",
"reference": "6a45480e2818350dea58b7a076d0115aa7ff5789",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"phpunit/phpunit": "~4.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Payum\\ISO4217\\": "."
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Rob Bast",
"email": "rob.bast@gmail.com"
},
{
"name": "Community contributions",
"homepage": "https://github.com/Payum/Payum/contributors"
},
{
"name": "Kotlyar Maksim",
"email": "kotlyar.maksim@gmail.com"
},
{
"name": "Payum project",
"homepage": "http://payum.org/"
}
],
"description": "ISO 4217 PHP Library",
"homepage": "http://payum.org",
"keywords": [
"4217",
"ISO 4217",
"currencies",
"iso",
"library"
],
"time": "2016-08-04T08:15:12+00:00"
},
{
"name": "payum/offline",
"version": "1.6.0",
"target-dir": "Payum/Offline",
"source": {
"type": "git",
"url": "https://github.com/Payum/Offline.git",
"reference": "b92fabfe2b1842f752250dacdb2e17217f2941c7"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Payum/Offline/zipball/b92fabfe2b1842f752250dacdb2e17217f2941c7",
"reference": "b92fabfe2b1842f752250dacdb2e17217f2941c7",
"shasum": ""
},
"require": {
"payum/core": "^1.5"
},
"require-dev": {
"payum/core": "^1.5",
"phpunit/phpunit": "^5.7",
"symfony/phpunit-bridge": "^3.1|^4"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.5-dev"
}
},
"autoload": {
"psr-0": {
"Payum\\Offline": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kotlyar Maksim",
"email": "kotlyar.maksim@gmail.com"
},
{
"name": "Payum project",
"homepage": "https://payum.forma-pro.com/"
},
{
"name": "Community contributions",
"homepage": "https://github.com/Payum/Offline/contributors"
}
],
"description": "The Payum extension. It provides Offline payment integration.",
"homepage": "https://payum.forma-pro.com",
"keywords": [
"invoice",
"offlile",
"payment"
],
"time": "2019-11-23T14:41:43+00:00"
},
{
"name": "payum/payum-bundle",
"version": "2.4.1",
"source": {
"type": "git",
"url": "https://github.com/Payum/PayumBundle.git",
"reference": "08416446c546d3aca218b91b237c2a25d147afbc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Payum/PayumBundle/zipball/08416446c546d3aca218b91b237c2a25d147afbc",
"reference": "08416446c546d3aca218b91b237c2a25d147afbc",
"shasum": ""
},
"require": {
"payum/core": "^1.5",
"php": "^7.1.3",
"symfony/form": "^4.4|^5",
"symfony/framework-bundle": "^4.4|^5",
"symfony/security-csrf": "^4.4|^5",
"symfony/validator": "^4.4|^5"
},
"require-dev": {
"defuse/php-encryption": "^2",
"doctrine/orm": "~2.5",
"ext-curl": "*",
"ext-pdo_sqlite": "*",
"ext-soap": "*",
"fp/klarna-invoice": "0.1.*",
"klarna/checkout": "~1|~2.0",
"omnipay/common": "^3@dev",
"omnipay/dummy": "^3@alpha",
"omnipay/paypal": "^3@dev",
"paypal/rest-api-sdk-php": "0.5.*",
"payum/omnipay-v3-bridge": "^1@alpha",
"payum/payum": "^1.5@dev",
"php-http/guzzle6-adapter": "^1",
"phpunit/phpunit": "^7.5",
"stripe/stripe-php": "~1.0",
"symfony/browser-kit": "^4.4|^5",
"symfony/expression-language": "^4.4|^5",
"symfony/phpunit-bridge": "^4.4|^5",
"symfony/templating": "^4.4|^5",
"symfony/twig-bundle": "^4.4|^5",
"symfony/yaml": "^4.4|^5",
"twig/twig": "^1.16|^2.0"
},
"suggest": {
"sonata-project/admin-bundle": "^3 If you want to configure payments in the backend."
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "2.3-dev"
}
},
"autoload": {
"psr-4": {
"Payum\\Bundle\\PayumBundle\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kotlyar Maksim",
"email": "kotlyar.maksim@gmail.com"
},
{
"name": "Payum project",
"homepage": "https://payum.forma-pro.com/"
},
{
"name": "Community contributions",
"homepage": "https://github.com/Payum/PayumBundle/contributors"
}
],
"description": "One million downloads of Payum already! Payum offers everything you need to work with payments. Check more visiting site.",
"homepage": "https://payum.forma-pro.com/",
"keywords": [
"authorize.net",
"be2bill",
"instant notifications",
"klarna",
"offline",
"omnipay",
"payex",
"payment",
"paypal",
"paypal express checkout",
"paypal pro checkout",
"recurring payment",
"stripe",
"stripe checkout",
"stripe.js",
"symfony"
],
"time": "2020-02-11T19:51:20+00:00"
},
{
"name": "php-http/discovery",
"version": "1.8.0",
"source": {
......@@ -14048,7 +14897,9 @@
],
"aliases": [],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"ekyna/payum-payzen": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {
......
......@@ -49,4 +49,5 @@ return [
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Sonata\ClassificationBundle\SonataClassificationBundle::class => ['all' => true],
App\Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle::class => ['all' => true],
Payum\Bundle\PayumBundle\PayumBundle::class => ['all' => true],
];
payum:
storages:
App\Entity\Payment: { doctrine: orm }
security:
token_storage:
App\Entity\PaymentToken: { doctrine: orm }
gateways:
offline:
factory: offline
payzen:
factory: payzen
site_id: '%env(PAZEN_SITE_ID)%'
certificate: '%env(PAYZEN_CERTIFICATE)%' # Clé de TEST ou PRODUCTION
ctx_mode: '%env(PAYZEN_CTX_MODE)%' # TEST ou PRODUCTION
directory: '%kernel.project_dir%/transactions'
debug: '%env(bool:PAYZEN_DEBUG)%'
......@@ -236,6 +236,7 @@ sonata_admin:
items:
- admin.flux.gerer
- admin.all.cotisations
- admin.all.achats_monnaie
- admin.transfert.gerer
- admin.transaction.gerer
- admin.reconversion.gerer
......
......@@ -30,3 +30,6 @@ app.swagger_ui:
path: /api/doc
methods: GET
defaults: { _controller: nelmio_api_doc.controller.swagger_ui }
payum_all:
resource: "@PayumBundle/Resources/config/routing/all.xml"
......@@ -167,6 +167,14 @@ services:
calls:
- [setManager, ['@doctrine.orm.entity_manager']]
app.payzen_gateway_factory:
class: Payum\Core\Bridge\Symfony\Builder\GatewayFactoryBuilder
arguments: [Ekyna\Component\Payum\Payzen\PayzenGatewayFactory]
tags:
- { name: payum.gateway_factory_builder, factory: payzen }
###### Configuration de l'admin ######
admin.block.dashboard:
class: App\Block\DashboardKohinosBlock
arguments:
......@@ -174,8 +182,6 @@ services:
tags:
- { name: sonata.block }
###### Configuration de l'admin ######
admin.adherent.gerer:
class: App\Admin\AdherentAdmin
# arguments: [~, App\Entity\OBJECT, 'PixSortableBehaviorBundle:SortableAdmin']
......@@ -206,6 +212,18 @@ services:
calls:
- [ setSecurity, ['@security.helper']]
admin.all.achats_monnaie:
class: App\Admin\AchatMonnaieAdmin
arguments: [~, App\Entity\AchatMonnaie, ~]
tags:
- name: sonata.admin
manager_type: orm
group: "Flux"
label: "Achats de monnaie"
public: true
calls:
- [ setSecurity, ['@security.helper']]
admin.adherent.cotisations:
class: App\Admin\CotisationAdherentAdmin
arguments: [~, App\Entity\CotisationAdherent, ~]
......@@ -364,7 +382,7 @@ services:
pager_type: "simple"
public: true
calls:
- [ setSubClasses, [{transaction: 'App\Entity\Transaction', transfert: 'App\Entity\Transfert', cotisation: 'App\Entity\Cotisation'}]]
- [ setSubClasses, [{transaction: 'App\Entity\Transaction', transfert: 'App\Entity\Transfert', cotisation: 'App\Entity\Cotisation', achat_monnaie: 'App\Entity\AchatMonnaie'}]]
- [ setSecurity, ['@security.helper']]
admin.transfert.gerer:
......
<?php
namespace App\Admin;
use App\Entity\User;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Route\RouteCollection;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Security\Core\Security;
/**
* Administration des flux 'Achat de monnaie'
*
* KOHINOS : Outil de gestion de Monnaie Locale Complémentaire
* @author Damien Moulard <dam.moulard@gmail.com>
*/
class AchatMonnaieAdmin extends AbstractAdmin
{
protected $baseRouteName = 'achat_monnaie';
protected $baseRoutePattern = 'achat_monnaie';
protected $security;
protected $translator;
protected $datagridValues = [
'_sort_order' => 'DESC',
'_sort_by' => 'createdAt',
];
public function setSecurity(Security $security)
{
$this->security = $security;
}
/**
* {@inheritdoc}
*/
protected function configureDatagridFilters(DatagridMapper $datagridMapper): void
{
$datagridMapper->add('type', null, array(
'advanced_filter' => false,
'show_filter' => true,
'field_type' => ChoiceType::class,
'field_options' => array(
'choices' => array('Adhérent' => 'achat_monnaie_adherent', 'Prestataire' => 'achat_monnaie_prestataire'),
'placeholder' => 'Indifférent',
'expanded' => true,
'multiple' => false
)
));
}
/**
* {@inheritdoc}
*/
protected function configureFormFields(FormMapper $formMapper)
{
}
protected function configureRoutes(RouteCollection $collection)
{
$collection->remove('delete');
if ($this->security->getUser() != null && !($this->security->getUser()->isGranted('ROLE_TRESORIER') || $this->security->getUser()->isGranted('ROLE_SUPER_ADMIN') || $this->security->getUser()->isGranted('ROLE_COMPTOIR'))) {
$collection->clearExcept(array('list', 'export'));
}
}
/**
* {@inheritdoc}
*/
protected function configureListFields(ListMapper $listMapper)
{
unset($this->listModes['mosaic']);
$listMapper
->add('createdAt', 'datetime', array('label' => 'Date'))
->add('montant', null, array('label' => 'Montant'))
->add('destinataire', null, array('label' => 'Destinataire'))
->add('operateur', null, array('label' => 'Operateur'))
->add('reference', null, array('label' => 'Reference'))
;
}
}
......@@ -81,7 +81,7 @@ class FluxAdmin extends AbstractAdmin
'show_filter' => true,
'field_type' => SChoiceType::class,
'field_options' => array(
'choices' => array('Transactions' => 'transaction', 'Transferts' => 'transfert', 'Cotisations' => 'cotisation'),
'choices' => array('Transactions' => 'transaction', 'Transferts' => 'transfert', 'Cotisations' => 'cotisation', 'Achat de monnaie' => 'achat'),
'placeholder' => 'Indifférent',
'expanded' => true,
'multiple' => false
......
......@@ -15,6 +15,20 @@ use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Security;
use Symfony\Component\Translation\TranslatorInterface;
use Payum\Core\Payum;
use Payum\Core\Request\GetHumanStatus;
use Payum\Core\Request\Notify;
use App\Entity\Payment;
use App\Entity\Siege;
use App\Entity\User;
use App\Entity\Adherent;
use App\Entity\Prestataire;
use App\Entity\AchatMonnaieAdherent;
use App\Entity\AchatMonnaiePrestataire;
use App\Entity\CotisationAdherent;
use App\Entity\CotisationPrestataire;
use Symfony\Component\Serializer\Normalizer\AbstractNormalizer;
/**
*
......@@ -43,14 +57,16 @@ class FluxController extends AbstractController
protected $translator;
protected $eventDispatcher;
protected $session;
protected $payum;
public function __construct(Security $security, EntityManagerInterface $em, TranslatorInterface $translator, EventDispatcherInterface $eventDispatcher, SessionInterface $session)
public function __construct(Security $security, EntityManagerInterface $em, TranslatorInterface $translator, EventDispatcherInterface $eventDispatcher, SessionInterface $session, Payum $payum)
{
$this->security = $security;
$this->em = $em;
$this->translator = $translator;
$this->eventDispatcher = $eventDispatcher;
$this->session = $session;
$this->payum = $payum;
}
protected function manageFluxForm(Request $request, Form $form, $compte, $success, $title)
......@@ -84,4 +100,221 @@ class FluxController extends AbstractController
'title' => $title
]);
}
/*
* Crée une instance de Payment et redirige vers la page de paiement
*/
public function preparePaymentAction(Form $form, $type)
{
$flux_data = $form->getData();
// Enregistre les données du Flux en json, pour l'enregistrer une fois le paiement validé
$serializer = $this->container->get('serializer');
$data = $serializer->normalize($flux_data, null,
[AbstractNormalizer::ATTRIBUTES => ['reference',
'moyen',
'montant',
'role',
'expediteur' => ['id'],
'destinataire' => ['id'],
'operateur' => ['id']]]);
$jsondata = $serializer->serialize($data, 'json');
// Prepare CB Payment
$gatewayName = 'payzen';
$storage = $this->payum->getStorage('App\Entity\Payment');
$payment = $storage->create();
$payment->setNumber(uniqid());
$payment->setCurrencyCode('978');
$payment->setTotalAmount($form->get('montant')->getData()*100); // 1.23 EUR
$payment->setDescription($type);
$payment->setClientId($this->getUser()->getId());
$payment->setClientEmail($this->getUser()->getEmail());
$payment->setFluxData($jsondata);
$storage->update($payment);
$captureToken = $this->payum->getTokenFactory()->createCaptureToken(
$gatewayName,
$payment,
'payment_done' // the route to redirect after capture
);
return $this->redirect($captureToken->getTargetUrl());
}
/**
* Fonction de traitement du paiement, à appeler :
* - automatiquement lorsqu'un événement se produit sur le site de Paiement
* - au retour sur le site par l'utilisateur
*
* @Route("/payment/done/", name="payment_done")
*/
public function doneAction(Request $request)
{
try {
$token = $this->payum->getHttpRequestVerifier()->verify($request);
} catch (\Exception $e) {
// Token expiré : retour sur site après paiement
// Get last payment
$payment = $this->em->getRepository(Payment::class)->getUserLastPayment($this->getUser()->getId());
if (!is_null($payment)) {
if ($payment->getStatus() == GetHumanStatus::STATUS_CAPTURED || $payment->getStatus() == GetHumanStatus::STATUS_AUTHORIZED) {
$type = $payment->getDescription();
if (Payment::TYPE_ACHAT_MONNAIE_ADHERENT == $type || Payment::TYPE_ACHAT_MONNAIE_PRESTA == $type) {
$this->addFlash(
'success',
$this->translator->trans('Achat de monnaie locale bien effectué !')
);
} else {
$this->addFlash(
'success',
$this->translator->trans('Cotisation bien reçue. Merci !')
);
}
// Update payment status
$payment->setStatus($payment->getStatus().';done');
$this->em->persist($payment);
$this->em->flush();
} else if ($payment->getStatus() == GetHumanStatus::STATUS_CANCELED ||
$payment->getStatus() == GetHumanStatus::STATUS_EXPIRED ||
$payment->getStatus() == GetHumanStatus::STATUS_FAILED) {
$this->addFlash(
'error',
$this->translator->trans('La transaction a été annulée.')
);
$payment->setStatus($payment->getStatus().';done');
$this->em->persist($payment);
$this->em->flush();
}
}
return $this->redirectToRoute('index');
}
$gateway = $this->payum->getGateway($token->getGatewayName());
// Execute Notify action
$gateway->execute(new Notify($token));
// Execute 'done' action according to payment status
$gateway->execute($status = new GetHumanStatus($token));
// Get payment & update status
$payment = $status->getFirstModel();
$payment->setStatus($status->getValue());
$this->em->persist($payment);
$this->em->flush();
// If payment succesful, persist serialized 'Flux' stored in payment
if ($status->getValue() == GetHumanStatus::STATUS_CAPTURED || $status->getValue() == GetHumanStatus::STATUS_AUTHORIZED) {
$serializer = $this->container->get('serializer');
$flux_array = json_decode($payment->getFluxData(), true);
$type = $payment->getDescription();
if (Payment::TYPE_ACHAT_MONNAIE_ADHERENT == $type) {
$flux = $serializer->deserialize(
$payment->getFluxData(),
AchatMonnaieAdherent::class,
'json',
['disable_type_enforcement' => true]
);
$exp = $this->em->getRepository(Siege::class)->find($flux_array['expediteur']);
$flux->setExpediteur($exp);
$dest = $this->em->getRepository(Adherent::class)->find($flux_array['destinataire']);
$flux->setDestinataire($dest);
} else if (Payment::TYPE_ACHAT_MONNAIE_PRESTA == $type) {
$flux = $serializer->deserialize(
$payment->getFluxData(),
AchatMonnaiePrestataire::class,
'json',
['disable_type_enforcement' => true]
);
$exp = $this->em->getRepository(Siege::class)->find($flux_array['expediteur']);
$flux->setExpediteur($exp);
$dest = $this->em->getRepository(Prestataire::class)->find($flux_array['destinataire']);
$flux->setDestinataire($dest);
} else if (Payment::TYPE_COTISATION_ADHERENT == $type) {
$flux = $serializer->deserialize(
$payment->getFluxData(),
CotisationAdherent::class,
'json',
['disable_type_enforcement' => true]
);
$exp = $this->em->getRepository(Adherent::class)->find($flux_array['expediteur']);
$flux->setExpediteur($exp);
$dest = $this->em->getRepository(Prestataire::class)->find($flux_array['destinataire']);
$flux->setDestinataire($dest);
$flux->setRecu(true);
} else if (Payment::TYPE_COTISATION_PRESTA == $type) {
$flux = $serializer->deserialize(
$payment->getFluxData(),
CotisationPrestataire::class,
'json',
['disable_type_enforcement' => true]
);
$exp = $this->em->getRepository(Prestataire::class)->find($flux_array['expediteur']);
$flux->setExpediteur($exp);
$dest = $this->em->getRepository(Prestataire::class)->find($flux_array['destinataire']);
$flux->setDestinataire($dest);
$flux->setRecu(true);
} else {
return new Response('', Response::HTTP_BAD_REQUEST);
}
$op = $this->em->getRepository(User::class)->find($flux_array['operateur']);
$flux->setOperateur($op);
$this->em->persist($flux);
$this->em->flush();
$this->eventDispatcher->dispatch(
MLCEvents::FLUX,
new FluxEvent($flux)
);
// Add Flash message here in case Gataway doesn't notify
$this->addFlash(
'success',
$this->translator->trans('Achat de monnaie locale bien effectué !')
);
// Invalidate token
$this->payum->getHttpRequestVerifier()->invalidate($token);
} else if ($status->getValue() == GetHumanStatus::STATUS_CANCELED ||
$status->getValue() == GetHumanStatus::STATUS_EXPIRED ||
$status->getValue() == GetHumanStatus::STATUS_FAILED) {
$this->addFlash(
'error',
$this->translator->trans('La transaction a été annulée.')
);
$this->payum->getHttpRequestVerifier()->invalidate($token);
}
return $this->redirectToRoute('index');
}
}
......@@ -8,6 +8,7 @@ use App\Entity\Geoloc;
use App\Entity\TransactionAdherentAdherent;
use App\Entity\TransactionAdherentPrestataire;
use App\Entity\AchatMonnaieAdherent;
use App\Entity\Payment;
use App\Entity\Usergroup;
use App\Form\Type\AdherentInfosFormType;
use App\Form\Type\AdhererFormType;
......@@ -104,18 +105,19 @@ class UserAdherentController extends FluxController
}
$entity = new AchatMonnaieAdherent();
$entity->setReference("Achat Monnaie en CB");
$form = $this->createForm(AchatMonnaieAdherentFormType::class, $entity);
$form->handleRequest($request);
//TODO custom form handling -> redirect to payzen or other mean of payment
return $this->redirectToRoute('index');
return $this->manageFluxForm(
$request,
if ($form->isSubmitted() && $form->isValid()) {
return $this->preparePaymentAction(
$form,
$this->getUser()->getAdherent()->getCompte(),
$this->translator->trans('Achat de monnaie locale bien effectuée !'),
$this->translator->trans('Achat de monnaie locale')
Payment::TYPE_ACHAT_MONNAIE_ADHERENT
);
}
return $this->render('flux/transaction.html.twig', [
'form' => $form->createView(),
'title' => $this->translator->trans('Achat de monnaie locale')
]);
}
}
......@@ -5,6 +5,7 @@ namespace App\Controller;
use App\Entity\User;
use App\Entity\CotisationAdherent;
use App\Entity\CotisationPrestataire;
use App\Entity\Payment;
use App\Enum\MoyenEnum;
use App\Form\Type\CotiserFormType;
use App\Form\Type\UserInfosFormType;
......@@ -37,10 +38,13 @@ class UserController extends AbstractController
public function cotiserAction(Request $request)
{
$options = [];
$payment_type = '';
if ($this->security->getUser()->isGranted('ROLE_ADHERENT')) {
$options['data_class'] = CotisationAdherent::class;
$payment_type = Payment::TYPE_COTISATION_ADHERENT;
} elseif ($this->security->getUser()->isGranted('ROLE_PRESTATAIRE')) {
$options['data_class'] = CotisationPrestataire::class;
$payment_type = Payment::TYPE_COTISATION_PRESTA;
}
$form = $this->createForm(CotiserFormType::class, null, $options);
......@@ -65,7 +69,11 @@ class UserController extends AbstractController
);
return $this->redirectToRoute('index');
} else {
//@TODO : redirect to payment page
// Redirect to payment page
return $this->forward('App\Controller\FluxController::preparePaymentAction', [
'form' => $form,
'type' => $payment_type
]);
}
} else {
$this->addFlash(
......
......@@ -9,6 +9,7 @@ use App\Entity\TransactionPrestataireAdherent;
use App\Entity\TransfertPrestataireSiege;
use App\Entity\TypePrestataire;
use App\Entity\AchatMonnaiePrestataire;
use App\Entity\Payment;
use App\Form\Type\GroupePrestataireInscriptionFormType;
use App\Form\Type\PrestataireInfosFormType;
use App\Form\Type\TransactionPrestataireAdherentFormType;
......@@ -135,21 +136,24 @@ class UserPrestataireController extends FluxController
if (empty($this->getUser()) || empty($this->session->get('_prestagere'))) {
return $this->redirectToRoute('index');
}
$entity = new AchatMonnaiePrestataire();
$form = $this->createForm(AchatMonnaiePrestataireFormType::class, $entity);
$form->handleRequest($request);
///TODO custom form handling -> redirect to payzen or other mean of payment
return $this->redirectToRoute('index');
return $this->manageFluxForm(
$request,
if ($form->isSubmitted() && $form->isValid()) {
return $this->preparePaymentAction(
$form,
$this->session->get('_prestagere'),
$this->translator->trans('Achat de monnaie locale bien effectuée !'),
$this->translator->trans('Achat de monnaie locale')
Payment::TYPE_ACHAT_MONNAIE_PRESTA
);
}
return $this->render('flux/transaction.html.twig', [
'form' => $form->createView(),
'title' => $this->translator->trans('Achat de monnaie locale')
]);
}
/**
* Export all transferts / transactions for prestataire
*
......
......@@ -44,8 +44,8 @@ class Cotisation extends Flux
// throw new \Exception("[FLUX] Opération impossible ! Prestataire recevant la monnaie locale non configuré !");
// }
// $destinataire = $destinataires[0];
$compteExp = $this->getExpediteur()->getEcompte() - $this->getMontant();
if ($this->getMoyen() == MoyenEnum::MOYEN_MLC) {
$compteExp = $this->getExpediteur()->getEcompte() - $this->getMontant();
if ($compteExp < 0) {
throw new \Exception("[FLUX] Opération impossible ! Montant supérieur au solde de monnaie éléctronique !");
} else {
......@@ -55,6 +55,7 @@ class Cotisation extends Flux
return [$this->getExpediteur(), $this->getDestinataire()];
}
}
// Pas d'opération si la cotisation se fait par CB
return [];
}
......
......@@ -13,7 +13,7 @@ trait HasEcompteEntity
* Compte de MLC numérique
* @var int
*
* @ORM\Column(name="ecompte", type="decimal", precision=12, scale=2)
* @ORM\Column(name="ecompte", type="decimal", precision=12, scale=2, options={"default" : 0})
* @Groups({"read"})
*/
private $ecompte = 0;
......
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Payum\Core\Model\Payment as BasePayment;
/**
* @ORM\Entity(repositoryClass="App\Repository\PaymentRepository")
* @ORM\Table(name="payment")
*/
class Payment extends BasePayment
{
const TYPE_ACHAT_MONNAIE_ADHERENT = 'achat_monnaie_adherent';
const TYPE_ACHAT_MONNAIE_PRESTA = 'achat_monnaie_presta';
const TYPE_COTISATION_ADHERENT = 'cotisation_adherent';
const TYPE_COTISATION_PRESTA = 'cotisation_presta';
/**
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*
* @var integer $id
*/
protected $id;
/**
* @var string|null
*
* @ORM\Column(type="string", length=50, nullable=true)
*/
protected $status;
/**
* @var string|null
* JSON array of 'Flux' to persist if payment valid
*
* @ORM\Column(type="text", nullable=true)
*/
protected $flux_data;
/**
* @return string
*/
public function getStatus(): ?string
{
return $this->status;
}
/**
* @param string $status
* @return Payment
*/
public function setStatus(string $status): self
{
$this->status = $status;
return $this;
}
/**
* @return string
*/
public function getFluxData(): ?string
{
return $this->flux_data;
}
/**
* @param string $flux_data
* @return Payment
*/
public function setFluxData(string $flux_data): self
{
$this->flux_data = $flux_data;
return $this;
}
}
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Payum\Core\Model\Token;
/**
* @ORM\Entity
* @ORM\Table(name="payment_token")
*/
class PaymentToken extends Token
{
}
......@@ -10,7 +10,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity
* @ORM\Entity(repositoryClass="App\Repository\SiegeRepository")
* @ORM\Table(name="siege")
*/
class Siege
......
......@@ -23,7 +23,7 @@ class AchatMonnaieAdherentFormType extends AchatMonnaieFormType
'em' => $this->em
))
->add('reference', HiddenType::class, array(
'data' => 'Achat monnaie en CB'
'data' => 'Achat monnaie en CB Adhérent'
))
->add('save', SubmitType::class, ['label' => "Payer en CB"])
;
......
......@@ -4,6 +4,7 @@ namespace App\Form\Type;
use App\Entity\Prestataire;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
......@@ -22,8 +23,9 @@ class AchatMonnaiePrestataireFormType extends AchatMonnaieFormType
'em' => $this->em
))
->add('reference', HiddenType::class, array(
'data' => 'Achat monnaie en CB'
'data' => 'Achat monnaie en CB Prestataire'
))
->add('save', SubmitType::class, ['label' => "Payer en CB"])
;
}
......
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200626122137 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE payment (id INT AUTO_INCREMENT NOT NULL, number VARCHAR(255) DEFAULT NULL, description VARCHAR(255) DEFAULT NULL, client_email VARCHAR(255) DEFAULT NULL, client_id VARCHAR(255) DEFAULT NULL, total_amount INT DEFAULT NULL, currency_code VARCHAR(255) DEFAULT NULL, details LONGTEXT NOT NULL COMMENT \'(DC2Type:json_array)\', status VARCHAR(50) DEFAULT NULL, flux_data LONGTEXT DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE payment_token (hash VARCHAR(255) NOT NULL, details LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:object)\', after_url LONGTEXT DEFAULT NULL, target_url LONGTEXT NOT NULL, gateway_name VARCHAR(255) NOT NULL, PRIMARY KEY(hash)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_general_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE adherent CHANGE ecompte ecompte NUMERIC(12, 2) DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE ecompte ecompte NUMERIC(12, 2) DEFAULT \'0\' NOT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE payment');
$this->addSql('DROP TABLE payment_token');
$this->addSql('ALTER TABLE adherent CHANGE ecompte ecompte NUMERIC(12, 2) NOT NULL');
$this->addSql('ALTER TABLE prestataire CHANGE ecompte ecompte NUMERIC(12, 2) NOT NULL');
}
}
<?php
namespace App\Repository;
use App\Entity\Payment;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* @method Siege|null find($id, $lockMode = null, $lockVersion = null)
* @method Siege|null findOneBy(array $criteria, array $orderBy = null)
* @method Siege[] findAll()
* @method Siege[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class PaymentRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Payment::class);
}
/**
* @param int $id User id
*
* @return Payment|null Returns user's last payment
*/
public function getUserLastPayment($id) {
$results = $this->findBy(
array('clientId' => $id),
array('id'=>'DESC'),
1,
0
);
if (empty($results)) {
return null;
} else {
return $results[0];
}
}
}
<?php
namespace App\Repository;
use App\Entity\Siege;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* @method Siege|null find($id, $lockMode = null, $lockVersion = null)
* @method Siege|null findOneBy(array $criteria, array $orderBy = null)
* @method Siege[] findAll()
* @method Siege[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class SiegeRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Siege::class);
}
}
......@@ -107,6 +107,9 @@
"egulias/email-validator": {
"version": "2.1.6"
},
"ekyna/payum-payzen": {
"version": "1.5.x-dev"
},
"exsyst/swagger": {
"version": "v0.4.1"
},
......@@ -248,6 +251,27 @@
"lcobucci/jwt": {
"version": "3.3.1"
},
"league/uri": {
"version": "5.3.0"
},
"league/uri-components": {
"version": "1.8.2"
},
"league/uri-hostname-parser": {
"version": "1.1.1"
},
"league/uri-interfaces": {
"version": "1.1.1"
},
"league/uri-manipulations": {
"version": "1.5.0"
},
"league/uri-parser": {
"version": "1.4.1"
},
"league/uri-schemes": {
"version": "1.2.1"
},
"lexik/jwt-authentication-bundle": {
"version": "2.5",
"recipe": {
......@@ -320,6 +344,27 @@
"ocramius/proxy-manager": {
"version": "2.1.1"
},
"payum/core": {
"version": "1.6.0"
},
"payum/iso4217": {
"version": "1.0.1"
},
"payum/offline": {
"version": "1.6.0"
},
"payum/payum-bundle": {
"version": "2.4",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "master",
"version": "2.4",
"ref": "72ad834a0f4a99175beddb5e2d049136f4a50a67"
},
"files": [
"config/packages/payum.yaml"
]
},
"php": {
"version": "7.4"
},
......
......@@ -24,7 +24,7 @@
{% if ((app.user and is_granted('ROLE_ADHERENT') and app.user.adherent) or (app.user and is_granted('ROLE_PRESTATAIRE') and app.session.has('_prestagere'))) %}
<a class='btn btn-xs btn-primary' href='{{ path('cotiser') }}'>
{{ 'Cotiser en MLC'|trans }}
{{ 'Cotiser'|trans }}
</a>
{% endif %}
{% endblock blockcontent %}
......
......@@ -27,7 +27,7 @@
{% if flux.type == 'reconversion' %}
<td>Demande de reconversion</td>
{% else %}
<td>{{flux.parenttype|capitalize}} de {{ flux.type|capitalize|replace({'_' : ' à '}) }}</td>
<td>{{ flux.type|capitalize|replace({'_' : ' '}) }}</td>
{% endif %}
<td>{{flux.expediteur}}</td>
<td>{{flux.destinataire}}</td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment