Skip to content

Commit 9eb1050

Browse files
committed
doc links update and added new endpoints
1 parent f980d8f commit 9eb1050

15 files changed

Lines changed: 150 additions & 46 deletions

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to `paystack-php` will be documented in this file
44

5+
## v1.0.3 - 2021-02-19
6+
- Updated doc links to match the new API docs
7+
- Added `Bank::resolveBvnPremium(string $bvn)` method
8+
- Added `BulkCharge::fetchBulkChargeBatch(string $id_or_code, $params = nul)` method
9+
- Added `Charge::submitAddress(array $params)` method
10+
- Added `Transaction::checkAuthorization(array $params)` method
11+
- Added `TransferRecipient::createBulk(array $params)` method
12+
513
## v1.0.2 - 2020-06-18
614
- Removed redundant ApiErrorException Exception
715
- Fixed UnexpectedValueException Exception namespace to be psr-4 compliant

src/Bank.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Bank extends ApiResource
99
/**
1010
* @param string $bvn
1111
*
12-
* @link https://developers.paystack.co/reference#resolve-bvn
12+
* @link https://paystack.com/docs/api/#verification-resolve-bvn
1313
*
1414
* @return array|object
1515
*/
@@ -21,10 +21,24 @@ public static function resolveBvn(string $bvn)
2121
return static::staticRequest('GET', $url);
2222
}
2323

24+
/**
25+
* @param string $bvn
26+
* @return array|object
27+
* @throws Exceptions\InvalidArgumentException
28+
* @throws Exceptions\IsNullException
29+
* @link https://paystack.com/docs/api/#verification-resolve-bvn-premium
30+
*/
31+
public static function resolveBvnPremium(string $bvn)
32+
{
33+
$url = "identity/bvn/resolve/{$bvn}";
34+
35+
return static::staticRequest('GET', $url);
36+
}
37+
2438
/**
2539
* @param array $params
2640
*
27-
* @link https://developers.paystack.co/reference#match-bvn
41+
* @link https://paystack.com/docs/api/#verification-match-bvn
2842
*
2943
* @return array|object
3044
*/
@@ -39,7 +53,7 @@ public static function bvnMatch($params)
3953
/**
4054
* @param array $params
4155
*
42-
* @link https://developers.paystack.co/reference#resolve-account-number
56+
* @link https://paystack.com/docs/api/#verification-resolve-account
4357
*
4458
* @return array|object
4559
*/
@@ -54,7 +68,7 @@ public static function resolveAccountNumber($params)
5468
/**
5569
* @param string $bin
5670
*
57-
* @link https://developers.paystack.co/reference#resolve-card-bin
71+
* @link https://paystack.com/docs/api/#verification-resolve-card
5872
*
5973
* @return array|object
6074
*/

src/BulkCharge.php

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class BulkCharge extends ApiResource
1818
*
1919
* @return array | Object
2020
*
21-
* @link https://developers.paystack.co/reference#initiate-bulk-charge
21+
* @link https://paystack.com/docs/api/#bulk-charge-initiate
2222
*/
2323
public static function initiate($reference, $params)
2424
{
@@ -28,11 +28,28 @@ public static function initiate($reference, $params)
2828
return static::staticRequest('POST', $url);
2929
}
3030

31+
/**
32+
* @param string $id_or_code
33+
* @param null $params
34+
* @return array|object
35+
* @throws Exceptions\InvalidArgumentException
36+
* @throws Exceptions\IsNullException
37+
* @link https://paystack.com/docs/api/#bulk-charge-fetch-batch
38+
*/
39+
public static function fetchBulkChargeBatch($id_or_code, $params = null)
40+
{
41+
self::validateParams($params);
42+
$url = "{$id_or_code}";
43+
$url = static::buildQueryString($url, $params);
44+
45+
return static::staticRequest('GET', $url);
46+
}
47+
3148
/**
3249
* @param string $batch_id_or_code An ID or code for the batch whose charges you want to retrieve.
3350
* @param array $params
3451
*
35-
* @link https://developers.paystack.co/reference#fetch-charges-in-a-batch
52+
* @link https://paystack.com/docs/api/#bulk-charge-fetch-charge
3653
*
3754
* @return array | Object
3855
*/
@@ -48,7 +65,7 @@ public static function fetchChargesInABatch($batch_id_or_code, $params = null)
4865
/**
4966
* @param string $batch_code
5067
*
51-
* @link https://developers.paystack.co/reference#pause-bulk-charge-batch
68+
* @link https://paystack.com/docs/api/#bulk-charge-pause
5269
*
5370
* @return array | Object
5471
*/
@@ -63,7 +80,7 @@ public static function pause($batch_code)
6380
/**
6481
* @param string $batch_code
6582
*
66-
* @link https://developers.paystack.co/reference#resume-bulk-charge-batch
83+
* @link https://paystack.com/docs/api/#bulk-charge-resume
6784
*
6885
* @return array|object
6986
*/

