All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
2.2.1 - 2019-02-17
- Add support Laravel 5.8.
2.2.0 - 2018-12-25
- Add trait
CanPay
. - Add trait
CanPayFloat
.
- Trait
CanBePaid
. - Trait
CanBePaidFloat
.
2.1.0 - 2018-11-22
- File changelog.
- Add
HasGift
trait. - Added status column to the
transfers
table. - Added status_last column to the
transfers
table. - Added methods: refundGift, safeRefundGift, forceRefundGift
- A new argument is added to the "old
refund
" methods$gifts
.
- Due to the addition of new functionality
gifts
there are possible problems that need to be addressed. Namely, when returning the goods, the funds would not be returned to the person who paid for it. Which would raise a lot of questions.
- Composer.json: add new keywords.
- the $gifts argument (Boolean type) is added to the paid, refund, safeRefund, forceRefund method's.
- Removed column
refund
fromtransfers
table. Now it has been replaced by the status column.
2.0.1 - 2018-11-21
- add method getAvailableBalance. public getAvailableBalance(): int.
2.0.0 - 2018-11-21
- table
wallets
. - add
wallet_id
to tabletransactions
and foreign key's. - add
fee
to tabletransfers
. - add localization's.
- add Taxing interface.
- add WalletFloat interface.
- add const TYPE_DEPOSIT, TYPE_WITHDRAW.
- add Wallet model.
- add working with fractional (float) numbers.
- add method calculateBalance.
- add method payFree. public payFree(Product $product): Transfer.
- add CanBePaidFloat trait.
- Added the ability to collect Commission when withdrawing funds in transfers.
- Added the ability to work with multiple wallets.
- Added a class that stores user balance. To avoid any problems.
- add HasWalletFloat trait.
- add HasWallets trait.
- Add $type argument before $amount. protected change(string $type, int $amount, ?array $meta, bool $confirmed): Transaction.
- Due to the addition of the ability to buy for free, there was a bug in which we returned the full cost.
- Due to the addition of the ability to work with many wallets, there were bugs with payments. When the user bought the goods and the goods were assigned to the wallet, not to the user. This change of method: change, transactions, transfers, wallet, etc.
1.2.3 - 2018-11-11
- readme: Added new features.
- Composer.json: add new keywords.
1.2.2 - 2018-11-10
- method public forcePay(Product $product): Transfer.
- method public forceRefund(Product $product): bool.
- the
$force
parameter was added to thepay
method. public pay(Product $product, bool $force = false): Transfer. - the
$force
parameter was added to thesafePay
method. public safePay(Product $product, bool $force = false): ?Transfer. - the
$force
parameter was added to thecanBuy
method. public canBuy(Customer $customer, bool $force = false): bool. - the
$force
parameter was added to therefund
method. public refund(Product $product, bool $force = false): bool. - the
$force
parameter was added to thesafeRefund
method. public safeRefund(Product $product, bool $force = false): bool.
- Fixed magic method. He accounted for unconfirmed transactions.
1.2.1 - 2018-11-09
- check for php 7.3
- support for laravel 5.5.
1.2.0 - 2018-11-09
- phpunit to the project.
1.1.2 - 2018-11-08
- Fixed "balance" method. He counted the amount along with the unconfirmed transactions.
1.1.1 - 2018-11-08
- Update readme.
- New indexes have names for quick removal.
- Fixed
down
migration methodtransfers
.
1.1.0 - 2018-11-08
- Added index for fields in "transfers" table: ['from_type', 'from_id', 'refund'].
- Added index for fields in "transfers" table: ['to_type', 'to_id', 'refund'].
- In the table "transactions" added to the type index.
- Exception ProductEnded
- Method public paid(Product $product): ?Transfer.
- Method public canBuy(Customer $customer): bool.
- Static balance caching. Also the description for what it is necessary.
- In the table "transactions" is deleted the index of the field "uuid" and added a unique index.
- In the table "transfers" is deleted the index of the field "uuid" and added a unique index.
- Method
pay
began to check the possibility of buying.
- public resetBalance(): void
1.0.0 - 2018-11-07
- Added
refund
field totransfers
table.
- Updated the
refund
method. The operation is now executed in the transaction and updates the newrefund
field.
- public resetBalance(): void
- written README.
- Project configuration file created.
- Migration 2018_11_06_222923_create_transactions_table.
- Migration 2018_11_07_192923_create_transfers_table.
HasWallet
trait andWallet
interface.- methods:
- private checkAmount(int $amount): void
- public forceWithdraw(int $amount, ?array $meta = null, bool $confirmed = true): Transaction
- public deposit(int $amount, ?array $meta = null, bool $confirmed = true): Transaction
- public withdraw(int $amount, ?array $meta = null, bool $confirmed = true): Transaction
- public canWithdraw(int $amount): bool
- public transfer(Wallet $wallet, int $amount, ?array $meta = null): Transfer
- public safeTransfer(Wallet $wallet, int $amount, ?array $meta = null): ?Transfer
- public forceTransfer(Wallet $wallet, int $amount, ?array $meta = null): Transfer
- protected assemble(Wallet $wallet, Transaction $withdraw, Transaction $deposit): Transfer
- protected change(int $amount, ?array $meta, bool $confirmed): Transaction
- public resetBalance(): void
- relations:
- public transactions(): MorphMany
- public transfers(): MorphMany
- magic property
- public getBalanceAttribute(): int
- methods:
CanBePaid
trait andProduct
,Costomer
interface's- methods:
- public pay(Product $product): Transfer
- public safePay(Product $product): ?Transfer
- public refund(Product $product): bool
- public safeRefund(Product $product): bool
- methods:
- Exceptions: AmountInvalid, BalanceIsEmpty.
- Models: Transfer, Transaction.