diff --git a/app/Http/Requests/Payment/StorePaymentRequest.php b/app/Http/Requests/Payment/StorePaymentRequest.php index 01ddc9f72cd5..463086acefae 100644 --- a/app/Http/Requests/Payment/StorePaymentRequest.php +++ b/app/Http/Requests/Payment/StorePaymentRequest.php @@ -133,12 +133,6 @@ class StorePaymentRequest extends Request $input['idempotency_key'] = substr(sha1(json_encode($input)).time()."{$input['date']}{$input['amount']}{$user->id}", 0, 64); } - nlog($input); - $i = \App\Models\Invoice::find($input['invoices'][0]['invoice_id']); - nlog($i->client_id); - nlog($i->id); - nlog($user->company()->id); - nlog($i->company_id); $this->replace($input); } diff --git a/app/Livewire/RequiredClientInfo.php b/app/Livewire/RequiredClientInfo.php index c661bbcb8c53..5daabf4b29a3 100644 --- a/app/Livewire/RequiredClientInfo.php +++ b/app/Livewire/RequiredClientInfo.php @@ -222,6 +222,8 @@ class RequiredClientInfo extends Component $this->show_form = true; $hash = Cache::get(request()->input('hash')); + + /** @var \App\Models\Invoice $invoice */ $invoice = Invoice::find($this->decodePrimaryKey($hash['invoice_id'])); $this->invoice_terms = $invoice->terms; diff --git a/app/Models/CompanyUser.php b/app/Models/CompanyUser.php index c9e3aa74b9cd..4f8352e23bd9 100644 --- a/app/Models/CompanyUser.php +++ b/app/Models/CompanyUser.php @@ -202,7 +202,6 @@ class CompanyUser extends Pivot */ public function portalType(): bool { - nlog(isset($this->react_settings->react_notification_link) && $this->react_settings->react_notification_link); return isset($this->react_settings->react_notification_link) && $this->react_settings->react_notification_link; } diff --git a/app/PaymentDrivers/PaytracePaymentDriver.php b/app/PaymentDrivers/PaytracePaymentDriver.php index 05278300bc7c..293df56abd47 100644 --- a/app/PaymentDrivers/PaytracePaymentDriver.php +++ b/app/PaymentDrivers/PaytracePaymentDriver.php @@ -252,6 +252,30 @@ class PaytracePaymentDriver extends BaseDriver return false; } + public function getClientRequiredFields(): array + { + $fields = parent::getClientRequiredFields(); + + nlog("a"); + + nlog($fields); + + $fields[] = ['name' => 'client_address_line_1', 'label' => ctrans('texts.address1'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'client_city', 'label' => ctrans('texts.city'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'client_state', 'label' => ctrans('texts.state'), 'type' => 'text', 'validation' => 'required']; + $fields[] = ['name' => 'client_country_id', 'label' => ctrans('texts.country'), 'type' => 'text', 'validation' => 'required']; + + +nlog("b"); + +nlog($fields); + + return $fields; + } + + + + public function auth(): bool { try { diff --git a/app/Repositories/UserRepository.php b/app/Repositories/UserRepository.php index 8a4996e04506..c3a9313c5f08 100644 --- a/app/Repositories/UserRepository.php +++ b/app/Repositories/UserRepository.php @@ -206,7 +206,8 @@ class UserRepository extends BaseRepository ->first(); $cu->restore(); - + $cu->tokens()->restore(); + event(new UserWasRestored($user, auth()->user(), auth()->user()->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null))); } diff --git a/tests/Feature/EInvoice/FacturaeTest.php b/tests/Feature/EInvoice/FacturaeTest.php index 93128f632778..33fd81d67eaf 100644 --- a/tests/Feature/EInvoice/FacturaeTest.php +++ b/tests/Feature/EInvoice/FacturaeTest.php @@ -13,7 +13,6 @@ namespace Tests\Feature\EInvoice; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Routing\Middleware\ThrottleRequests; -use Illuminate\Support\Facades\Storage; use Tests\MockAccountData; use Tests\TestCase; diff --git a/tests/Feature/EInvoice/FatturaPATest.php b/tests/Feature/EInvoice/FatturaPATest.php index f6c63d0653ec..16b655931266 100644 --- a/tests/Feature/EInvoice/FatturaPATest.php +++ b/tests/Feature/EInvoice/FatturaPATest.php @@ -11,7 +11,7 @@ namespace Tests\Feature\EInvoice; -use App\Services\EInvoicing\Standards\FatturaPA; +use App\Services\EDocument\Standards\FatturaPA; use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Routing\Middleware\ThrottleRequests; use Tests\MockAccountData; diff --git a/tests/Feature/PaymentTest.php b/tests/Feature/PaymentTest.php index 2c662a67fcfa..49de5339b260 100644 --- a/tests/Feature/PaymentTest.php +++ b/tests/Feature/PaymentTest.php @@ -420,10 +420,9 @@ class PaymentTest extends TestCase public function testPaymentRESTEndPoints() { - Payment::factory()->create(['user_id' => $this->user->id, 'company_id' => $this->company->id, 'client_id' => $this->client->id]); - - $Payment = Payment::all()->last(); - + $Payment = Payment::factory()->create(['user_id' => $this->user->id, 'company_id' => $this->company->id, 'client_id' => $this->client->id]); + $Payment->name = \Illuminate\Support\Str::random(54); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), 'X-API-TOKEN' => $this->token,