src/Charge.php

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Charge extends ApiResource
1717
/**
1818
* @param array $params
1919
*
20-
* @link https://developers.paystack.co/reference#submit-pin
20+
* @link https://paystack.com/docs/api/#charge-submit-pin
2121
*
2222
* @return array|object
2323
*/
@@ -32,7 +32,7 @@ public static function submitPin($params)
3232
/**
3333
* @param array $params
3434
*
35-
* @link https://developers.paystack.co/reference#submit-otp
35+
* @link https://paystack.com/docs/api/#charge-submit-otp
3636
*
3737
* @return array|object
3838
*/
@@ -47,7 +47,7 @@ public static function submitOtp($params)
4747
/**
4848
* @param array $params
4949
*
50-
* @link https://developers.paystack.co/reference#submit-phone
50+
* @link https://paystack.com/docs/api/#charge-submit-phone
5151
*
5252
* @return array|object
5353
*/
@@ -62,7 +62,7 @@ public static function submitPhone($params)
6262
/**
6363
* @param array $params dates in the format 2016-09-21
6464
*
65-
* @link https://developers.paystack.co/reference#submit-birthday
65+
* @link https://paystack.com/docs/api/#charge-submit-birthday
6666
*
6767
* @return array|object
6868
*/
@@ -74,10 +74,25 @@ public static function submitBirthday($params)
7474
return static::staticRequest('POST', $url, $params);
7575
}
7676

77+
/**
78+
* @param array $params
79+
*
80+
* @link https://paystack.com/docs/api/#charge-submit-address
81+
*
82+
* @return array|object
83+
*/
84+
public static function submitAddress($params)
85+
{
86+
self::validateParams($params, true);
87+
$url = static::endPointUrl('submit_address');
88+
89+
return static::staticRequest('POST', $url, $params);
90+
}
91+
7792
/**
7893
* @param string $reference Charge reference to check
7994
*
80-
* @link https://developers.paystack.co/reference#check-pending-charge
95+
* @link https://paystack.com/docs/api/#charge-check
8196
*
8297
* @return array|object
8398
*/

src/Customer.php

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,20 @@ class Customer extends ApiResource
1111
use ApiOperations\Fetch;
1212
use ApiOperations\Update;
1313

14+
/**
15+
* @param $customerCode
16+
* @return array|object
17+
* @throws Exceptions\InvalidArgumentException
18+
* @throws Exceptions\IsNullException
19+
* @link https://paystack.com/docs/api/#customer-validate
20+
*/
21+
public static function validate($customerCode)
22+
{
23+
$url = static::classUrl().'/{$customerCode}/identification';
24+
25+
return static::staticRequest('POST', $url);
26+
}
27+
1428
/**
1529
* @param array $params containing the customer code of the customer to white/black list and
1630
* one can be one of the possible risk actions:
@@ -22,14 +36,14 @@ class Customer extends ApiResource
2236
*
2337
* @return array|object
2438
*
25-
* @link https://developers.paystack.co/reference#whiteblacklist-customer
39+
* @link https://paystack.com/docs/api/#customer-whitelist-blacklist
2640
*/
2741
public static function whiteOrBlackList($params)
2842
{
2943
self::validateParams($params);
3044
$url = static::classUrl().'/set_risk_action';
3145

32-
return static::staticRequest('post', $url, $params);
46+
return static::staticRequest('POST', $url, $params);
3347
}
3448

3549
/**
@@ -40,13 +54,13 @@ public static function whiteOrBlackList($params)
4054
*
4155
* @return array|object
4256
*
43-
* @link https://developers.paystack.co/reference#deactivate-authorization
57+
* @link https://paystack.com/docs/api/#customer-deactivate-authorization
4458
*/
4559
public static function deactivateAuthorization($params)
4660
{
4761
self::validateParams($params);
4862
$url = static::classUrl().'/deactivate_authorization';
4963

50-
return static::staticRequest('post', $url, $params, 'arr');
64+
return static::staticRequest('POST', $url, $params, 'arr');
5165
}
5266
}

