Add customer to sofort payments

This commit is contained in:
David Bomba 2021-09-15 14:39:34 +10:00
parent 882cf1d734
commit a3e0d57133
4 changed files with 3 additions and 1 deletions

View File

@ -75,7 +75,6 @@ class Client extends BaseModel implements HasLocalePreference
'shipping_postal_code', 'shipping_postal_code',
'shipping_country_id', 'shipping_country_id',
'settings', 'settings',
'payment_terms',
'vat_number', 'vat_number',
'id_number', 'id_number',
'group_settings_id', 'group_settings_id',

View File

@ -42,6 +42,7 @@ class SOFORT
$data['return_url'] = $this->buildReturnUrl(); $data['return_url'] = $this->buildReturnUrl();
$data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency()); $data['stripe_amount'] = $this->stripe->convertToStripeAmount($data['total']['amount_with_fee'], $this->stripe->client->currency()->precision, $this->stripe->client->currency());
$data['client'] = $this->stripe->client; $data['client'] = $this->stripe->client;
$data['customer'] = $this->stripe->findOrCreateCustomer()->id;
$data['country'] = $this->stripe->client->country->iso_3166_2; $data['country'] = $this->stripe->client->country->iso_3166_2;
$this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]); $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['stripe_amount' => $data['stripe_amount']]);

View File

@ -27,6 +27,7 @@ class ProcessSOFORT {
handle = () => { handle = () => {
let data = { let data = {
type: 'sofort', type: 'sofort',
customer: document.querySelector('meta[name="customer"]').content,
amount: document.querySelector('meta[name="amount"]').content, amount: document.querySelector('meta[name="amount"]').content,
currency: 'eur', currency: 'eur',
redirect: { redirect: {

View File

@ -6,6 +6,7 @@
<meta name="return-url" content="{{ $return_url }}"> <meta name="return-url" content="{{ $return_url }}">
<meta name="amount" content="{{ $stripe_amount }}"> <meta name="amount" content="{{ $stripe_amount }}">
<meta name="country" content="{{ $country }}"> <meta name="country" content="{{ $country }}">
<meta name="customer" content="{{ $customer }}">
@endsection @endsection
@section('gateway_content') @section('gateway_content')