mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 11:04:30 -04:00
Minor fixes
This commit is contained in:
parent
0c11e1a932
commit
9c672e9bb1
@ -113,25 +113,25 @@ class BACS
|
|||||||
return $this->processSuccessfulPayment($state['payment_intent']);
|
return $this->processSuccessfulPayment($state['payment_intent']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->processUnsuccessfulPayment("");
|
return $this->processUnsuccessfulPayment("An unknown error occured.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public function processSuccessfulPayment($payment_id)
|
public function processSuccessfulPayment($payment_intent)
|
||||||
{
|
{
|
||||||
UpdateCustomer::dispatch($this->stripe->company_gateway->company->company_key, $this->stripe->company_gateway->id, $this->stripe->client->id);
|
UpdateCustomer::dispatch($this->stripe->company_gateway->company->company_key, $this->stripe->company_gateway->id, $this->stripe->client->id);
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'payment_method' => $payment_id['id'],
|
'payment_method' => $payment_intent['id'],
|
||||||
'payment_type' => PaymentType::BACS,
|
'payment_type' => PaymentType::BACS,
|
||||||
'amount' => $this->stripe->convertFromStripeAmount($payment_id->amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
'amount' => $this->stripe->convertFromStripeAmount($payment_intent->amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
||||||
'transaction_reference' => $payment_id['id'],
|
'transaction_reference' => $payment_intent['id'],
|
||||||
'gateway_type_id' => GatewayType::BACS,
|
'gateway_type_id' => GatewayType::BACS,
|
||||||
];
|
];
|
||||||
|
|
||||||
$payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
$payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
||||||
|
|
||||||
SystemLogger::dispatch(
|
SystemLogger::dispatch(
|
||||||
['response' => $payment_id, 'data' => $data],
|
['response' => $payment_intent, 'data' => $data],
|
||||||
SystemLog::CATEGORY_GATEWAY_RESPONSE,
|
SystemLog::CATEGORY_GATEWAY_RESPONSE,
|
||||||
SystemLog::EVENT_GATEWAY_SUCCESS,
|
SystemLog::EVENT_GATEWAY_SUCCESS,
|
||||||
SystemLog::TYPE_STRIPE,
|
SystemLog::TYPE_STRIPE,
|
||||||
|
@ -263,7 +263,7 @@ class StripePaymentDriver extends BaseDriver
|
|||||||
&& $this->client->currency()
|
&& $this->client->currency()
|
||||||
&& in_array($this->client->currency()->code, ['EUR', 'DKK', 'GBP', 'NOK', 'SEK', 'AUD', 'NZD', 'CAD', 'PLN', 'CHF', 'USD'])
|
&& in_array($this->client->currency()->code, ['EUR', 'DKK', 'GBP', 'NOK', 'SEK', 'AUD', 'NZD', 'CAD', 'PLN', 'CHF', 'USD'])
|
||||||
&& isset($this->client->country)
|
&& isset($this->client->country)
|
||||||
&& in_array($this->client->company->country()->getID(), ['840'])
|
&& in_array($this->client->company->country()->id, ['840'])
|
||||||
&& in_array($this->client->country->iso_3166_3, ['AUT','BEL','DNK','FIN','FRA','DEU','IRL','ITA','NLD','NOR','ESP','SWE','GBR','USA'])) {
|
&& in_array($this->client->country->iso_3166_3, ['AUT','BEL','DNK','FIN','FRA','DEU','IRL','ITA','NLD','NOR','ESP','SWE','GBR','USA'])) {
|
||||||
$types[] = GatewayType::KLARNA;
|
$types[] = GatewayType::KLARNA;
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,9 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
<div class="alert alert-failure mb-4" hidden id="errors"></div>
|
||||||
|
@component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.method')])
|
||||||
|
{{ ctrans('texts.bacs') }}
|
||||||
|
@endcomponent
|
||||||
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'authorize-bacs'])
|
@component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'authorize-bacs'])
|
||||||
{{ ctrans('texts.add_payment_method') }}
|
{{ ctrans('texts.add_payment_method') }}
|
||||||
@endcomponent
|
@endcomponent
|
||||||
|
Loading…
x
Reference in New Issue
Block a user