eonx-com / eoneopay-phpsdk
PHP SDK for interacting with the eoneopay
Requires
- php: >=7.1
- ext-json: *
- eonx-com/sdkblueprint: ^1.0
- eonx-com/utils: ^1.0
- symfony/validator: ^4.2
Requires (Dev)
- eonx-com/standards: ^0.2
- friendsofphp/php-cs-fixer: ^2.9
- indigophp/doctrine-annotation-autoload: ^0.1.0
- laravel/lumen-framework: ^5.5
- phpmd/phpmd: ^2.6
- phpstan/phpstan: ^0.11
- phpstan/phpstan-phpunit: ^0.11
- phpstan/phpstan-strict-rules: ^0.11
- phpunit/phpunit: ^7.0
- roave/security-advisories: dev-master
- sebastian/phpcpd: ^4.0
- squizlabs/php_codesniffer: 3.*
- vlucas/phpdotenv: ^3.3
Suggests
- laravel/framework: ^5.5
- laravel/lumen-framework: ^5.5
- sensiolabs/security-checker: Check project's dependencies for known vulnerabilities
- vlucas/phpdotenv: When using the lumen bridge, phpdotenv is required
- dev-master
- v1.0.8
- v1.0.7
- v1.0.6
- v1.0.5
- v1.0.4
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v1.0.0-RC7
- v1.0.0-RC6
- v1.0.0-RC5
- v1.0.0-RC4
- v1.0.0-RC3
- v1.0.0-RC2
- v1.0.0-RC1
- v1.0.0-beta17
- v1.0.0-beta16
- v1.0.0-beta15
- v1.0.0-beta14
- v1.0.0-beta13
- v1.0.0-beta12
- v1.0.0-beta11
- v1.0.0-beta10
- v1.0.0-beta9
- v1.0.0-beta8
- v1.0.0-beta7
- v1.0.0-beta6
- v1.0.0-beta5
- v1.0.0-beta4
- v1.0.0-beta3
- v1.0.0-beta2
- v1.0.0-beta1
- dev-bugfix/PYMT-1594-add-credit-card-cvc
- dev-bugfix/PYMT-1594-missing-cvc
- dev-feature/fix-amount-missing-fees
- dev-development
- dev-feature/fix-token-missing-calculate-fees
- dev-feature/transaction-allocation-fix-tests
- dev-feature/transaction-allocation-allow-null
- dev-feature/PYMT-1424-float-loc-controller
- dev-fix/PYMT-1052-optional-approved-property
This package is auto-updated.
Last update: 2019-12-09 01:03:54 UTC
README
Transactions
The status of the transaction can be determined using the state property. There are situations where a transaction can be approved or completed but reversed at a later time. The state property is the only way to determine the actual state of the transaction. A table listing the meaning of each of the state field values is below.
Value | State | Description |
---|---|---|
1 | Pending | Request received, pending processing |
2 | Processing | Request is being processed |
10 | Provisionally approved | May be reversed, but funds could be available after clearing |
11 | Approved | Funds will be available after clearing |
90 | Failed/reversed/declined | Funds could not be transferred, and are not available |
80 | Finalised/cleared | Funds have transferred to destination are available |
Development
Main repository: https://github.com/loyaltycorp/eoneopay-phpsdk
Adding Entities
Entities are the class types the SDK exposes for serialising before sending to payments in JSON form, and the class type the responses are de-serialised to on response.
Entities are in the src/Endpoints
directory, under the EoneoPay\PhpSdk\Endpoints
namespace.
URIS
URIs list the acceptable actions that can be performed against with a given entity. These can be accessed
programmatically by calling the uris()
method on an entity instance.
Entity Serialisation / @Groups
The @Groups
annotation indicates the which fields which will be serialised before being sent as JSON. The
annotation uses Symfony\Component\Serializer\Annotation\Groups
.
In the following example, the $actionUrl
would be serialised when being sent to payments for both create
and
update
calls, but $amount
will only be sent for the initial create
call.
use Symfony\Component\Serializer\Annotation\Groups; trait SecurityTrait { /** * @Groups({"create", "update"}) */ protected $actionUrl; /** * @Groups({"create"}) */ protected $amount;
The @Groups
annotations can be used on the same fields as @Assert
annotations below.
Entity Deserialisation / Validation
Validation is applied to the JSON responses from payments to ensure that the returning fields are valid.
In the following examples, $id
must be a string, which can't be null. $ewallet
must be de-serialisble to a a valid
object of the type Ewallet.
Note that the @var
annotation is used to discover the entity type that the contents of $ewallet
should be
de-serialised to.
use Symfony\Component\Validator\Constraints as Assert; trait EwalletFundingTrait { /** * @Assert\NotNull() * @Assert\Type(type="\EoneoPay\PhpSdk\Endpoints\Ewallet") * @var \EoneoPay\PhpSdk\Endpoints\Ewallet|null */ protected $ewallet; /** * @Assert\NotNull() * @Assert\Type(type="string") * @var string|null */ protected $id;