checkout.com payments using token

This commit is contained in:
Benjamin Beganović 2020-10-27 13:44:16 +01:00
parent 97db2ad3b6
commit 88b428aae0
4 changed files with 6 additions and 6 deletions

View File

@ -309,11 +309,11 @@ class BaseDriver extends AbstractPaymentDriver
); );
SystemLogger::dispatch( SystemLogger::dispatch(
$this->checkout->payment_hash, $gateway->payment_hash,
SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::CATEGORY_GATEWAY_RESPONSE,
SystemLog::EVENT_GATEWAY_ERROR, SystemLog::EVENT_GATEWAY_ERROR,
$gateway::SYSTEM_LOG_TYPE, $gateway::SYSTEM_LOG_TYPE,
$this->checkout->client, $gateway->client,
); );
throw new PaymentFailed($error, $e->getCode()); throw new PaymentFailed($error, $e->getCode());

View File

@ -146,7 +146,7 @@ class CreditCard
} catch (\Checkout\Library\Exceptions\CheckoutHttpException $e) { } catch (\Checkout\Library\Exceptions\CheckoutHttpException $e) {
$this->checkout->unWindGatewayFees($this->checkout->payment_hash); $this->checkout->unWindGatewayFees($this->checkout->payment_hash);
return $this->processInternallyFailedPayment($e); return $this->checkout->processInternallyFailedPayment($this->checkout, $e);
} }
} }
} }

View File

@ -134,11 +134,11 @@ trait Utilities
$data = [ $data = [
'payment_meta' => $payment_meta, 'payment_meta' => $payment_meta,
'token' => $response->id, 'token' => $response->source['id'],
'payment_method_id' => $this->checkout->payment_hash->data->payment_method_id, 'payment_method_id' => $this->checkout->payment_hash->data->payment_method_id,
]; ];
return $this->checokut->saveCard($data); return $this->checkout->storePaymentMethod($data);
} catch (\Exception $e) { } catch (\Exception $e) {
session()->flash('message', ctrans('texts.payment_method_saving_failed')); session()->flash('message', ctrans('texts.payment_method_saving_failed'));
} }

View File

@ -24,7 +24,7 @@
<input type="hidden" name="raw_value" value="{{ $raw_value }}"> <input type="hidden" name="raw_value" value="{{ $raw_value }}">
<input type="hidden" name="currency" value="{{ $currency }}"> <input type="hidden" name="currency" value="{{ $currency }}">
@isset($token) @isset($token)
<input type="hidden" name="token" value="{{ $token->meta->id }}"> <input type="hidden" name="token" value="{{ $token->token }}">
@endisset @endisset
</form> </form>