Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add all other endpoint #3

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/vendor
/.history
/.idea
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,45 @@ After we redirect to your callback, please verify the transaction before giving

```

### Make an undirect tranfers

> To make a direct transfer you should provide us a beneficiary id, name and phone number

```php
// initiate the Library's NotchPay Object
NotchPay::setApiKey('sk_1234abcd');

try {
$beneficiary = Recipient::create([
"name" => "Benjamin Maggio",
"channel" => "cm.mobile",
"number" => "+237695782464", // Number to receive found
"phone" => "+237695782495", // Recipient phone number (contact only)
"email" => "hello@notchpay.qw",
"country" => "CM",
"description" => "Test description",
"reference" => "3RAV4gZLesBAXTrwiuUDLnJGSDESSEWF"
]);

$transfer = Transfer::direct([
"amount" => "15",
"currency" => "XAF",
"description" => "Test description",
"recipient" => $beneficiary->recipient->id,
"channel" => "cm.mobile",
"beneficiary" => [
'name' => $beneficiary->recipient->name,
'number' => $beneficiary->recipient->phone
]
]);

} catch(\NotchPay\Exceptions\ApiException $e){
print_r($e->errors);
die($e->getMessage());
}

```

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
Expand Down
26 changes: 19 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@
"email": "hello@digikraaft.ng",
"homepage": "https://digikraaft.com",
"role": "Base credit"
},
{
"name": "Stevy Endaman",
"email": "endamanstevy@gmail.com",
"role": "Developper"
}
],
"require": {
Expand All @@ -40,20 +45,27 @@
"ext-json": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.16",
"mockery/mockery": "^1.4",
"php-coveralls/php-coveralls": "^2.2",
"phpunit/phpunit": "^9.0",
"scrutinizer/ocular": "^1.7",
"vimeo/psalm": "^3.11"
"mockery/mockery": "^1.6",
"pestphp/pest": "^3.7",
"phpstan/phpstan": "^2.0"
},
"autoload": {
"psr-4": {
"NotchPay\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"config": {
"sort-packages": true
"sort-packages": true,
"optimize-autoloader": true,
"process-timeout": 1200,
"allow-plugins": {
"pestphp/pest-plugin": true
}
},
"minimum-stability": "dev",
"prefer-stable": true
Expand Down
Loading