PHPackages                             fei/payment-common - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. fei/payment-common

ActiveLibrary[Payment Processing](/categories/payments)

fei/payment-common
==================

Payment - common components

v2.6.0(7y ago)020.7k[4 PRs](https://github.com/flash-global/payment-common/pulls)1PHPPHP &gt;=7.0

Since May 23Pushed 3y ago22 watchersCompare

[ Source](https://github.com/flash-global/payment-common)[ Packagist](https://packagist.org/packages/fei/payment-common)[ RSS](/packages/fei-payment-common/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (9)Versions (31)Used By (1)

Service Payment - Common
========================

[](#service-payment---common)

[![GitHub release](https://camo.githubusercontent.com/dd04ac8378393a944f700bb4d7f60f93d9901be71391891786c5530101cb668c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f666c6173682d676c6f62616c2f7061796d656e742d636f6d6d6f6e2e7376673f7374796c653d666f722d7468652d6261646765)](README.md)

Table of contents
-----------------

[](#table-of-contents)

- [Entities](#entities)
- [Validators](#validators)
- [Contribution](#contribution)

Entities
--------

[](#entities)

### Payment entity

[](#payment-entity)

In addition to traditional `id` and `createdAt` fields, Payment entity has eleven important properties:

PropertiesTypeid`integer`uuid`string`createdAt`datetime`payedAt`datetime`expirationDate`datetime`status`integer`cancellationReason`string`requiredPrice`float`capturedPrice`float`authorizedPayment`integer`selectedPayment`integer`contexts`ArrayCollection`callbackUrl`ArrayCollection`- `uuid` is a string representing a unique identifier of the payment entity
- `createdAt` represent the creation date
- `payedAt` represent the date when the payment has been made
- `expirationDate` represent the date when the payment expires
- `status` indicate in which status the payment currently is
- `cancellationReason` is a string representing the reason of the cancellation of the payment
- `requiredPrice` is a float representing the price required
- `capturedPrice` is a float representing the price captured
- `authorizedPayment` is an int that represent the list of the payment authorised (used like binary flags)
- `selectedPayment` is an integer representing the payment method that has been chosen
- `contexts` is an ArrayCollection of all the contexts for the entity
- `callbackUrl` is an array of callbacks url that will be used is some events in the application (when the payment is saved for example). Here are the possible value and purpose of the callback url:
    - `succeeded` : the url that will be called when an payment authorization successes
    - `failed` : the url that will be called when an payment authorization failed
    - `cancelled` : the url that will be called when an payment is cancelled

### Context entity

[](#context-entity)

In addition to traditional `id` field, Context entity has three important properties:

PropertiesTypeid`integer`key`string`value`string`payment`Payment`- `key` is a string representing the key of the context
- `value` is a string representing the value attach to this context
- `payment` is a Payment entity representing the Payment related to this context

Validators
----------

[](#validators)

You have the possibility to validate a `Payment` entity with `PaymentValidator` class:

```
