1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-14 15:13:29 +01:00
invoiceninja/app/Ninja/PaymentDrivers/SkrillPaymentDriver.php

29 lines
720 B
PHP
Raw Normal View History

2017-01-30 20:40:43 +01:00
<?php
namespace App\Ninja\PaymentDrivers;
2017-01-16 18:46:47 +01:00
use Utils;
class SkrillPaymentDriver extends BasePaymentDriver
{
protected function paymentDetails($paymentMethod = false)
{
$data = parent::paymentDetails($paymentMethod);
$locale = strtoupper(Utils::getLocaleRegion());
2017-01-30 17:05:31 +01:00
if (! in_array($locale, ['EN', 'DE', 'ES', 'FR', 'IT', 'PL', 'GR', 'RO', 'RU', 'TR', 'CN', 'CZ', 'NL', 'DA', 'SV', 'FI'])) {
2017-01-16 18:46:47 +01:00
$locale = 'EN';
}
$details = [];
foreach ($this->invoice()->invoice_items as $item) {
$details[$item->product_key] = $item->notes;
}
$data['language'] = $locale;
$data['details'] = $details;
return $data;
}
}