Skip to content

Commit a3a0654

Browse files
committed
update unit's
1 parent 063d92a commit a3a0654

File tree

9 files changed

+41
-7
lines changed

9 files changed

+41
-7
lines changed

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
### Added
9+
- Add exchange method's
10+
- Add confirm method's
11+
- Add method `hasWallet`
12+
- Add currency service (create usd, eur,...)
813

914
## [3.0.4] - 2019-07-22
1015
### Fixed

docs/_sidebar.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,26 @@
1212
- [Withdraw](withdraw)
1313
- [Transfer](transfer)
1414
- [Refresh balance](refresh)
15+
- [Confirm](confirm)
16+
- [Exchange](exchange)
17+
- [Withdraw taxing](taxing)
1518

1619
- Purchases
1720

1821
- [Payment](payment)
19-
- [Cart](cart)
2022
- [Payment Free](pay-free)
2123
- [Refund](refund)
24+
- [Gift](gift)
25+
- [Cart](cart)
2226

2327
- Multi Wallets
2428

2529
- [New Wallet](new-wallet)
2630
- [Transfer](wallet-transfer)
31+
32+
- Currencies
33+
34+
- [Rate Service](rate)
35+
- [Create Wallet](rate-wallet)
36+
- [Taxing](rate-taxing)
37+
-

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
window.$docsify = {
1515
name: 'Laravel Wallet',
1616
repo: 'bavix/laravel-wallet',
17-
ga: 'UA-98195013-2',
17+
// ga: 'UA-98195013-2',
1818
loadSidebar: true,
1919
loadNavbar: true,
2020
relativePath: true,

docs/new-wallet.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,14 @@ It is the balance of the wallet by default.
3939
Create a new wallet.
4040

4141
```php
42+
$user->hasWallet('my-wallet'); // bool(false)
4243
$wallet = $user->createWallet([
4344
'name' => 'New Wallet',
4445
'slug' => 'my-wallet',
4546
]);
4647

48+
$user->hasWallet('my-wallet'); // bool(true)
49+
4750
$wallet->deposit(100);
4851
$wallet->balance; // int(100)
4952

docs/requirements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ The following versions of Laravel are supported:
1212
- Laravel 5.6
1313
- Laravel 5.7
1414
- Laravel 5.8
15+
- Laravel 5.9

docs/ru/requirements.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@
1212
- Laravel 5.6
1313
- Laravel 5.7
1414
- Laravel 5.8
15+
- Laravel 5.9

docs/ru/transfer.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ $last->balance; // int(0)
4343
Сделаем перевод от первого второму.
4444

4545
```php
46-
$first->transfer($second, 5);
46+
$first->transfer($last, 5);
4747
$first->balance; // int(95)
48-
$second->balance; // int(5)
48+
$last->balance; // int(5)
4949
```
5050

5151
## Заставить перевести.
@@ -61,9 +61,9 @@ $last->balance; // int(0)
6161
Сделаем перевод от первого второму.
6262

6363
```php
64-
$first->forceTransfer($second, 500);
64+
$first->forceTransfer($last, 500);
6565
$first->balance; // int(-400)
66-
$second->balance; // int(500)
66+
$last->balance; // int(500)
6767
```
6868

6969
Просто работает.

src/Traits/HasWallets.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,15 @@ public function createWallet(array $data): WalletModel
9797
return $wallet;
9898
}
9999

100+
/**
101+
* The method checks the existence of the wallet
102+
*
103+
* @param string $slug
104+
* @return bool
105+
*/
106+
public function hasWallet(string $slug): bool
107+
{
108+
return (bool)$this->getWallet($slug);
109+
}
110+
100111
}

tests/MultiWalletTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ public function testDeposit(): void
4242
* @var UserMulti $user
4343
*/
4444
$user = factory(UserMulti::class)->create();
45+
$this->assertFalse($user->hasWallet('deposit'));
4546
$wallet = $user->createWallet([
46-
'name' => 'deposit'
47+
'name' => 'Deposit'
4748
]);
4849

50+
$this->assertTrue($user->hasWallet('deposit'));
4951
$this->assertEquals($user->balance, 0);
5052
$this->assertEquals($wallet->balance, 0);
5153

0 commit comments

Comments
 (0)