Skip to content

Commit

Permalink
paio di fix per satispay
Browse files Browse the repository at this point in the history
  • Loading branch information
madbob committed Nov 13, 2023
1 parent 66f92c6 commit d40a7a6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
16 changes: 9 additions & 7 deletions code/app/Http/Controllers/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@ public function statusPaymentSatispay(Request $request)
$charge_id = $request->input('payment_id');
$charge = \SatispayGBusiness\Payment::get($charge_id);

if ($charge->status == 'ACCEPTED') {
$movement = Cache::pull('satispay_movement_' . $charge_id);
if ($movement != null) {
$movement->save();
}
else {
Log::error('Richiesta Satispay non trovata in cache: ' . $charge_id);
foreach($charge->data as $d) {
if ($d->status == 'ACCEPTED') {
$movement = Cache::pull('satispay_movement_' . $d->id);
if ($movement != null) {
$movement->save();
}
else {
Log::error('Richiesta Satispay non trovata in cache: ' . $charge_id);
}
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions code/app/Parameters/MovementType/UserCredit.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public function initNew($type)
'master' => $this->format(['bank' => 'increment']),
'is_default' => true,
],
(object) [
'method' => 'satispay',
'target' => $this->format(['bank' => 'increment']),
'master' => $this->format(['satispay' => 'increment']),
],
]));

return $type;
Expand Down
2 changes: 1 addition & 1 deletion code/resources/views/movement/modal.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@

<x-larastrap::datepicker name="date" :label="_i('Data')" defaults_now="true" />

<div class="when-method-bank {{ $obj->method != 'bank' ? ' hidden' : '' }}">
<div class="when-method-bank when-method-satispay {{ in_array($obj->method, ['bank', 'satispay']) ? ' hidden' : '' }}">
<x-larastrap::text name="identifier" :label="_i('Identificativo')" />
</div>

Expand Down

0 comments on commit d40a7a6

Please sign in to comment.