diff --git a/tests/Feature/Console/Commands/ConfigCheckoutInstallCommandTest.php b/tests/Feature/Console/Commands/ConfigCheckoutInstallCommandTest.php index 35867cb..fa22168 100644 --- a/tests/Feature/Console/Commands/ConfigCheckoutInstallCommandTest.php +++ b/tests/Feature/Console/Commands/ConfigCheckoutInstallCommandTest.php @@ -15,19 +15,19 @@ class ConfigCheckoutInstallCommandTest extends TestCheckoutInstallCommand protected function makeSureProviderExists(Providable $provider) { - $config = require(config_path(Str::slug($this->checkoutService->id) . '.php')); + $config = require(config_path(Str::slug($this->checkoutConfig->id) . '.php')); $this->assertIsArray($config['providers']); $this->assertIsArray($config['providers'][$provider->getId()]); $this->assertEquals( - 'App\\Services\\' . Str::studly($this->checkoutService->id) . '\\' . Str::studly($provider->getId()) . Str::studly($this->checkoutService->id) . 'Request', + 'App\\Services\\' . Str::studly($this->checkoutConfig->id) . '\\' . Str::studly($provider->getId()) . Str::studly($this->checkoutConfig->id) . 'Request', $config['providers'][$provider->getId()]['gateway'] ); } protected function makeSureAccountExists(Accountable $account) { - $config = require(config_path(Str::slug($this->checkoutService->id) . '.php')); + $config = require(config_path(Str::slug($this->checkoutConfig->id) . '.php')); $this->assertIsArray($config['accounts']); $this->assertIsArray($config['accounts'][$account->getId()]); @@ -37,7 +37,7 @@ protected function makeSureAccountExists(Accountable $account) protected function makeSureProviderIsLinkedToAccount(Providable $provider, Accountable $account) { - $config = require(config_path(Str::slug($this->checkoutService->id) . '.php')); + $config = require(config_path(Str::slug($this->checkoutConfig->id) . '.php')); $this->assertIsArray($config['accounts'][$account->getId()]['providers'][$provider->getId()]); } diff --git a/tests/Feature/Console/Commands/DatabaseCheckoutInstallCommandTest.php b/tests/Feature/Console/Commands/DatabaseCheckoutInstallCommandTest.php index bab489e..0be5a01 100644 --- a/tests/Feature/Console/Commands/DatabaseCheckoutInstallCommandTest.php +++ b/tests/Feature/Console/Commands/DatabaseCheckoutInstallCommandTest.php @@ -30,7 +30,7 @@ protected function makeSureProviderExists(Providable $provider) $this->assertNotNull($provider); $this->assertEquals( - 'App\\Services\\' . Str::studly($this->checkoutService->id) . '\\' . Str::studly($provider->getId()) . Str::studly($this->checkoutService->id) . 'Request', + 'App\\Services\\' . Str::studly($this->checkoutConfig->id) . '\\' . Str::studly($provider->getId()) . Str::studly($this->checkoutConfig->id) . 'Request', $provider->gateway ); } @@ -62,8 +62,8 @@ private function migrate() return; } - Account::where('service_id', $this->checkoutService->id)->delete(); - Provider::where('service_id', $this->checkoutService->id)->delete(); + Account::where('service_id', $this->checkoutConfig->id)->delete(); + Provider::where('service_id', $this->checkoutConfig->id)->delete(); $this->artisan('migrate'); diff --git a/tests/Feature/Console/Commands/TestCheckoutInstallCommand.php b/tests/Feature/Console/Commands/TestCheckoutInstallCommand.php index 8242f3f..d6f5660 100644 --- a/tests/Feature/Console/Commands/TestCheckoutInstallCommand.php +++ b/tests/Feature/Console/Commands/TestCheckoutInstallCommand.php @@ -17,23 +17,23 @@ abstract class TestCheckoutInstallCommand extends TestCase implements CreatesSer #[Test] public function checkout_install_command_injects_checkout_service_into_orchestrate_service_command() { - $provider = $this->createProvider($this->checkoutService); - $account = $this->createAccount($this->checkoutService); + $provider = $this->createProvider($this->checkoutConfig); + $account = $this->createAccount($this->checkoutConfig); - $checkoutServiceConfig = $this->configPath($this->checkoutService); - $checkoutServiceContract = $this->contractPath($this->checkoutService); - $fakeGateway = $this->gatewayPath($this->checkoutService); - $providerGateway = $this->gatewayPath($this->checkoutService, $provider); + $checkoutServiceConfig = $this->configPath($this->checkoutConfig); + $checkoutServiceContract = $this->contractPath($this->checkoutConfig); + $fakeGateway = $this->gatewayPath($this->checkoutConfig); + $providerGateway = $this->gatewayPath($this->checkoutConfig, $provider); $ds = DIRECTORY_SEPARATOR; $this->artisan('checkout:install') - ->expectsQuestion("Choose a driver for the {$this->checkoutService->name} service.", Config::get('orchestration.defaults.driver')) - ->expectsQuestion("How should the {$this->checkoutService->name} provider be named?", $provider->getName()) - ->expectsQuestion("How should the {$this->checkoutService->name} provider be identified?", $provider->getId()) - ->expectsConfirmation("Would you like to add another {$this->checkoutService->name} provider?", 'no') - ->expectsQuestion("How should the {$this->checkoutService->name} account be named?", $account->getName()) - ->expectsQuestion("How should the {$this->checkoutService->name} account be identified?", $account->getId()) - ->expectsConfirmation("Would you like to add another {$this->checkoutService->name} account?", 'no') + ->expectsQuestion("Choose a driver for the {$this->checkoutConfig->name} service.", Config::get('orchestration.defaults.driver')) + ->expectsQuestion("How should the {$this->checkoutConfig->name} provider be named?", $provider->getName()) + ->expectsQuestion("How should the {$this->checkoutConfig->name} provider be identified?", $provider->getId()) + ->expectsConfirmation("Would you like to add another {$this->checkoutConfig->name} provider?", 'no') + ->expectsQuestion("How should the {$this->checkoutConfig->name} account be named?", $account->getName()) + ->expectsQuestion("How should the {$this->checkoutConfig->name} account be identified?", $account->getId()) + ->expectsConfirmation("Would you like to add another {$this->checkoutConfig->name} account?", 'no') ->expectsOutputToContain("Config [config{$ds}{$checkoutServiceConfig->orchestration}] created successfully.") ->expectsOutputToContain("Config [config{$ds}{$checkoutServiceConfig->service}] created successfully.") ->expectsOutputToContain("Contract [app{$ds}{$checkoutServiceContract->requester}] created successfully.") @@ -46,9 +46,9 @@ public function checkout_install_command_injects_checkout_service_into_orchestra $config = require(config_path($checkoutServiceConfig->service)); - $this->assertContractExists($this->checkoutService); - $this->assertGatewayExists($this->checkoutService); - $this->assertGatewayExists($this->checkoutService, $provider); + $this->assertContractExists($this->checkoutConfig); + $this->assertGatewayExists($this->checkoutConfig); + $this->assertGatewayExists($this->checkoutConfig, $provider); $this->assertEquals($provider->getId(), $config['defaults']['provider']); $this->assertEquals($account->getId(), $config['defaults']['account']); diff --git a/tests/Feature/Console/Commands/TestCheckoutProviderCommand.php b/tests/Feature/Console/Commands/TestCheckoutProviderCommand.php index be8838f..3fb249d 100644 --- a/tests/Feature/Console/Commands/TestCheckoutProviderCommand.php +++ b/tests/Feature/Console/Commands/TestCheckoutProviderCommand.php @@ -14,9 +14,9 @@ abstract class TestCheckoutProviderCommand extends TestCase implements CreatesSe #[Test] public function checkout_provider_command_injects_checkout_service_into_orchestrate_provider_command() { - $provider = $this->createProvider($this->checkoutService); + $provider = $this->createProvider($this->checkoutConfig); - $gateway = $this->gatewayPath($this->checkoutService, $provider); + $gateway = $this->gatewayPath($this->checkoutConfig, $provider); $ds = DIRECTORY_SEPARATOR; $this->artisan('checkout:provider', [ @@ -27,6 +27,6 @@ public function checkout_provider_command_injects_checkout_service_into_orchestr ->expectsOutputToContain("Gateway [app{$ds}{$gateway->response}] created successfully.") ->assertSuccessful(); - $this->assertGatewayExists($this->checkoutService, $provider); + $this->assertGatewayExists($this->checkoutConfig, $provider); } } diff --git a/tests/TestCase.php b/tests/TestCase.php index 08d3164..4d25c6f 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -13,7 +13,7 @@ class TestCase extends \Payavel\Orchestration\Tests\TestCase { use CreatesServices; - protected ServiceConfig $checkoutService; + protected ServiceConfig $checkoutConfig; protected function getPackageProviders($app) { @@ -42,7 +42,7 @@ protected function setUp(): void { parent::setUp(); - $this->checkoutService = $this->createServiceConfig([ + $this->checkoutConfig = $this->createServiceConfig([ 'name' => 'Checkout', 'id' => 'checkout', ]); diff --git a/tests/Unit/Database/PaymentModelTest.php b/tests/Unit/Database/PaymentModelTest.php index 04dd4c2..dc6c04a 100644 --- a/tests/Unit/Database/PaymentModelTest.php +++ b/tests/Unit/Database/PaymentModelTest.php @@ -22,8 +22,8 @@ class PaymentModelTest extends TestPaymentModel public function retrieve_payment_provider() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $paymentWithProvider = Payment::factory()->create($usingServiceables); @@ -38,8 +38,8 @@ public function retrieve_payment_provider() public function retrieve_payment_account() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $paymentWithAccount = Payment::factory()->create($usingServiceables); diff --git a/tests/Unit/Database/WalletModelTest.php b/tests/Unit/Database/WalletModelTest.php index db0186b..bbe2167 100644 --- a/tests/Unit/Database/WalletModelTest.php +++ b/tests/Unit/Database/WalletModelTest.php @@ -22,8 +22,8 @@ class WalletModelTest extends TestWalletModel public function retrieve_wallet_provider() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $walletWithProvider = Wallet::factory()->create($usingServiceables); @@ -38,8 +38,8 @@ public function retrieve_wallet_provider() public function retrieve_wallet_account() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $walletWithAccount = Wallet::factory()->create($usingServiceables); diff --git a/tests/Unit/TestBillableTrait.php b/tests/Unit/TestBillableTrait.php index 39c6e39..a7488b2 100644 --- a/tests/Unit/TestBillableTrait.php +++ b/tests/Unit/TestBillableTrait.php @@ -19,16 +19,16 @@ public function retrieve_billable_wallets() $this->assertEmpty($billable->wallets); $billableWith2Wallets = User::factory()->has(Wallet::factory()->count(2)->sequence(fn () => [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]))->create(); $this->assertCount(2, $billableWith2Wallets->wallets); $this->assertContainsOnlyInstancesOf(Wallet::class, $billableWith2Wallets->wallets); ServiceConfig::find('checkout')->set('models.'.Wallet::class, TestWallet::class); $billableWith3OverriddenWallets = User::factory()->has(Wallet::factory()->count(3)->sequence(fn () => [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]))->create(); $this->assertCount(3, $billableWith3OverriddenWallets->wallets); $this->assertContainsOnlyInstancesOf(TestWallet::class, $billableWith3OverriddenWallets->wallets); diff --git a/tests/Unit/TestCheckoutGateway.php b/tests/Unit/TestCheckoutGateway.php index 42d8018..4ae41e8 100644 --- a/tests/Unit/TestCheckoutGateway.php +++ b/tests/Unit/TestCheckoutGateway.php @@ -26,15 +26,15 @@ protected function setUp(): void { parent::setUp(); - $provider = $this->createProvider($this->checkoutService, [ + $provider = $this->createProvider($this->checkoutConfig, [ 'gateway' => TestCheckoutRequest::class, ]); - $account = $this->createAccount($this->checkoutService); + $account = $this->createAccount($this->checkoutConfig); $this->linkAccountToProvider($account, $provider); - $this->setDefaultsForService($this->checkoutService, $account, $provider); + $this->setDefaultsForService($this->checkoutConfig, $account, $provider); } #[Test] diff --git a/tests/Unit/TestDisputeModel.php b/tests/Unit/TestDisputeModel.php index 321fdd8..6989d16 100644 --- a/tests/Unit/TestDisputeModel.php +++ b/tests/Unit/TestDisputeModel.php @@ -18,8 +18,8 @@ abstract class TestDisputeModel extends TestCase implements CreatesServiceables public function retrieve_dispute_payment() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getID(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getID(), ]; $disputeWithPayment = Dispute::factory()->for(Payment::factory()->create($usingServiceables))->create(); @@ -34,8 +34,8 @@ public function retrieve_dispute_payment() public function retrieve_dispute_transaction_events() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getID(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getID(), ]; $dispute = Dispute::factory()->for(Payment::factory()->create($usingServiceables))->create(); diff --git a/tests/Unit/TestPaymentInstrumentModel.php b/tests/Unit/TestPaymentInstrumentModel.php index a2b1a84..d2264b1 100644 --- a/tests/Unit/TestPaymentInstrumentModel.php +++ b/tests/Unit/TestPaymentInstrumentModel.php @@ -20,8 +20,8 @@ abstract class TestPaymentInstrumentModel extends TestCase implements CreatesSer public function retrieve_payment_instrument_wallet() { $wallet = Wallet::factory()->create([ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]); $paymentInstrumentWithWallet = PaymentInstrument::factory()->for($wallet)->create(); @@ -36,8 +36,8 @@ public function retrieve_payment_instrument_wallet() public function retrieve_payment_instrument_type() { $wallet = Wallet::factory()->create([ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]); $paymentInstrumentWithType = PaymentInstrument::factory()->for($wallet)->create(); @@ -52,8 +52,8 @@ public function retrieve_payment_instrument_type() public function retrieve_payment_instrument_payments() { $wallet = Wallet::factory()->create([ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]); $paymentInstrument = PaymentInstrument::factory()->for($wallet)->create(); diff --git a/tests/Unit/TestPaymentModel.php b/tests/Unit/TestPaymentModel.php index c3f590d..5fc08b7 100644 --- a/tests/Unit/TestPaymentModel.php +++ b/tests/Unit/TestPaymentModel.php @@ -24,8 +24,8 @@ abstract class TestPaymentModel extends TestCase implements CreatesServiceables public function retrieve_payment_rail() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $paymentWithRail = Payment::factory()->create($usingServiceables); @@ -40,8 +40,8 @@ public function retrieve_payment_rail() public function retrieve_payment_instrument() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $payment = Payment::factory()->create($usingServiceables); @@ -59,8 +59,8 @@ public function retrieve_payment_instrument() public function retrieve_payment_events() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $payment = Payment::factory()->create($usingServiceables); @@ -80,8 +80,8 @@ public function retrieve_payment_events() public function retrieve_payment_transaction_events() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $payment = Payment::factory()->create($usingServiceables); @@ -101,8 +101,8 @@ public function retrieve_payment_transaction_events() public function retrieve_payment_providable() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $payment = Payment::factory()->create($usingServiceables); @@ -113,8 +113,8 @@ public function retrieve_payment_providable() public function retrieve_payment_accountable() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $payment = Payment::factory()->create($usingServiceables); diff --git a/tests/Unit/TestPaymentRailModel.php b/tests/Unit/TestPaymentRailModel.php index 28506ae..989748f 100644 --- a/tests/Unit/TestPaymentRailModel.php +++ b/tests/Unit/TestPaymentRailModel.php @@ -67,8 +67,8 @@ public function retrieve_payment_rail_type() public function retrieve_payment_rail_payments() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $paymentRail = PaymentRail::factory()->create(); diff --git a/tests/Unit/TestPaymentTypeModel.php b/tests/Unit/TestPaymentTypeModel.php index 26d5eca..6d370c9 100644 --- a/tests/Unit/TestPaymentTypeModel.php +++ b/tests/Unit/TestPaymentTypeModel.php @@ -35,8 +35,8 @@ public function retrieve_payment_type_rails() public function retrieve_payment_type_instruments() { $wallet = Wallet::factory()->create([ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]); $paymentType = PaymentType::factory()->create(); diff --git a/tests/Unit/TestRefundModel.php b/tests/Unit/TestRefundModel.php index 616efb9..8388e7e 100644 --- a/tests/Unit/TestRefundModel.php +++ b/tests/Unit/TestRefundModel.php @@ -18,8 +18,8 @@ abstract class TestRefundModel extends TestCase implements CreatesServiceables public function retrieve_refund_payment() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $refundWithPayment = Refund::factory()->for(Payment::factory()->create($usingServiceables))->create(); @@ -34,8 +34,8 @@ public function retrieve_refund_payment() public function retrieve_refund_transaction_events() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $refund = Refund::factory()->for(Payment::factory()->create($usingServiceables))->create(); diff --git a/tests/Unit/TestTransactionEventModel.php b/tests/Unit/TestTransactionEventModel.php index 3b81ce7..26b4f18 100644 --- a/tests/Unit/TestTransactionEventModel.php +++ b/tests/Unit/TestTransactionEventModel.php @@ -20,8 +20,8 @@ abstract class TestTransactionEventModel extends TestCase implements CreatesServ public function retrieve_transaction_event_payment() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $transactionEventWithPayment = TransactionEvent::factory()->for(Payment::factory()->create($usingServiceables))->create(['status_code' => CheckoutStatus::AUTHORIZED]); @@ -36,8 +36,8 @@ public function retrieve_transaction_event_payment() public function retrieve_transaction_event_transactionable() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $transactionEvent = TransactionEvent::factory()->for(Payment::factory()->create($usingServiceables))->create(['status_code' => CheckoutStatus::AUTHORIZED]); diff --git a/tests/Unit/TestWalletModel.php b/tests/Unit/TestWalletModel.php index d2801a4..21b9418 100644 --- a/tests/Unit/TestWalletModel.php +++ b/tests/Unit/TestWalletModel.php @@ -24,8 +24,8 @@ abstract class TestWalletModel extends TestCase implements CreatesServiceables public function retrieve_wallet_billable() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $wallet = Wallet::factory()->create($usingServiceables); @@ -40,8 +40,8 @@ public function retrieve_wallet_billable() public function retrieve_wallet_payment_instruments() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $wallet = Wallet::factory()->create($usingServiceables); @@ -61,8 +61,8 @@ public function retrieve_wallet_payment_instruments() public function retrieve_wallet_providable() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $wallet = Wallet::factory()->create($usingServiceables); @@ -73,8 +73,8 @@ public function retrieve_wallet_providable() public function retrieve_wallet_accountable() { $usingServiceables = [ - 'provider_id' => $this->createProvider($this->checkoutService)->getId(), - 'account_id' => $this->createAccount($this->checkoutService)->getId(), + 'provider_id' => $this->createProvider($this->checkoutConfig)->getId(), + 'account_id' => $this->createAccount($this->checkoutConfig)->getId(), ]; $wallet = Wallet::factory()->create($usingServiceables);