From da04341c05543867afbb01fdfd60b6377ba69b01 Mon Sep 17 00:00:00 2001 From: Kofi Oghenerukevwe H Date: Wed, 15 Jan 2020 19:54:29 +0100 Subject: [PATCH] updated docblocks for Bill and AuthBill --- src/AuthBill.php | 7 +++++++ src/Bill.php | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/AuthBill.php b/src/AuthBill.php index 6e1b4fb..5b890be 100644 --- a/src/AuthBill.php +++ b/src/AuthBill.php @@ -3,6 +3,8 @@ namespace Kofi\NgPayments; +use Kofi\NgPayments\Exceptions\FailedPaymentException; + class AuthBill extends Bill { public function __construct($authorization_code = null, $customer_email = null, $naira_amount = null) @@ -15,6 +17,11 @@ public function __construct($authorization_code = null, $customer_email = null, } } + /** + * @return string|null payment reference or null if the request failed + * @throws Exceptions\InvalidRequestBodyException + * @throws Exceptions\FailedPaymentException if PaymentExceptions are enabled + */ public function charge() { $this->paymentReference = $this->paymentProvider->chargeAuth($this->attributes); diff --git a/src/Bill.php b/src/Bill.php index 5763199..b5e1592 100644 --- a/src/Bill.php +++ b/src/Bill.php @@ -25,6 +25,10 @@ public function __construct($customer_email = null, $naira_amount = null) } } + /** + * @return $this + * @throws Exceptions\InvalidRequestBodyException + */ public function charge() { $this->paymentReference = $this->paymentProvider->initializePayment($this->attributes); @@ -44,11 +48,25 @@ public function subscribe($plan_code) return $this->charge(); } + /** + * @param $payment_reference + * @param $naira_amount + * @return bool + * @throws Exceptions\InvalidPaymentProviderConfigException + * @throws Exceptions\FailedPaymentException if paymentExceptions are enabled + */ public static function isPaymentValid($payment_reference, $naira_amount) { return PaymentProviderFactory::getPaymentProvider()->isPaymentValid($payment_reference, $naira_amount); } + /** + * @param $payment_reference + * @param $naira_amount + * @return string|null authorization_code or null if the request failed + * @throws Exceptions\InvalidPaymentProviderConfigException + * @throws Exceptions\FailedPaymentException if paymentExceptions are enabled + */ public static function getPaymentAuthorizationCode($payment_reference, $naira_amount) { $payment_provider = PaymentProviderFactory::getPaymentProvider();