diff --git a/database/migrations/2021_09_20_233053_set_square_test_mode_boolean.php b/database/migrations/2021_09_20_233053_set_square_test_mode_boolean.php new file mode 100644 index 0000000000..bdf714f1f1 --- /dev/null +++ b/database/migrations/2021_09_20_233053_set_square_test_mode_boolean.php @@ -0,0 +1,52 @@ +where('deleted_at', '0000-00-00 00:00:00.000000')->update(['deleted_at' => null]); + Quote::withTrashed()->where('deleted_at', '0000-00-00 00:00:00.000000')->update(['deleted_at' => null]); + Credit::withTrashed()->where('deleted_at', '0000-00-00 00:00:00.000000')->update(['deleted_at' => null]); + + } + + // fixes a bool cast to string back to bool + if($gateway = Gateway::find(57)) + { + $fields = json_decode($gateway->fields); + $fields->testMode = false; + + $gateway->fields = json_encode($fields); + $gateway->save(); + } + } +} diff --git a/database/seeders/PaymentLibrariesSeeder.php b/database/seeders/PaymentLibrariesSeeder.php index eff7a29a5d..17a9ac1735 100644 --- a/database/seeders/PaymentLibrariesSeeder.php +++ b/database/seeders/PaymentLibrariesSeeder.php @@ -80,7 +80,7 @@ class PaymentLibrariesSeeder extends Seeder ['id' => 53, 'name' => 'PagSeguro', 'provider' => 'PagSeguro', 'key' => 'ef498756b54db63c143af0ec433da803', 'fields' => '{"email":"","token":"","sandbox":false}'], ['id' => 54, 'name' => 'PAYMILL', 'provider' => 'Paymill', 'key' => 'ca52f618a39367a4c944098ebf977e1c', 'fields' => '{"apiKey":""}'], ['id' => 55, 'name' => 'Custom', 'provider' => 'Custom', 'is_offsite' => true, 'sort_order' => 21, 'key' => '54faab2ab6e3223dbe848b1686490baa', 'fields' => '{"name":"","text":""}'], - ['id' => 57, 'name' => 'Square', 'provider' => 'Square', 'is_offsite' => false, 'sort_order' => 21, 'key' => '65faab2ab6e3223dbe848b1686490baz', 'fields' => '{"accessToken":"","applicationId":"","locationId":"","testMode":"false"}'], + ['id' => 57, 'name' => 'Square', 'provider' => 'Square', 'is_offsite' => false, 'sort_order' => 21, 'key' => '65faab2ab6e3223dbe848b1686490baz', 'fields' => '{"accessToken":"","applicationId":"","locationId":"","testMode":false}'], ]; foreach ($gateways as $gateway) {