14-04-2026
This commit is contained in:
parent
f58c709945
commit
0f82fea88a
72 changed files with 7414 additions and 148 deletions
|
|
@ -22,6 +22,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property-read \App\Models\ShoppingPayment $shopping_payment
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\PaymentTransaction newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\PaymentTransaction newQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\PaymentTransaction query()
|
||||
|
|
@ -39,18 +40,20 @@ use Illuminate\Database\Eloquent\Model;
|
|||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\PaymentTransaction whereTxid($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\PaymentTransaction whereUpdatedAt($value)
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\PaymentTransaction whereUserid($value)
|
||||
*
|
||||
* @property string|null $mode
|
||||
*
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|\App\Models\PaymentTransaction whereMode($value)
|
||||
*
|
||||
* @mixin \Eloquent
|
||||
*/
|
||||
class PaymentTransaction extends Model
|
||||
{
|
||||
protected $table = 'payment_transactions';
|
||||
|
||||
|
||||
protected $casts = [
|
||||
'transmitted_data' => 'array'
|
||||
];
|
||||
'transmitted_data' => 'array',
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'shopping_payment_id',
|
||||
|
|
@ -67,9 +70,52 @@ class PaymentTransaction extends Model
|
|||
'mode',
|
||||
];
|
||||
|
||||
|
||||
public function shopping_payment()
|
||||
{
|
||||
return $this->belongsTo('App\Models\ShoppingPayment','shopping_payment_id');
|
||||
return $this->belongsTo('App\Models\ShoppingPayment', 'shopping_payment_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a human-readable description for known PAYONE error codes.
|
||||
*
|
||||
* @return array<int, string>
|
||||
*/
|
||||
public static function payoneErrorDescriptions(): array
|
||||
{
|
||||
return [
|
||||
2 => 'Allgemeiner Fehler',
|
||||
4 => 'Karte gesperrt',
|
||||
5 => 'Zahlung abgelehnt',
|
||||
12 => 'Ungültige Kartennummer',
|
||||
14 => 'Ungültige Kartendaten',
|
||||
33 => 'Karte abgelaufen',
|
||||
34 => 'Karte gesperrt/gestohlen',
|
||||
55 => 'Falsche PIN',
|
||||
56 => 'Kunde hat abgebrochen',
|
||||
58 => 'Transaktion nicht erlaubt',
|
||||
62 => 'Karte für internationale Transaktionen nicht zugelassen',
|
||||
104 => 'Karte für Online-Zahlungen nicht erlaubt',
|
||||
105 => 'Karte ungültig',
|
||||
120 => 'Falsche Prüfziffer (CVV)',
|
||||
130 => 'Limit überschritten',
|
||||
131 => 'Währung nicht unterstützt',
|
||||
135 => 'Bank antwortet nicht',
|
||||
136 => 'Bank nicht gefunden',
|
||||
137 => 'Betrag stimmt nicht überein',
|
||||
900 => '3D-Secure Authentifizierung fehlgeschlagen',
|
||||
902 => 'Bank hat abgelehnt',
|
||||
970 => 'Keine Antwort (Timeout)',
|
||||
4218 => 'Karte unter Betrugsverdacht',
|
||||
4219 => 'Transaktion von Kartenaussteller abgelehnt',
|
||||
];
|
||||
}
|
||||
|
||||
public function getErrorDescriptionAttribute(): ?string
|
||||
{
|
||||
if (! $this->errorcode) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return self::payoneErrorDescriptions()[(int) $this->errorcode] ?? null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue