diff --git a/app/Models/Payment/OnlinePaymentHistory.php b/app/Models/Payment/OnlinePaymentHistory.php index 6400ace..4303a44 100644 --- a/app/Models/Payment/OnlinePaymentHistory.php +++ b/app/Models/Payment/OnlinePaymentHistory.php @@ -27,7 +27,7 @@ use Illuminate\Database\Eloquent\Model; * @property string $username * @property int $online_paymantable_id * @property string $online_paymantable_type - * @property $api_response + * @property ?array $api_response * @property \Illuminate\Support\Carbon $created_at * @property \Illuminate\Support\Carbon $updated_at */ @@ -41,4 +41,16 @@ class OnlinePaymentHistory extends Model * @var string */ protected $table = 'online_payment_histories'; + + /** + * Get the attributes that should be cast. + * + * @return array + */ + protected function casts(): array + { + return [ + 'api_response' => 'array', + ]; + } } diff --git a/app/Repos/Payment/Billing/HandlesBillingSyncing.php b/app/Repos/Payment/Billing/HandlesBillingSyncing.php index 303b066..43847f6 100644 --- a/app/Repos/Payment/Billing/HandlesBillingSyncing.php +++ b/app/Repos/Payment/Billing/HandlesBillingSyncing.php @@ -18,7 +18,7 @@ trait HandlesBillingSyncing string $rrn, string $amount, string $pay_purpose, - ) { + ): mixed { $body = sprintf('{ "ecomId": "%s", "agentId": "%s", diff --git a/app/Repos/Payment/OnlinePaymentRepo.php b/app/Repos/Payment/OnlinePaymentRepo.php index f04908e..0b5d794 100644 --- a/app/Repos/Payment/OnlinePaymentRepo.php +++ b/app/Repos/Payment/OnlinePaymentRepo.php @@ -186,6 +186,8 @@ class OnlinePaymentRepo /** * Successfully payment response + * + * @return array */ public static function successfulPaymentResponse( OnlinePaymentHistory $paymentHistory, @@ -208,6 +210,8 @@ class OnlinePaymentRepo /** * Failed payment response + * + * @return array */ public static function failedPaymentResponse( OnlinePaymentHistory $paymentHistory, @@ -230,6 +234,8 @@ class OnlinePaymentRepo /** * Resource not found + * + * @return array */ protected static function resourceNotFound(): array { diff --git a/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php b/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php index 84fa557..6f349c4 100644 --- a/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php +++ b/app/Repos/Payment/VisaMaster/HandlesVisaMasterPayments.php @@ -14,6 +14,8 @@ trait HandlesVisaMasterPayments * Check payment payment visa master * * @param Request $request + * + * @return array */ public static function checkPaymentVisaMaster(Request $request): array {