digikraaft /
flutterwave-php
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Digikraaft\Flutterwave; |
||
| 4 | |||
| 5 | class Transaction extends ApiResource |
||
| 6 | { |
||
| 7 | const OBJECT_NAME = 'transactions'; |
||
| 8 | |||
| 9 | use ApiOperations\All; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @param array $params details at |
||
| 13 | * |
||
| 14 | * @link https://developer.flutterwave.com/reference#get-transaction-fee |
||
| 15 | * |
||
| 16 | * @return array|object |
||
| 17 | */ |
||
| 18 | public static function fee(array $params) |
||
| 19 | { |
||
| 20 | self::validateParams($params); |
||
| 21 | $url = static::buildQueryString('fee', $params); |
||
| 22 | |||
| 23 | return static::staticRequest('GET', $url); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @param string $transactionId |
||
| 28 | * @param array $params details of parameter content at |
||
| 29 | * |
||
| 30 | * @return array|object |
||
| 31 | * @link https://developer.flutterwave.com/reference#resend-transaction-webhook |
||
| 32 | */ |
||
| 33 | public static function resendWebHook(string $transactionId, array $params) |
||
|
0 ignored issues
–
show
|
|||
| 34 | { |
||
| 35 | self::validateParams($params); |
||
| 36 | $url = static::buildQueryString('{$transactionId}/resend-hook', $params); |
||
| 37 | |||
| 38 | return static::staticRequest('POST', $url, $params); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @param string $transactionId |
||
| 43 | * @return array|object |
||
| 44 | * @link https://developer.flutterwave.com/reference#verify-transaction |
||
| 45 | */ |
||
| 46 | public static function verify(string $transactionId) |
||
| 47 | { |
||
| 48 | $url = static::endPointUrl("{$transactionId}/verify"); |
||
| 49 | |||
| 50 | return static::staticRequest('GET', $url); |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @param string $transactionId |
||
| 55 | * @param array $params details of parameter content at |
||
| 56 | * |
||
| 57 | * @return array|object |
||
| 58 | * @link https://developer.flutterwave.com/reference#transaction-refund |
||
| 59 | */ |
||
| 60 | public static function refund(string $transactionId, array $params) |
||
| 61 | { |
||
| 62 | self::validateParams($params); |
||
| 63 | $url = static::endPointUrl("{$transactionId}/refund"); |
||
| 64 | |||
| 65 | return static::staticRequest('POST', $url, $params); |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @param string $transactionId details at |
||
| 70 | * |
||
| 71 | * @link https://developers.paystack.co/reference#view-transaction-timeline |
||
| 72 | * |
||
| 73 | * @return array|object |
||
| 74 | */ |
||
| 75 | public static function timeline(string $transactionId) |
||
| 76 | { |
||
| 77 | $url = static::endPointUrl("{$transactionId}/events"); |
||
| 78 | |||
| 79 | return static::staticRequest('GET', $url); |
||
| 80 | } |
||
| 81 | } |
||
| 82 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.