'le_'.uniqid(), 'name' => 'ООО Тест', 'legal_form' => 'OOO', 'inn' => '7700000000', ]); $resp = $this->putJson('/api/admin/payment-gateways/yookassa', [ 'shop_id' => 'shop_42', 'secret_key' => 'live_secret_value', 'is_active' => true, ]); $resp->assertOk(); $gw = PaymentGateway::where('code', 'yookassa')->firstOrFail(); expect($gw->is_active)->toBeTrue() ->and($gw->config)->not->toContain('live_secret_value') // зашифровано ->and(Crypt::decrypt($gw->config))->toBe(['shop_id' => 'shop_42', 'secret_key' => 'live_secret_value']); }); it('требует юрлицо перед созданием шлюза', function () { $resp = $this->putJson('/api/admin/payment-gateways/yookassa', [ 'shop_id' => 'shop_1', 'secret_key' => 'sk', 'is_active' => true, ]); $resp->assertStatus(422); });