Fixes for flow2

This commit is contained in:
David Bomba 2024-09-05 15:55:14 +10:00
parent 63f3115a02
commit 45553416de
4 changed files with 14 additions and 14 deletions

View File

@ -55,7 +55,6 @@ class ProcessPayment extends Component
$company_gateway = CompanyGateway::find($this->getContext()['company_gateway_id']); $company_gateway = CompanyGateway::find($this->getContext()['company_gateway_id']);
if (!$responder_data['success']) { if (!$responder_data['success']) {
nlog("ouchiees");
throw new PaymentFailed($responder_data['error'], 400); throw new PaymentFailed($responder_data['error'], 400);
} }

View File

@ -54,8 +54,6 @@ class PayPalRestPaymentDriver extends PayPalBasePaymentDriver
$request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']); $request['gateway_response'] = str_replace("Error: ", "", $request['gateway_response']);
$response = json_decode($request['gateway_response'], true); $response = json_decode($request['gateway_response'], true);
nlog($response);
if($request->has('token') && strlen($request->input('token')) > 2) { if($request->has('token') && strlen($request->input('token')) > 2) {
return $this->processTokenPayment($request, $response); return $this->processTokenPayment($request, $response);
} }

View File

@ -70,7 +70,7 @@ class PaymentMethod
$transformed_ids = $this->transformKeys(explode(',', $company_gateways)); $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
//gateways disabled //gateways disabled
if($company_gateways == '0') { if ($company_gateways == '0') {
$transformed_ids = []; $transformed_ids = [];
} }
@ -105,7 +105,7 @@ class PaymentMethod
if ($company_gateways || $company_gateways == '0') { if ($company_gateways || $company_gateways == '0') {
$transformed_ids = $this->transformKeys(explode(',', $company_gateways)); $transformed_ids = $this->transformKeys(explode(',', $company_gateways));
if($company_gateways == '0') { if ($company_gateways == '0') {
$transformed_ids = []; $transformed_ids = [];
} }
@ -158,7 +158,7 @@ class PaymentMethod
$this->payment_methods = $payment_methods_collections->intersectByKeys($payment_methods_collections->flatten(1)->unique()); $this->payment_methods = $payment_methods_collections->intersectByKeys($payment_methods_collections->flatten(1)->unique());
//@15-06-2024 //@15-06-2024
foreach($this->payment_methods as $key => $type) { foreach ($this->payment_methods as $key => $type) {
foreach ($type as $gateway_id => $gateway_type_id) { foreach ($type as $gateway_id => $gateway_type_id) {
$gate = $this->gateways->where('id', $gateway_id)->first(); $gate = $this->gateways->where('id', $gateway_id)->first();
$this->buildUrl($gate, $gateway_type_id); $this->buildUrl($gate, $gateway_type_id);
@ -183,14 +183,6 @@ class PaymentMethod
} }
} }
} }
if (($this->client->getSetting('use_credits_payment') == 'option' || $this->client->getSetting('use_credits_payment') == 'always') && $this->client->service()->getCreditBalance() > 0) {
$this->payment_urls[] = [
'label' => ctrans('texts.apply_credit'),
'company_gateway_id' => CompanyGateway::GATEWAY_CREDIT,
'gateway_type_id' => GatewayType::CREDIT,
];
}
if (($this->client->getSetting('use_credits_payment') == 'option' || $this->client->getSetting('use_credits_payment') == 'always') && $this->client->service()->getCreditBalance() > 0) { if (($this->client->getSetting('use_credits_payment') == 'option' || $this->client->getSetting('use_credits_payment') == 'always') && $this->client->service()->getCreditBalance() > 0) {
// Show credits as only payment option if both statements are true. // Show credits as only payment option if both statements are true.

View File

@ -0,0 +1,11 @@
<div class="rounded-lg border bg-card text-card-foreground shadow-sm overflow-hidden px-4 py-5 bg-white sm:gap-4 sm:px-6">
<h2 class="font-semibold tracking-tight group flex items-center gap-2 text-lg mb-3">
{{ ctrans('texts.error') }}
</h2>
<h3>
{{ $errorMessage }}
</h3>
</div>