Skip to content
Merged
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
32 changes: 14 additions & 18 deletions src/LaravelHyperpay.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public function mada()

/**
* Add billing data to the payment body.
* @param BillingInterface $billing;
*
* @param BillingInterface $billing;
*
* return $this
*/
Expand All @@ -88,12 +89,11 @@ public function addBilling(BillingInterface $billing)
/**
* Prepare the checkout.
*
* @param array $trackable_data
* @param Model $user
* @param float $amount
* @param string $brand
* @param Request $request
*
* @param array $trackable_data
* @param Model $user
* @param float $amount
* @param string $brand
* @param Request $request
* @return \GuzzleHttp\Psr7\Response
*/
public function checkout(array $trackable_data, Model $user, $amount, $brand, Request $request)
Expand All @@ -115,10 +115,9 @@ public function checkout(array $trackable_data, Model $user, $amount, $brand, Re
* Define the data used to generate a successful
* response from hyperpay to generate the payment form.
*
* @param Model $user
* @param array $trackable_data
* @param Request $request
*
* @param Model $user
* @param array $trackable_data
* @param Request $request
* @return \GuzzleHttp\Psr7\Response
*/
protected function prepareCheckout(Model $user, array $trackable_data, $request)
Expand All @@ -143,9 +142,8 @@ protected function prepareCheckout(Model $user, array $trackable_data, $request)
/**
* Check the payment status using $resourcePath and $checkout_id.
*
* @param string $resourcePath
* @param string $checkout_id
*
* @param string $resourcePath
* @param string $checkout_id
* @return \GuzzleHttp\Psr7\Response
*/
public function paymentStatus(string $resourcePath, string $checkout_id)
Expand All @@ -165,8 +163,7 @@ public function paymentStatus(string $resourcePath, string $checkout_id)
/**
* Add merchantTransactionId.
*
* @param string $id
*
* @param string $id
* @return $this
*/
public function addMerchantTransactionId($id)
Expand All @@ -179,8 +176,7 @@ public function addMerchantTransactionId($id)
/**
* Add redirection url to the shopper to finalize the payment.
*
* @param string $url
*
* @param string $url
* @return $this
*/
public function addRedirectUrl($url)
Expand Down
6 changes: 2 additions & 4 deletions src/Support/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ public function __construct(GuzzleClient $client, string $path, array $config)
/**
* Create a post sever-to-server request.
*
* @param array $parameters
*
* @param array $parameters
* @return Response
*/
public function post(array $parameters): Response
Expand All @@ -65,8 +64,7 @@ public function post(array $parameters): Response
/**
* Create a get request to hyperpay used to check the status.
*
* @param array $parameters
*
* @param array $parameters
* @return Response
*/
public function get(array $parameters): Response
Expand Down
21 changes: 8 additions & 13 deletions src/Support/HttpParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ class HttpParameters
* Get the parameters that used in the request with hyperpay
* to initilize the transaction and generate the form.
*
* @param float $amount
* @param Model $user
* @param float $amount
* @param Model $user
* @param array hyperpay config file with extra data added during the process
* @param \Devinweb\LaravelHyperpay\Contracts\BillingInterface $billing
*
* @param \Devinweb\LaravelHyperpay\Contracts\BillingInterface $billing
* @return array
*/
public function postParams($amount, $user, $heyPerPayConfig, $billing): array
Expand All @@ -32,8 +31,7 @@ public function postParams($amount, $user, $heyPerPayConfig, $billing): array
/**
* Get the entity id base on the checkout id of its for VISA/MASTER or MADA.
*
* @param string $checkout_id
*
* @param string $checkout_id
* @return array
*/
public function getParams($checkout_id): array
Expand All @@ -46,10 +44,9 @@ public function getParams($checkout_id): array
/**
* Generate the basic user parameters.
*
* @param float $amount
* @param Model $user
* @param float $amount
* @param Model $user
* @param array hyperpay config file with extra data added during the process
*
* @return array
*/
protected function getBodyParameters($amount, Model $user, $heyPerPayConfig): array
Expand Down Expand Up @@ -79,8 +76,7 @@ protected function getBodyParameters($amount, Model $user, $heyPerPayConfig): ar
/**
* Get the billing data from the Billing class if a user generate one.
*
* @param Devinweb\LaravelHyperpay\Contracts\BillingInterface $billing
*
* @param Devinweb\LaravelHyperpay\Contracts\BillingInterface $billing
* @return array
*/
protected function getBillingParameters($billing): array
Expand All @@ -95,8 +91,7 @@ protected function getBillingParameters($billing): array
/**
* Find the entityId from the transaction if its for MADA of else.
*
* @param string $id transaction id
*
* @param string $id transaction id
* @return string
*/
protected function getEntityId($id)
Expand Down
5 changes: 2 additions & 3 deletions src/Support/HttpResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,9 +207,8 @@ protected function response(): array
/**
* Update the transation and dispatch events for both success and fail transaction.
*
* @param int $status
* @param array $optionData
*
* @param int $status
* @param array $optionData
* @return void
*/
protected function updateTransaction($status, array $optionData)
Expand Down
7 changes: 2 additions & 5 deletions src/Support/TransactionBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ public function __construct($owner = null)
* Create and clean pending transaction for the given user.
*
* @param array $transactionData
*
* @return \Deviwnweb\LaravelHyperpay\Models\Transaction
*/
public function create(array $transactionData)
Expand All @@ -53,8 +52,7 @@ public function create(array $transactionData)
/**
* Find the transaction in the database.
*
* @param string $id
*
* @param string $id
* @return null|\Deviwnweb\LaravelHyperpay\Models\Transaction
*/
public function findByIdOrCheckoutId($id)
Expand All @@ -69,8 +67,7 @@ public function findByIdOrCheckoutId($id)
* Find the brand (VISA/MASTER OR MADA) based on the entityID
* default = VISA/MASTER.
*
* @param string $entityId
*
* @param string $entityId
* @return string
*/
protected function getBrand($entityId)
Expand Down