From 14cc9fb330f5bdd5dd8905e79ebac57acf13fced Mon Sep 17 00:00:00 2001 From: Paul Andrieux Date: Thu, 6 Oct 2016 16:57:34 +0200 Subject: [PATCH 1/2] replace mongopay by mangopay --- ...nterface.php => MangopayExceptionInterface.php} | 2 +- Exception/MangopayPayInCreationException.php | 8 ++++++++ Exception/MongopayPayInCreationException.php | 8 -------- Helper/BankwireHelper.php | 14 -------------- Helper/MangopayHelper.php | 2 +- Helper/PaymentHelper.php | 4 ++-- 6 files changed, 12 insertions(+), 26 deletions(-) rename Exception/{MongopayExceptionInterface.php => MangopayExceptionInterface.php} (61%) create mode 100644 Exception/MangopayPayInCreationException.php delete mode 100644 Exception/MongopayPayInCreationException.php diff --git a/Exception/MongopayExceptionInterface.php b/Exception/MangopayExceptionInterface.php similarity index 61% rename from Exception/MongopayExceptionInterface.php rename to Exception/MangopayExceptionInterface.php index f7131c5..02dfc28 100644 --- a/Exception/MongopayExceptionInterface.php +++ b/Exception/MangopayExceptionInterface.php @@ -2,7 +2,7 @@ namespace Troopers\MangopayBundle\Exception; -interface MongopayExceptionInterface +interface MangopayExceptionInterface { } diff --git a/Exception/MangopayPayInCreationException.php b/Exception/MangopayPayInCreationException.php new file mode 100644 index 0000000..13198fb --- /dev/null +++ b/Exception/MangopayPayInCreationException.php @@ -0,0 +1,8 @@ +dispatcher->dispatch(TroopersMangopayEvents::ERROR_PAY_IN, $event); - throw new MongopayPayInCreationException($this->translator->trans( + throw new MangopayPayInCreationException($this->translator->trans( 'mangopay.error.'.$payIn->ResultCode, [], 'messages' )); From f75de9531f30ab2614b6583cecbc6e3af26f6f9b Mon Sep 17 00:00:00 2001 From: Paul Andrieux Date: Thu, 6 Oct 2016 17:17:33 +0200 Subject: [PATCH 2/2] :shirt: CS fixes --- Controller/PaymentController.php | 12 +- DependencyInjection/Configuration.php | 6 +- .../TroopersMangopayExtension.php | 18 +- Entity/BankInformationInterface.php | 8 +- Entity/CardPreAuthorisation.php | 158 +++++++++++------- Entity/Order.php | 47 +++--- Entity/Transaction.php | 99 ++++++----- Entity/TransactionInterface.php | 20 +-- Entity/UserInterface.php | 19 +-- Event/CardRegistrationEvent.php | 4 +- Event/OrderEvent.php | 3 +- Event/PayInEvent.php | 4 +- Event/PreAuthorisationEvent.php | 11 +- Event/UserEvent.php | 10 +- Event/WalletEvent.php | 10 +- Exception/MangopayExceptionInterface.php | 1 - Exception/MangopayPayInCreationException.php | 1 - Form/CardType.php | 99 ++++++----- Helper/BankInformationHelper.php | 20 +-- Helper/BankwireHelper.php | 9 +- Helper/MangopayHelper.php | 5 +- Helper/PaymentDirectHelper.php | 15 +- Helper/PaymentHelper.php | 16 +- Helper/UserHelper.php | 15 +- Helper/WalletHelper.php | 20 +-- OrderEvents.php | 3 +- TroopersMangopayEvents.php | 19 +-- 27 files changed, 336 insertions(+), 316 deletions(-) diff --git a/Controller/PaymentController.php b/Controller/PaymentController.php index 4255a49..8306266 100644 --- a/Controller/PaymentController.php +++ b/Controller/PaymentController.php @@ -2,18 +2,18 @@ namespace Troopers\MangopayBundle\Controller; -use Troopers\MangopayBundle\TroopersMangopayEvents; -use Troopers\MangopayBundle\Entity\Order; -use Troopers\MangopayBundle\Event\OrderEvent; -use Troopers\MangopayBundle\Event\PreAuthorisationEvent; -use Troopers\MangopayBundle\Form\CardType; -use Troopers\MangopayBundle\OrderEvents; use MangoPay\CardRegistration; use MangoPay\PayIn; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; +use Troopers\MangopayBundle\Entity\Order; +use Troopers\MangopayBundle\Event\OrderEvent; +use Troopers\MangopayBundle\Event\PreAuthorisationEvent; +use Troopers\MangopayBundle\Form\CardType; +use Troopers\MangopayBundle\OrderEvents; +use Troopers\MangopayBundle\TroopersMangopayEvents; /** * Manage payment. diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 5a5eb0e..72f6064 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -6,20 +6,20 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; /** - * This is the class that validates and merges configuration from your app/config files + * This is the class that validates and merges configuration from your app/config files. * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html#cookbook-bundles-extension-config-class} */ class Configuration implements ConfigurationInterface { /** - * {@inheritDoc} + * {@inheritdoc} */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder(); $rootNode = $treeBuilder->root('troopers_mangopay'); - + $rootNode ->children() ->booleanNode('debug_mode')->defaultValue(false)->end() diff --git a/DependencyInjection/TroopersMangopayExtension.php b/DependencyInjection/TroopersMangopayExtension.php index 426e5a9..7f4b03c 100644 --- a/DependencyInjection/TroopersMangopayExtension.php +++ b/DependencyInjection/TroopersMangopayExtension.php @@ -2,20 +2,20 @@ namespace Troopers\MangopayBundle\DependencyInjection; -use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Config\FileLocator; -use Symfony\Component\HttpKernel\DependencyInjection\Extension; +use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader; +use Symfony\Component\HttpKernel\DependencyInjection\Extension; /** - * This is the class that loads and manages your bundle configuration + * This is the class that loads and manages your bundle configuration. * * To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html} */ class TroopersMangopayExtension extends Extension { /** - * {@inheritDoc} + * {@inheritdoc} */ public function load(array $configs, ContainerBuilder $container) { @@ -24,10 +24,10 @@ public function load(array $configs, ContainerBuilder $container) $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); $loader->load('services.yml'); - - $container->setParameter('Troopers_mangopay.debug_mode', $config['debug_mode'] === true); - $container->setParameter('Troopers_mangopay.client_id', $config['client_id']); - $container->setParameter('Troopers_mangopay.client_password', $config['client_password']); - $container->setParameter('Troopers_mangopay.base_url', $config['base_url']); + + $container->setParameter('Troopers_mangopay.debug_mode', $config['debug_mode'] === true); + $container->setParameter('Troopers_mangopay.client_id', $config['client_id']); + $container->setParameter('Troopers_mangopay.client_password', $config['client_password']); + $container->setParameter('Troopers_mangopay.base_url', $config['base_url']); } } diff --git a/Entity/BankInformationInterface.php b/Entity/BankInformationInterface.php index 9aab9af..2150200 100644 --- a/Entity/BankInformationInterface.php +++ b/Entity/BankInformationInterface.php @@ -4,22 +4,22 @@ /** * Defines mandatory methods BankInformation need to be used in Mango - * https://docs.mangopay.com/api-references/users/natural-users/ + * https://docs.mangopay.com/api-references/users/natural-users/. */ interface BankInformationInterface { /** - * Author Mango Id + * Author Mango Id. + * * @var string */ public function getAddress(); /** * It represents the amount debited on the bank account of the Author.In cents so 100€ will be written like « Amount » : 10000 - * DebitedFunds – Fees = CreditedFunds (amount received on wallet) + * DebitedFunds – Fees = CreditedFunds (amount received on wallet). * * @var string */ public function getIban(); - } diff --git a/Entity/CardPreAuthorisation.php b/Entity/CardPreAuthorisation.php index 1c1b886..ebf1c18 100644 --- a/Entity/CardPreAuthorisation.php +++ b/Entity/CardPreAuthorisation.php @@ -6,7 +6,7 @@ use Gedmo\Timestampable\Traits\TimestampableEntity; /** - * CardPreAuthorisation + * CardPreAuthorisation. * * @ORM\MappedSuperclass */ @@ -15,7 +15,7 @@ class CardPreAuthorisation use TimestampableEntity; /** - * @var integer + * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id @@ -24,28 +24,29 @@ class CardPreAuthorisation protected $id; /** - * @var Int Unique identifier - * (At this moment type is Integer - in the feature will be GUID) + * @var int Unique identifier + * (At this moment type is Integer - in the feature will be GUID) * @ORM\Column(name="mango_id", type="integer") */ protected $mangoId; /** - * @var Int Unique identifier - * (At this moment type is Integer - in the feature will be GUID) + * @var int Unique identifier + * (At this moment type is Integer - in the feature will be GUID) * @ORM\Column(name="tag", type="string", length=255, nullable=true) */ protected $tag; /** - * @var Int Unique identifier - * (At this moment type is Integer - in the feature will be GUID) + * @var int Unique identifier + * (At this moment type is Integer - in the feature will be GUID) * @ORM\Column(name="creation_date", type="datetime", nullable=true) */ protected $creationDate; /** - * The user Id of the author of the pre-authorization + * The user Id of the author of the pre-authorization. + * * @var string * @ORM\Column(name="author_id", type="integer", nullable=true) */ @@ -54,14 +55,16 @@ class CardPreAuthorisation /** * It represents the amount debited on the bank account * of the Author.DebitedFunds = Fees + CreditedFunds - * (amount received on wallet) + * (amount received on wallet). + * * @var \MangoPay\Money * @ORM\Column(name="debited_funds", type="integer", nullable=true) */ protected $debitedFunds; /** - * Status of the PreAuthorization: CREATED, SUCCEEDED, FAILED + * Status of the PreAuthorization: CREATED, SUCCEEDED, FAILED. + * * @var string * @ORM\Column(name="status", type="string", length=255, nullable=true) */ @@ -69,21 +72,24 @@ class CardPreAuthorisation /** * The status of the payment after the PreAuthorization: - * WAITING, CANCELED, EXPIRED, VALIDATED + * WAITING, CANCELED, EXPIRED, VALIDATED. + * * @var string * @ORM\Column(name="payment_status", type="string", length=255, nullable=true) */ protected $paymentStatus; /** - * The PreAuthorization result code + * The PreAuthorization result code. + * * @var string * @ORM\Column(name="result_code", type="integer", nullable=true) */ protected $resultCode; /** - * The PreAuthorization result Message explaining the result code + * The PreAuthorization result Message explaining the result code. + * * @var string * @ORM\Column(name="result_message", type="string", length=255, nullable=true) */ @@ -91,7 +97,8 @@ class CardPreAuthorisation /** * How the PreAuthorization has been executed. - * Only on value for now: CARD + * Only on value for now: CARD. + * * @var string * @ORM\Column(name="execution_type", type="string", length=255, nullable=true) */ @@ -101,20 +108,23 @@ class CardPreAuthorisation * The SecureMode correspond to '3D secure' for CB Visa and MasterCard * or 'Amex Safe Key' for American Express. * This field lets you activate it manually. + * * @var string * @ORM\Column(name="secure_mode", type="string", length=255, nullable=true) */ protected $secureMode; /** - * The ID of the registered card (Got through CardRegistration object) + * The ID of the registered card (Got through CardRegistration object). + * * @var string * @ORM\Column(name="card_id", type="integer", nullable=true) */ protected $cardId; /** - * Boolean. The value is 'true' if the SecureMode was used + * Boolean. The value is 'true' if the SecureMode was used. + * * @var string * @ORM\Column(name="secure_mode_needed", type="string", length=255, nullable=true) */ @@ -122,7 +132,8 @@ class CardPreAuthorisation /** * This is the URL where to redirect users to proceed - * to 3D secure validation + * to 3D secure validation. + * * @var string * @ORM\Column(name="secure_mode_redirect_url", type="string", length=255, nullable=true) */ @@ -130,42 +141,47 @@ class CardPreAuthorisation /** * This is the URL where users are automatically redirected - * after 3D secure validation (if activated) + * after 3D secure validation (if activated). + * * @var string * @ORM\Column(name="secure_mode_return_url", type="string", length=255, nullable=true) */ protected $secureModeReturnURL; /** - * The date when the payment is processed + * The date when the payment is processed. + * * @var Timestamp * @ORM\Column(name="expiration_date", type="datetime", nullable=true) */ protected $expirationDate; - /** - * The date when the payment was authorized + /** + * The date when the payment was authorized. + * * @var Timestamp * @ORM\Column(name="authorization_date", type="datetime", nullable=true) */ protected $authorizationDate; /** - * The type of pre-authorization ("CARD" is the only acceptable value at present + * The type of pre-authorization ("CARD" is the only acceptable value at present. + * * @var string * @ORM\Column(name="payment_type", type="string", length=255, nullable=true) */ protected $paymentType; /** - * The Id of the associated PayIn + * The Id of the associated PayIn. + * * @var string * @ORM\Column(name="pay_in_id", type="integer", nullable=true) */ protected $payInId; /** - * Get authorId + * Get authorId. * * @return string */ @@ -175,7 +191,7 @@ public function getAuthorId() } /** - * Set authorId + * Set authorId. * * @param string $authorId * @@ -187,8 +203,9 @@ public function setAuthorId($authorId) return $this; } + /** - * Get debitedFunds + * Get debitedFunds. * * @return string */ @@ -198,7 +215,7 @@ public function getDebitedFunds() } /** - * Set debitedFunds + * Set debitedFunds. * * @param string $debitedFunds * @@ -210,8 +227,9 @@ public function setDebitedFunds($debitedFunds) return $this; } + /** - * Get status + * Get status. * * @return string */ @@ -221,7 +239,7 @@ public function getStatus() } /** - * Set status + * Set status. * * @param string $status * @@ -233,8 +251,9 @@ public function setStatus($status) return $this; } + /** - * Get paymentStatus + * Get paymentStatus. * * @return string */ @@ -244,7 +263,7 @@ public function getPaymentStatus() } /** - * Set paymentStatus + * Set paymentStatus. * * @param string $paymentStatus * @@ -256,8 +275,9 @@ public function setPaymentStatus($paymentStatus) return $this; } + /** - * Get resultCode + * Get resultCode. * * @return string */ @@ -267,7 +287,7 @@ public function getResultCode() } /** - * Set resultCode + * Set resultCode. * * @param string $resultCode * @@ -279,8 +299,9 @@ public function setResultCode($resultCode) return $this; } + /** - * Get resultMessage + * Get resultMessage. * * @return string */ @@ -290,7 +311,7 @@ public function getResultMessage() } /** - * Set resultMessage + * Set resultMessage. * * @param string $resultMessage * @@ -302,8 +323,9 @@ public function setResultMessage($resultMessage) return $this; } + /** - * Get executionType + * Get executionType. * * @return string */ @@ -313,7 +335,7 @@ public function getExecutionType() } /** - * Set executionType + * Set executionType. * * @param string $executionType * @@ -325,8 +347,9 @@ public function setExecutionType($executionType) return $this; } + /** - * Get secureMode + * Get secureMode. * * @return string */ @@ -336,7 +359,7 @@ public function getSecureMode() } /** - * Set secureMode + * Set secureMode. * * @param string $secureMode * @@ -348,8 +371,9 @@ public function setSecureMode($secureMode) return $this; } + /** - * Get cardId + * Get cardId. * * @return string */ @@ -359,7 +383,7 @@ public function getCardId() } /** - * Set cardId + * Set cardId. * * @param string $cardId * @@ -371,8 +395,9 @@ public function setCardId($cardId) return $this; } + /** - * Get secureModeNeeded + * Get secureModeNeeded. * * @return string */ @@ -382,7 +407,7 @@ public function getSecureModeNeeded() } /** - * Set secureModeNeeded + * Set secureModeNeeded. * * @param string $secureModeNeeded * @@ -394,8 +419,9 @@ public function setSecureModeNeeded($secureModeNeeded) return $this; } + /** - * Get secureModeRedirectURL + * Get secureModeRedirectURL. * * @return string */ @@ -405,7 +431,7 @@ public function getSecureModeRedirectURL() } /** - * Set secureModeRedirectURL + * Set secureModeRedirectURL. * * @param string $secureModeRedirectURL * @@ -417,8 +443,9 @@ public function setSecureModeRedirectURL($secureModeRedirectURL) return $this; } + /** - * Get secureModeReturnURL + * Get secureModeReturnURL. * * @return string */ @@ -428,7 +455,7 @@ public function getSecureModeReturnURL() } /** - * Set secureModeReturnURL + * Set secureModeReturnURL. * * @param string $secureModeReturnURL * @@ -440,8 +467,9 @@ public function setSecureModeReturnURL($secureModeReturnURL) return $this; } + /** - * Get expirationDate + * Get expirationDate. * * @return string */ @@ -451,7 +479,7 @@ public function getExpirationDate() } /** - * Set expirationDate + * Set expirationDate. * * @param string $expirationDate * @@ -463,8 +491,9 @@ public function setExpirationDate($expirationDate) return $this; } + /** - * Get authorizationDate + * Get authorizationDate. * * @return string */ @@ -474,7 +503,7 @@ public function getAuthorizationDate() } /** - * Set authorizationDate + * Set authorizationDate. * * @param string $authorizationDate * @@ -486,8 +515,9 @@ public function setAuthorizationDate($authorizationDate) return $this; } + /** - * Get paymentType + * Get paymentType. * * @return string */ @@ -497,7 +527,7 @@ public function getPaymentType() } /** - * Set paymentType + * Set paymentType. * * @param string $paymentType * @@ -509,8 +539,9 @@ public function setPaymentType($paymentType) return $this; } + /** - * Get payInId + * Get payInId. * * @return string */ @@ -520,7 +551,7 @@ public function getPayInId() } /** - * Set payInId + * Set payInId. * * @param string $payInId * @@ -534,7 +565,7 @@ public function setPayInId($payInId) } /** - * Get mangoId + * Get mangoId. * * @return string */ @@ -544,7 +575,7 @@ public function getMangoId() } /** - * Set mangoId + * Set mangoId. * * @param string $mangoId * @@ -556,8 +587,9 @@ public function setMangoId($mangoId) return $this; } + /** - * Get tag + * Get tag. * * @return string */ @@ -567,7 +599,7 @@ public function getTag() } /** - * Set tag + * Set tag. * * @param string $tag * @@ -579,8 +611,9 @@ public function setTag($tag) return $this; } + /** - * Get creationDate + * Get creationDate. * * @return string */ @@ -590,7 +623,7 @@ public function getCreationDate() } /** - * Set creationDate + * Set creationDate. * * @param string $creationDate * @@ -602,5 +635,4 @@ public function setCreationDate($creationDate) return $this; } - } diff --git a/Entity/Order.php b/Entity/Order.php index e13c95d..04dce56 100644 --- a/Entity/Order.php +++ b/Entity/Order.php @@ -6,7 +6,7 @@ use Gedmo\Timestampable\Traits\TimestampableEntity; /** - * Order + * Order. * * @ORM\MappedSuperclass */ @@ -14,32 +14,32 @@ class Order { use TimestampableEntity; /** - * The offer was rejected + * The offer was rejected. */ - const STATUS_CANCELED = 'canceled'; + const STATUS_CANCELED = 'canceled'; /** - * The buyer has not paied yet + * The buyer has not paied yet. */ const STATUS_WAITING_FOR_PAYMENT = 'waiting'; /** - * The seller has not accepted or rejected the offer + * The seller has not accepted or rejected the offer. */ - const STATUS_PENDING = 'pending'; + const STATUS_PENDING = 'pending'; /** - * The seller has accepted the order + * The seller has accepted the order. */ - const STATUS_VALIDATED = 'validated'; + const STATUS_VALIDATED = 'validated'; /** - * The seller has paied the order + * The seller has paied the order. */ - const STATUS_PAID = 'paid'; + const STATUS_PAID = 'paid'; /** - * The seller has paied the order + * The seller has paied the order. */ const STATUS_WAITING_MANGOPAY_VALIDATION = 'waiting_mangopay_validation'; /** - * @var integer + * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id @@ -69,7 +69,7 @@ class Order protected $mangoPrice; /** - * Constructor + * Constructor. */ public function __construct() { @@ -77,9 +77,9 @@ public function __construct() } /** - * Get id + * Get id. * - * @return integer + * @return int */ public function getId() { @@ -87,7 +87,7 @@ public function getId() } /** - * Set status + * Set status. * * @param string $status * @@ -101,7 +101,7 @@ public function setStatus($status) } /** - * Get status + * Get status. * * @return string */ @@ -111,9 +111,9 @@ public function getStatus() } /** - * Set payinTransaction + * Set payinTransaction. * - * @param integer $payinTransaction + * @param int $payinTransaction * * @return Order */ @@ -125,9 +125,9 @@ public function setPayinTransaction($payinTransaction) } /** - * Get payinTransaction + * Get payinTransaction. * - * @return integer + * @return int */ public function getPayinTransaction() { @@ -135,7 +135,7 @@ public function getPayinTransaction() } /** - * Get mangoPrice + * Get mangoPrice. * * @return string */ @@ -145,7 +145,7 @@ public function getMangoPrice() } /** - * Set mangoPrice + * Set mangoPrice. * * @param string $mangoPrice * @@ -157,5 +157,4 @@ public function setMangoPrice($mangoPrice) return $this; } - } diff --git a/Entity/Transaction.php b/Entity/Transaction.php index b76bde2..7e904b1 100644 --- a/Entity/Transaction.php +++ b/Entity/Transaction.php @@ -6,7 +6,7 @@ use Gedmo\Timestampable\Traits\TimestampableEntity; /** - * Transaction + * Transaction. * * @ORM\MappedSuperclass * @ORM\Entity @@ -16,7 +16,7 @@ class Transaction implements TransactionInterface use TimestampableEntity; /** - * @var integer + * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id @@ -25,100 +25,113 @@ class Transaction implements TransactionInterface protected $id; /** - * Author Id + * Author Id. + * * @var int * @ORM\Column(name="authorId", type="integer") */ protected $authorId; /** - * Credited user Id + * Credited user Id. + * * @var int * @ORM\Column(name="creditedUserId", type="integer") */ protected $creditedUserId; /** - * Credited wallet Id + * Credited wallet Id. + * * @var int * @ORM\Column(name="creditedWalletId", type="integer") */ protected $creditedWalletId; /** - * Debited funds + * Debited funds. + * * @var \MangoPay\Money * @ORM\Column(name="debitedFunds", type="integer") */ protected $debitedFunds; /** - * Credited funds + * Credited funds. + * * @var \MangoPay\Money * @ORM\Column(name="creditedFunds", type="integer") */ protected $creditedFunds; /** - * Fees + * Fees. + * * @var \MangoPay\Money * @ORM\Column(name="fees", type="integer") */ protected $fees; /** - * TransactionStatus {CREATED, SUCCEEDED, FAILED} + * TransactionStatus {CREATED, SUCCEEDED, FAILED}. + * * @var string * @ORM\Column(name="status", type="string", length=255) */ protected $status; /** - * Result code + * Result code. + * * @var string * @ORM\Column(name="resultCode", type="integer") */ protected $resultCode; /** - * The PreAuthorization result Message explaining the result code + * The PreAuthorization result Message explaining the result code. + * * @var string * @ORM\Column(name="resultMessage", type="string", length=255) */ protected $resultMessage; /** - * Execution date; + * Execution date;. + * * @var \DateTime * @ORM\Column(name="executionDate", type="datetime") */ protected $executionDate; /** - * TransactionType {PAYIN, PAYOUT, TRANSFER} + * TransactionType {PAYIN, PAYOUT, TRANSFER}. + * * @var string * @ORM\Column(name="type", type="string", length=255) */ protected $type; /** - * TransactionNature { REGULAR, REFUND, REPUDIATION } + * TransactionNature { REGULAR, REFUND, REPUDIATION }. + * * @var string * @ORM\Column(name="nature", type="string", length=255) */ protected $nature; /** - * CardType { CB_VISA_MASTERCARD, MAESTRO, DINERS, P24″, MASTERPASS } + * CardType { CB_VISA_MASTERCARD, MAESTRO, DINERS, P24″, MASTERPASS }. + * * @var string * @ORM\Column(name="cardType", type="string", length=255) */ protected $cardType; /** - * Get id + * Get id. * - * @return integer + * @return int */ protected function getId() { @@ -126,7 +139,7 @@ protected function getId() } /** - * Get authorId + * Get authorId. * * @return string */ @@ -136,7 +149,7 @@ public function getAuthorId() } /** - * Set authorId + * Set authorId. * * @param string $authorId * @@ -150,7 +163,7 @@ public function setAuthorId($authorId) } /** - * Get creditedUserId + * Get creditedUserId. * * @return string */ @@ -160,7 +173,7 @@ public function getCreditedUserId() } /** - * Set creditedUserId + * Set creditedUserId. * * @param string $creditedUserId * @@ -174,7 +187,7 @@ public function setCreditedUserId($creditedUserId) } /** - * Get creditedWalletId + * Get creditedWalletId. * * @return string */ @@ -184,7 +197,7 @@ public function getCreditedWalletId() } /** - * Set creditedUserId + * Set creditedUserId. * * @param string $creditedWalletId * @@ -198,7 +211,7 @@ public function setCreditedWalletId($creditedWalletId) } /** - * Get debitedFunds + * Get debitedFunds. * * @return string */ @@ -208,7 +221,7 @@ public function getDebitedFunds() } /** - * Set debitedFunds + * Set debitedFunds. * * @param string $debitedFunds * @@ -222,7 +235,7 @@ public function setDebitedFunds($debitedFunds) } /** - * Get creditedFunds + * Get creditedFunds. * * @return string */ @@ -232,7 +245,7 @@ public function getCreditedFunds() } /** - * Set creditedFunds + * Set creditedFunds. * * @param string $creditedFunds * @@ -246,7 +259,7 @@ public function setCreditedFunds($creditedFunds) } /** - * Get fees + * Get fees. * * @return string */ @@ -256,7 +269,7 @@ public function getFees() } /** - * Set fees + * Set fees. * * @param string $fees * @@ -270,7 +283,7 @@ public function setFees($fees) } /** - * Get status + * Get status. * * @return string */ @@ -280,7 +293,7 @@ public function getStatus() } /** - * Set status + * Set status. * * @param string $status * @@ -294,7 +307,7 @@ public function setStatus($status) } /** - * Get resultCode + * Get resultCode. * * @return string */ @@ -304,7 +317,7 @@ public function getResultCode() } /** - * Set resultCode + * Set resultCode. * * @param string $resultCode * @@ -318,7 +331,7 @@ public function setResultCode($resultCode) } /** - * Get resultMessage + * Get resultMessage. * * @return string */ @@ -328,7 +341,7 @@ public function getResultMessage() } /** - * Set resultMessage + * Set resultMessage. * * @param string $resultMessage * @@ -342,7 +355,7 @@ public function setResultMessage($resultMessage) } /** - * Get executionDate + * Get executionDate. * * @return string */ @@ -352,7 +365,7 @@ public function getExecutionDate() } /** - * Set executionDate + * Set executionDate. * * @param string $executionDate * @@ -366,7 +379,7 @@ public function setExecutionDate($executionDate) } /** - * Get type + * Get type. * * @return string */ @@ -376,7 +389,7 @@ public function getType() } /** - * Set type + * Set type. * * @param string $type * @@ -390,7 +403,7 @@ public function setType($type) } /** - * Get nature + * Get nature. * * @return string */ @@ -400,7 +413,7 @@ public function getNature() } /** - * Set nature + * Set nature. * * @param string $nature * @@ -414,7 +427,7 @@ public function setNature($nature) } /** - * Get card type + * Get card type. * * @return string */ @@ -424,7 +437,7 @@ public function getCardType() } /** - * Set card type + * Set card type. * * @param string $cardType * diff --git a/Entity/TransactionInterface.php b/Entity/TransactionInterface.php index 18b0515..61fd23a 100644 --- a/Entity/TransactionInterface.php +++ b/Entity/TransactionInterface.php @@ -4,43 +4,43 @@ /** * Defines mandatory methods a Transaction need to be used in Mango - * https://docs.mangopay.com/api-references/users/natural-users/ + * https://docs.mangopay.com/api-references/users/natural-users/. */ interface TransactionInterface { /** - * Author Id + * Author Id. + * * @var string */ public function getAuthorId(); /** * It represents the amount debited on the bank account of the Author. In cents so 100€ will be written like « Amount » : 10000 - * DebitedFunds – Fees = CreditedFunds (amount received on wallet) + * DebitedFunds – Fees = CreditedFunds (amount received on wallet). * * @var string */ public function getDebitedFunds(); /** - * It represents your fees taken on the DebitedFunds.In cents so 100€ will be written like « Amount » : 10000 + * It represents your fees taken on the DebitedFunds.In cents so 100€ will be written like « Amount » : 10000. * - * @var integer + * @var int */ public function getFees(); /** - * The Mango ID of the credited wallet + * The Mango ID of the credited wallet. * - * @var integer + * @var int */ public function getCreditedWalletId(); /** - * URL Format expected + * URL Format expected. * - * @var integer + * @var int */ public function getCardType(); - } diff --git a/Entity/UserInterface.php b/Entity/UserInterface.php index f0c758a..9547dd7 100644 --- a/Entity/UserInterface.php +++ b/Entity/UserInterface.php @@ -4,54 +4,53 @@ /** * Defines mandatory methods a Mango user should have - * https://docs.mangopay.com/api-references/users/natural-users/ + * https://docs.mangopay.com/api-references/users/natural-users/. */ interface UserInterface { /** - * @var integer + * @var int */ public function getMangoUserId(); /** - * @var integer + * @var int */ public function getMangoWalletId(); /** * @var string - * User’s e-mail. A correct email address is expected + * User’s e-mail. A correct email address is expected */ public function getEmail(); /** * @var string - * User’s firstname (<100 chars) + * User’s firstname (<100 chars) */ public function getFirstname(); /** * @var string - * User’s lastname (<100 chars) + * User’s lastname (<100 chars) */ public function getLastname(); /** * @var date - * User’s birthdate. A Timestamp is expected + * User’s birthdate. A Timestamp is expected */ public function getBirthDate(); /** * @var string - * User’s Nationality. ISO 3166-1 alpha-2 format is expected + * User’s Nationality. ISO 3166-1 alpha-2 format is expected */ public function getNationality(); /** * @var string - * User’s country of residence. ISO 3166-1 alpha-2 format is expected + * User’s country of residence. ISO 3166-1 alpha-2 format is expected */ public function getCountry(); - } diff --git a/Event/CardRegistrationEvent.php b/Event/CardRegistrationEvent.php index efcf252..71fec28 100644 --- a/Event/CardRegistrationEvent.php +++ b/Event/CardRegistrationEvent.php @@ -15,7 +15,7 @@ public function __construct(CardRegistration $cardRegistration) } /** - * Get cardRegistration + * Get cardRegistration. * * @return string */ @@ -25,7 +25,7 @@ public function getCardRegistration() } /** - * Set cardRegistration + * Set cardRegistration. * * @param string $cardRegistration * diff --git a/Event/OrderEvent.php b/Event/OrderEvent.php index 5034624..42150cd 100644 --- a/Event/OrderEvent.php +++ b/Event/OrderEvent.php @@ -2,8 +2,8 @@ namespace Troopers\MangopayBundle\Event; -use Troopers\MangopayBundle\Entity\Order; use Symfony\Component\EventDispatcher\Event; +use Troopers\MangopayBundle\Entity\Order; class OrderEvent extends Event { @@ -22,6 +22,7 @@ public function getOrder() public function setOrder(Order $order) { $this->order = $order; + return $this; } } diff --git a/Event/PayInEvent.php b/Event/PayInEvent.php index 967ccb8..ffeffa3 100644 --- a/Event/PayInEvent.php +++ b/Event/PayInEvent.php @@ -16,7 +16,7 @@ public function __construct(PayIn $payIn) } /** - * Get payin + * Get payin. * * @return string */ @@ -26,7 +26,7 @@ public function getPayin() } /** - * Set payin + * Set payin. * * @param string $payin * diff --git a/Event/PreAuthorisationEvent.php b/Event/PreAuthorisationEvent.php index 5671849..cf664cd 100644 --- a/Event/PreAuthorisationEvent.php +++ b/Event/PreAuthorisationEvent.php @@ -2,9 +2,9 @@ namespace Troopers\MangopayBundle\Event; -use Troopers\MangopayBundle\Entity\Order; use MangoPay\CardPreAuthorization; use Symfony\Component\EventDispatcher\Event; +use Troopers\MangopayBundle\Entity\Order; class PreAuthorisationEvent extends Event { @@ -18,7 +18,7 @@ public function __construct(Order $order, CardPreAuthorization $preAuth) } /** - * Get order + * Get order. * * @return Order */ @@ -28,7 +28,7 @@ public function getOrder() } /** - * Set order + * Set order. * * @param string $order * @@ -40,8 +40,9 @@ public function setOrder($order) return $this; } + /** - * Get preAuth + * Get preAuth. * * @return string */ @@ -51,7 +52,7 @@ public function getPreAuth() } /** - * Set preAuth + * Set preAuth. * * @param string $preAuth * diff --git a/Event/UserEvent.php b/Event/UserEvent.php index c34422e..0f353ba 100644 --- a/Event/UserEvent.php +++ b/Event/UserEvent.php @@ -2,9 +2,9 @@ namespace Troopers\MangopayBundle\Event; -use Troopers\MangopayBundle\Entity\UserInterface; use MangoPay\User; use Symfony\Component\EventDispatcher\Event; +use Troopers\MangopayBundle\Entity\UserInterface; class UserEvent extends Event { @@ -18,7 +18,7 @@ public function __construct(UserInterface $user, User $mangoUser) } /** - * Get user + * Get user. * * @return string */ @@ -28,7 +28,7 @@ public function getUser() } /** - * Set user + * Set user. * * @param string $user * @@ -42,7 +42,7 @@ public function setUser($user) } /** - * Get mangoUser + * Get mangoUser. * * @return string */ @@ -52,7 +52,7 @@ public function getMangoUser() } /** - * Set mangoUser + * Set mangoUser. * * @param string $mangoUser * diff --git a/Event/WalletEvent.php b/Event/WalletEvent.php index 7f13958..18f73e2 100644 --- a/Event/WalletEvent.php +++ b/Event/WalletEvent.php @@ -2,9 +2,9 @@ namespace Troopers\MangopayBundle\Event; -use Troopers\MangopayBundle\Entity\UserInterface; use MangoPay\Wallet; use Symfony\Component\EventDispatcher\Event; +use Troopers\MangopayBundle\Entity\UserInterface; class WalletEvent extends Event { @@ -18,7 +18,7 @@ public function __construct(Wallet $wallet, UserInterface $user) } /** - * Get wallet + * Get wallet. * * @return string */ @@ -28,7 +28,7 @@ public function getWallet() } /** - * Set wallet + * Set wallet. * * @param string $wallet * @@ -42,7 +42,7 @@ public function setWallet($wallet) } /** - * Get user + * Get user. * * @return string */ @@ -52,7 +52,7 @@ public function getUser() } /** - * Set user + * Set user. * * @param string $user * diff --git a/Exception/MangopayExceptionInterface.php b/Exception/MangopayExceptionInterface.php index 02dfc28..db362cf 100644 --- a/Exception/MangopayExceptionInterface.php +++ b/Exception/MangopayExceptionInterface.php @@ -4,5 +4,4 @@ interface MangopayExceptionInterface { - } diff --git a/Exception/MangopayPayInCreationException.php b/Exception/MangopayPayInCreationException.php index 13198fb..361c382 100644 --- a/Exception/MangopayPayInCreationException.php +++ b/Exception/MangopayPayInCreationException.php @@ -4,5 +4,4 @@ class MangopayPayInCreationException extends \Exception implements MangopayExceptionInterface { - } diff --git a/Form/CardType.php b/Form/CardType.php index c451fcc..112998d 100644 --- a/Form/CardType.php +++ b/Form/CardType.php @@ -11,7 +11,6 @@ class CardType extends AbstractType { - /** * @param FormBuilderInterface $builder * @param array $options @@ -19,66 +18,66 @@ class CardType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('cardNumber', TextType::class, array( - 'constraints' => array(new NotBlank(['groups' => ['card']])), - 'label' => 'troopers_mangopay.card_number.label', - 'attr' => array( - 'data-id' => 'troopers_mangopay_card_number', + ->add('cardNumber', TextType::class, [ + 'constraints' => [new NotBlank(['groups' => ['card']])], + 'label' => 'troopers_mangopay.card_number.label', + 'attr' => [ + 'data-id' => 'troopers_mangopay_card_number', 'placeholder' => 'troopers_mangopay.card_number.placeholder', - ), - 'mapped' => false - )) - ->add('cardHolder', TextType::class, array( - 'constraints' => array(new NotBlank(['groups' => ['card']])), - 'label' => 'troopers_mangopay.card_holder.label', - 'attr' => array( - 'data-id' => 'troopers_mangopay_card_holder', + ], + 'mapped' => false, + ]) + ->add('cardHolder', TextType::class, [ + 'constraints' => [new NotBlank(['groups' => ['card']])], + 'label' => 'troopers_mangopay.card_holder.label', + 'attr' => [ + 'data-id' => 'troopers_mangopay_card_holder', 'placeholder' => 'troopers_mangopay.card_holder.placeholder', - ), - 'mapped' => false - )) - ->add('ccv', IntegerType::class, array( - 'constraints' => array(new NotBlank(['groups' => ['card']])), - 'label' => 'troopers_mangopay.card_ccv.label', - 'attr' => array( - 'data-id' => 'troopers_mangopay_ccv', + ], + 'mapped' => false, + ]) + ->add('ccv', IntegerType::class, [ + 'constraints' => [new NotBlank(['groups' => ['card']])], + 'label' => 'troopers_mangopay.card_ccv.label', + 'attr' => [ + 'data-id' => 'troopers_mangopay_ccv', 'placeholder' => 'troopers_mangopay.ccv.placeholder', - ), - 'mapped' => false - )) - ->add('cardExpiryMonth', ChoiceType::class, array( - 'constraints' => array(new NotBlank(['groups' => ['card']])), - 'label' => 'troopers_mangopay.card_expiry_month.label', - 'choices' => ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"], + ], + 'mapped' => false, + ]) + ->add('cardExpiryMonth', ChoiceType::class, [ + 'constraints' => [new NotBlank(['groups' => ['card']])], + 'label' => 'troopers_mangopay.card_expiry_month.label', + 'choices' => ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'], 'choices_as_values' => true, - 'attr' => array( - 'data-id' => 'troopers_mangopay_card_expiry_month', + 'attr' => [ + 'data-id' => 'troopers_mangopay_card_expiry_month', 'placeholder' => 'troopers_mangopay.card_expiry_month.placeholder', - ), - 'mapped' => false - )); + ], + 'mapped' => false, + ]); - $years = array(); - $range = range(date('y'), date('y')+15); - foreach ($range as $year) { - $year = str_pad($year, 2, "0", STR_PAD_LEFT); - $years[$year] = $year; - $year = (int) $year + 1; - } + $years = []; + $range = range(date('y'), date('y') + 15); + foreach ($range as $year) { + $year = str_pad($year, 2, '0', STR_PAD_LEFT); + $years[$year] = $year; + $year = (int) $year + 1; + } - $builder->add('cardExpiryYear', ChoiceType::class, array( - 'constraints' => array(new NotBlank(['groups' => ['card']])), - 'choices' => $years, + $builder->add('cardExpiryYear', ChoiceType::class, [ + 'constraints' => [new NotBlank(['groups' => ['card']])], + 'choices' => $years, 'choices_as_values' => true, - 'attr' => array( - 'data-id' => 'troopers_mangopay_card_expiry_year', + 'attr' => [ + 'data-id' => 'troopers_mangopay_card_expiry_year', 'placeholder' => 'troopers_mangopay.card_expiry_year.placeholder', - ), - 'mapped' => false - )) + ], + 'mapped' => false, + ]) // - ; +; } /** diff --git a/Helper/BankInformationHelper.php b/Helper/BankInformationHelper.php index a90f3e4..9752512 100644 --- a/Helper/BankInformationHelper.php +++ b/Helper/BankInformationHelper.php @@ -1,21 +1,14 @@ userHelper->findOrCreateMangoUser($bankInformation->getUser()); //Create mango bank account $bankAccount = new BankAccount(); - $bankAccount->OwnerName = $bankInformation->getUser()->getFullName(); - $bankAccount->UserId = $mangoUser->Id; - $bankAccount->Type = "IBAN"; + $bankAccount->OwnerName = $bankInformation->getUser()->getFullName(); + $bankAccount->UserId = $mangoUser->Id; + $bankAccount->Type = 'IBAN'; $bankAccount->OwnerAddress = $bankInformation->getAddress(); $bankAccountDetailsIban = new BankAccountDetailsIBAN(); @@ -65,5 +58,4 @@ public function createBankAccount(BankInformationInterface $bankInformation) return $bankAccount; } - } diff --git a/Helper/BankwireHelper.php b/Helper/BankwireHelper.php index 7f38617..3d763a0 100644 --- a/Helper/BankwireHelper.php +++ b/Helper/BankwireHelper.php @@ -1,4 +1,5 @@ dispatcher = $dispatcher; $this->entityManager = $entityManager; } - - } diff --git a/Helper/PaymentDirectHelper.php b/Helper/PaymentDirectHelper.php index a0a40bd..e7b605c 100644 --- a/Helper/PaymentDirectHelper.php +++ b/Helper/PaymentDirectHelper.php @@ -1,16 +1,15 @@ Currency = "EUR"; + $debitedFunds->Currency = 'EUR'; $debitedFunds->Amount = $transaction->getDebitedFunds(); $fees = new Money(); - $fees->Currency = "EUR"; + $fees->Currency = 'EUR'; $fees->Amount = $transaction->getFees(); $payIn = new PayIn(); @@ -47,7 +45,7 @@ public function createDirectTransaction(TransactionInterface $transaction, $exec $payIn->Type = 'PAYIN'; $payIn->PaymentDetails = new \MangoPay\PayInPaymentDetailsCard(); - $payIn->PaymentDetails->CardType = "CB_VISA_MASTERCARD"; + $payIn->PaymentDetails->CardType = 'CB_VISA_MASTERCARD'; //@TODO : Find a better way to send default to this function to set default if (!$executionDetails instanceof \MangoPay\PayInExecutionDetails) { @@ -68,5 +66,4 @@ public function createDirectTransaction(TransactionInterface $transaction, $exec return $mangoPayTransaction; } - } diff --git a/Helper/PaymentHelper.php b/Helper/PaymentHelper.php index d50366a..e5849fb 100644 --- a/Helper/PaymentHelper.php +++ b/Helper/PaymentHelper.php @@ -2,14 +2,6 @@ namespace Troopers\MangopayBundle\Helper; -use Troopers\MangopayBundle\TroopersMangopayEvents; -use Troopers\MangopayBundle\Entity\CardPreAuthorisation; -use Troopers\MangopayBundle\Entity\Order; -use Troopers\MangopayBundle\Entity\UserInterface; -use Troopers\MangopayBundle\Event\CardRegistrationEvent; -use Troopers\MangopayBundle\Event\PayInEvent; -use Troopers\MangopayBundle\Event\PreAuthorisationEvent; -use Troopers\MangopayBundle\Exception\MangopayPayInCreationException; use MangoPay\CardPreAuthorization; use MangoPay\CardRegistration; use MangoPay\Money; @@ -21,6 +13,14 @@ use Symfony\Bundle\FrameworkBundle\Routing\Router; use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\Translation\TranslatorInterface; +use Troopers\MangopayBundle\Entity\CardPreAuthorisation; +use Troopers\MangopayBundle\Entity\Order; +use Troopers\MangopayBundle\Entity\UserInterface; +use Troopers\MangopayBundle\Event\CardRegistrationEvent; +use Troopers\MangopayBundle\Event\PayInEvent; +use Troopers\MangopayBundle\Event\PreAuthorisationEvent; +use Troopers\MangopayBundle\Exception\MangopayPayInCreationException; +use Troopers\MangopayBundle\TroopersMangopayEvents; /** * ref: troopers_mangopay.payment_helper. diff --git a/Helper/UserHelper.php b/Helper/UserHelper.php index c38d1a6..11abb64 100644 --- a/Helper/UserHelper.php +++ b/Helper/UserHelper.php @@ -1,18 +1,16 @@ Email = $user->getEmail(); $mangoUser->FirstName = $user->getFirstname(); @@ -61,5 +59,4 @@ public function createMangoUser(UserInterface $user) return $mangoUser; } - } diff --git a/Helper/WalletHelper.php b/Helper/WalletHelper.php index 8dbf048..8a20b20 100644 --- a/Helper/WalletHelper.php +++ b/Helper/WalletHelper.php @@ -1,17 +1,16 @@ getMangoWalletId()) { $wallet = $this->mangopayHelper->Wallets->get($user->getMangoWalletId()); // else, create a new mango user @@ -50,8 +49,8 @@ public function createWalletForUser(UserInterface $user, $description = 'current { $mangoUser = $this->userHelper->findOrCreateMangoUser($user); $mangoWallet = new Wallet(); - $mangoWallet->Owners = array($mangoUser->Id); - $mangoWallet->Currency = "EUR"; + $mangoWallet->Owners = [$mangoUser->Id]; + $mangoWallet->Currency = 'EUR'; $mangoWallet->Description = $description; $mangoWallet = $this->mangopayHelper->Wallets->create($mangoWallet); @@ -61,5 +60,4 @@ public function createWalletForUser(UserInterface $user, $description = 'current return $mangoWallet; } - } diff --git a/OrderEvents.php b/OrderEvents.php index 871a006..d56ce2b 100644 --- a/OrderEvents.php +++ b/OrderEvents.php @@ -5,10 +5,9 @@ final class OrderEvents { /** - * Event order.created occur when an order is created + * Event order.created occur when an order is created. * * @var string */ const ORDER_CREATED = 'order.created'; - } diff --git a/TroopersMangopayEvents.php b/TroopersMangopayEvents.php index 885663d..9a15a7f 100644 --- a/TroopersMangopayEvents.php +++ b/TroopersMangopayEvents.php @@ -4,49 +4,48 @@ final class TroopersMangopayEvents { - /** - * The NEW_USER event occurs when a user is created + * The NEW_USER event occurs when a user is created. */ const NEW_USER = 'Troopers_mangopay.user.new'; /** - * The NEW_WALLET event occurs when a wallet is created + * The NEW_WALLET event occurs when a wallet is created. */ const NEW_WALLET = 'Troopers_mangopay.wallet.new'; /** - * The NEW_CARD_PREAUTHORISATION event occurs when a card preauthorisation is created + * The NEW_CARD_PREAUTHORISATION event occurs when a card preauthorisation is created. */ const NEW_CARD_PREAUTHORISATION = 'Troopers_mangopay.card.preauthorisation.new'; /** - * The UPDATE_CARD_PREAUTHORISATION event occurs when a card preauthorisation is updated + * The UPDATE_CARD_PREAUTHORISATION event occurs when a card preauthorisation is updated. */ const UPDATE_CARD_PREAUTHORISATION = 'Troopers_mangopay.card.preauthorisation.update'; /** - * The CANCEL_CARD_PREAUTHORISATION event occurs when a card preauthorisation is canceled + * The CANCEL_CARD_PREAUTHORISATION event occurs when a card preauthorisation is canceled. */ const CANCEL_CARD_PREAUTHORISATION = 'Troopers_mangopay.card.preauthorisation.cancel'; /** - * The NEW_CARD_REGISTRATION event occurs when a card registration is created + * The NEW_CARD_REGISTRATION event occurs when a card registration is created. */ const NEW_CARD_REGISTRATION = 'Troopers_mangopay.card.registration.new'; /** - * The UPDATE_CARD_REGISTRATION event occurs when a card registration is updated + * The UPDATE_CARD_REGISTRATION event occurs when a card registration is updated. */ const UPDATE_CARD_REGISTRATION = 'Troopers_mangopay.card.registration.update'; /** - * The NEW_PAY_IN event occurs when a apyin is created + * The NEW_PAY_IN event occurs when a apyin is created. */ const NEW_PAY_IN = 'Troopers_mangopay.pay_in.new'; /** - * The ERROR_PAY_IN event occurs when a apyin is errored + * The ERROR_PAY_IN event occurs when a apyin is errored. */ const ERROR_PAY_IN = 'Troopers_mangopay.pay_in.error'; }