Skip to content

Commit

Permalink
v1.0.0-alpha release for extensive testing before v1 main release
Browse files Browse the repository at this point in the history
  • Loading branch information
henryejemuta committed Jul 15, 2020
1 parent 5dd6ad5 commit 694c918
Show file tree
Hide file tree
Showing 8 changed files with 697 additions and 43 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/vendor
/build
composer.phar
composer.lock
.DS_Store
.idea
.phpunit.result.cache
.phpunit.result.cache
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to `laravel-monnify` will be documented in this file

## 1.0.0 - 201X-XX-XX
- Alpha release
## 1.0.0-alpha - 2020-07-15

- initial release
## 1.0.0 - 202X-XX-XX

- initial release
481 changes: 473 additions & 8 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"require-dev": {
"orchestra/testbench": "^5.3",
"phpunit/phpunit": "^8.0.0"
"phpunit/phpunit": "^7.2|^7.5|^9.2"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@
*
* ID of business wallet from which transfer will initiated.
*/
'wallet_id' => env('MONNIFY_WALLET_ID', 'UC92DYF58V7JZL99AE52'),
'wallet_id' => env('MONNIFY_WALLET_ID', '2A47114E88904626955A6BD333A6B164'),

];
8 changes: 4 additions & 4 deletions src/Classes/MonnifyBankAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ class MonnifyBankAccount
* @param string $bankCode
* @throws MonnifyInvalidParameterException
*/
private function __construct(string $accountName, string $accountNumber, string $bankCode)
public function __construct(string $accountNumber, string $bankCode, string $accountName = '')
{
$accountNumber = trim($accountNumber);
$bankCode = trim($bankCode);

if (empty($accountNumber))
throw new MonnifyInvalidParameterException('Account Number can\'t be empty');
else if (is_numeric($accountNumber))
else if (preg_match('#[^0-9]#', $accountNumber))
throw new MonnifyInvalidParameterException('Account Number must be numeric');
else if (strlen("{$bankCode}") !== 10)
else if (strlen("{$accountNumber}") !== 10)
throw new MonnifyInvalidParameterException('Account Number must be exactly 10 digits');

if (empty($bankCode))
throw new MonnifyInvalidParameterException('Bank Code can\'t be empty');
else if (is_numeric($bankCode))
else if (preg_match('#[^0-9]#', $bankCode))
throw new MonnifyInvalidParameterException('Bank Code must be numeric');
else if (strlen("{$bankCode}") !== 3)
throw new MonnifyInvalidParameterException('Bank Code must be exactly 3 digits');
Expand Down
2 changes: 1 addition & 1 deletion src/Console/InstallLaravelMonnify.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function handle()
$this->writeChanges($path, "MONNIFY_API_KEY", "api_key", "MK_TEST_SAF7HR5F3F");
$this->writeChanges($path, "MONNIFY_SECRET_KEY", "secret_key", "4SY6TNL8CK3VPRSBTHTRG2N8XXEGC6NL");
$this->writeChanges($path, "MONNIFY_CONTRACT_CODE", "contract_code", "4934121686");
$this->writeChanges($path, "MONNIFY_WALLET_ID", "wallet_id", "UC92DYF58V7JZL99AE52");
$this->writeChanges($path, "MONNIFY_WALLET_ID", "wallet_id", "2A47114E88904626955A6BD333A6B164");
$this->writeChanges($path, "MONNIFY_DEFAULT_SPLIT_PERCENTAGE", "default_split_percentage", 20);
$this->writeChanges($path, "MONNIFY_DEFAULT_CURRENCY_CODE", "default_currency_code", 'NGN');
$this->writeChanges($path, "MONNIFY_DEFAULT_PAYMENT_REDIRECT_URL", "redirect_url", '"${APP_URL}"');
Expand Down
236 changes: 210 additions & 26 deletions src/Monnify.php

Large diffs are not rendered by default.

0 comments on commit 694c918

Please sign in to comment.