src/Dispute.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Dispute extends ApiResource
1313
/**
1414
* @param string $transaction_id
1515
*
16-
* @link https://developers.paystack.co/reference#list-transaction-disputes
16+
* @link https://paystack.com/docs/api/#dispute-transaction
1717
*
1818
* @return array|object
1919
*/
@@ -29,7 +29,7 @@ public static function listTransactionDisputes(string $transaction_id)
2929
* @param string $dispute_id
3030
* @param array $params
3131
*
32-
* @link https://developers.paystack.co/reference#add-evidence
32+
* @link https://paystack.com/docs/api/#dispute-evidence
3333
*
3434
* @return array|object
3535
*/
@@ -45,7 +45,7 @@ public static function addEvidence(string $dispute_id, $params)
4545
/**
4646
* @param string $dispute_id
4747
*
48-
* @link https://developers.paystack.co/reference#get-upload-url
48+
* @link https://paystack.com/docs/api/#dispute-upload-url
4949
*
5050
* @return array|object
5151
*/
@@ -61,7 +61,7 @@ public static function getUploadUrl(string $dispute_id)
6161
* @param string $dispute_id
6262
* @param array $params
6363
*
64-
* @link https://developers.paystack.co/reference#resolve-dispute
64+
* @link https://paystack.com/docs/api/#dispute-resolve
6565
*
6666
* @return array|object
6767
*/
@@ -77,7 +77,7 @@ public static function resolve(string $dispute_id, $params)
7777
/**
7878
* @param array $params
7979
*
80-
* @link https://developers.paystack.co/reference#export-disputes
80+
* @link https://paystack.com/docs/api/#dispute-export
8181
*
8282
* @return array|object
8383
*/

src/Integration.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Integration extends ApiResource
99
/**
1010
* Paystack Documentation Reference.
1111
*
12-
* @link https://developers.paystack.co/reference#fetch-payment-session-timeout
12+
* @link https://paystack.com/docs/api/#control-panel-fetch-timeout
1313
*
1414
* @return array|object
1515
*/
@@ -24,7 +24,7 @@ public static function fetchPaymentSessionTimeout()
2424
* @param $params the time before stopping session (in seconds). Set to 0 to cancel session timeouts
2525
* Paystack Documentation Reference
2626
*
27-
* @link https://developers.paystack.co/reference#update-payment-session-timeout
27+
* @link https://paystack.com/docs/api/#control-panel-update-timeout
2828
*
2929
* @return array|object
3030
*/

src/Invoice.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Invoice extends ApiResource
1414
/**
1515
* @param string $invoice_code details at
1616
*
17-
* @link https://developers.paystack.co/reference#verify-invoice
17+
* @link https://paystack.com/docs/api/#invoice-verify
1818
*
1919
* @return array|object
2020
*/
@@ -35,7 +35,7 @@ public static function verify(string $invoice_code)
3535
*
3636
* @return array|object
3737
*
38-
* @link https://developers.paystack.co/reference#send-notification
38+
* @link https://paystack.com/docs/api/#invoice-send-notification
3939
*/
4040
public static function notify(string $invoice_id, $params)
4141
{
@@ -48,7 +48,7 @@ public static function notify(string $invoice_id, $params)
4848
/**
4949
* Get invoice totals for dashboard.
5050
*
51-
* @link https://developers.paystack.co/reference#get-invoice-metrics-for-dashboard
51+
* @link https://paystack.com/docs/api/#invoice-total
5252
*
5353
* @throws Exceptions\InvalidArgumentException
5454
* @throws Exceptions\IsNullException
@@ -71,7 +71,7 @@ public static function totals()
7171
*
7272
* @return array|object
7373
*
74-
* @link https://developers.paystack.co/reference#finalize-a-draft-invoice
74+
* @link https://paystack.com/docs/api/#invoice-finalize
7575
*/
7676
public static function finalize($invoice_id, $params = null)
7777
{
@@ -91,7 +91,7 @@ public static function finalize($invoice_id, $params = null)
9191
*
9292
* @return array|object
9393
*
94-
* @link https://developers.paystack.co/reference#archive-invoice
94+
* @link https://paystack.com/docs/api/#invoice-archive
9595
*/
9696
public static function archive($invoice_id, $params)
9797
{

src/PaymentPage.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class PaymentPage extends ApiResource
1414
/**
1515
* @param string $slug details at
1616
*
17-
* @link https://developers.paystack.co/reference#check-slug-availability
17+
* @link https://paystack.com/docs/api/#page-check-slug
1818
*
1919
* @return array|object
2020
*/
@@ -30,7 +30,7 @@ public static function checkSlugAvailability($slug)
3030
* @param string $page_id
3131
* @param array $params details at
3232
*
33-
* @link https://developers.paystack.co/reference#add-products
33+
* @link https://paystack.com/docs/api/#page-add-products
3434
*
3535
* @return array|object
3636
*/

src/Settlement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Settlement extends ApiResource
1212
* @param string $settlement_id
1313
* @param array $params
1414
*
15-
* @link https://developers.paystack.co/reference#fetch-settlement-transactions
15+
* @link https://paystack.com/docs/api/#settlement-transactions
1616
*
1717
* @return array|object
1818
*/

0 commit comments

Comments
 (0)