Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
arif98741 committed Sep 6, 2023
2 parents c6abf2f + bf83b51 commit cd0ce91
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/Request/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function createPayment(BkashPhp $param, array $paymentData): object
$paymentResponse = $bkashRequestObject->post('tokenized/checkout/create');
$paymentObject = $paymentResponse->getContentsObject();

return (new BkashResponse($paymentResponse, $paymentObject))->getResponse();
return $this->getResponse($paymentResponse, $paymentObject);
}

/**
Expand All @@ -37,7 +37,7 @@ public function executePayment(BkashPhp $param, $paymentData)
$paymentResponse = $bkashRequestObject->post('tokenized/checkout/execute');
$executePaymentObject = $paymentResponse->getContentsObject();

return (new BkashResponse($paymentResponse, $executePaymentObject))->getResponse();
return $this->getResponse($paymentResponse, $executePaymentObject);
}

/**
Expand All @@ -53,6 +53,17 @@ public function searchTransaction(BkashPhp $param, $paymentData)
$paymentResponse = $bkashRequestObject->post('tokenized/checkout/general/searchTransaction');
$searchPaymentObject = $paymentResponse->getContentsObject();

return (new BkashResponse($paymentResponse, $searchPaymentObject))->getResponse();
return $this->getResponse($paymentResponse, $searchPaymentObject);
}

/**
* @param BkashRequest $paymentResponse
* @param mixed $paymentObject
* @return mixed
* @throws RenderBkashPHPException
*/
private function getResponse(BkashRequest $paymentResponse, mixed $paymentObject): mixed
{
return (new BkashResponse($paymentResponse, $paymentObject))->getResponse();
}
}

0 comments on commit cd0ce91

Please sign in to comment.