1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00
This commit is contained in:
David Bomba 2023-12-18 15:37:03 +11:00
parent c026704e83
commit 3365e93da0
2 changed files with 7 additions and 12 deletions

View File

@ -137,7 +137,7 @@ class ACSS
* Generates a token Payment Intent
*
* @param ClientGatewayToken $token
* @return void
* @return PaymentIntent
*/
private function tokenIntent(ClientGatewayToken $token): PaymentIntent
{
@ -223,7 +223,6 @@ class ACSS
* Continues the payment flow after a Mandate has been successfully generated
*
* @param array $data
* @return void
*/
private function continuePayment(array $data)
{
@ -260,7 +259,7 @@ class ACSS
/**
* PaymentResponseRequest
*
* @param mixed $request
* @param PaymentResponseRequest $request
*/
public function paymentResponse(PaymentResponseRequest $request)
{
@ -269,7 +268,7 @@ class ACSS
$cgt = ClientGatewayToken::find($this->decodePrimaryKey($request->token));
/** @var Stripe\PaymentIntent $intent */
/** @var \Stripe\PaymentIntent $intent */
$intent = $this->tokenIntent($cgt);
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all());
@ -298,7 +297,7 @@ class ACSS
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $stripe_amount]);
$this->stripe->payment_hash->save();
/** @var Stripe\PaymentIntent $intent */
/** @var \Stripe\PaymentIntent $intent */
$intent = $this->tokenIntent($cgt);
if ($intent->status && $intent->status == 'processing') {
@ -316,9 +315,8 @@ class ACSS
* Creates a payment for the transaction
*
* @param string $payment_intent
* @return Illuminate\Http\RedirectResponse
*/
public function processSuccessfulPayment(string $payment_intent): \Illuminate\Http\RedirectResponse
public function processSuccessfulPayment(string $payment_intent)
{
$data = [
'payment_method' => $payment_intent,

View File

@ -102,12 +102,9 @@ class Charge
];
switch ($e) {
/** @var \Stripe\Exception\CardException $e */
case $e instanceof CardException:
$data['status'] = $e->getHttpStatus();
$data['error_type'] = $e->getError()->type;
$data['error_code'] = $e->getError()->code;
$data['param'] = $e->getError()->param;
$data['message'] = $e->getError()->message;
$data['message'] = $e->getError()->message ?? $e->getMessage();
break;
case $e instanceof RateLimitException:
$data['message'] = 'Too many requests made to the API too quickly';