In the database migration file, I used:
$gateway = new Gateway;
$gateway->name = ‘Bambora’;
$gateway->key = Str::lower(Str::random(32));
$gateway->provider = ‘Bambora’;
$gateway->is_offsite = true;
$gateway->fields = new \stdClass;
$gateway->visible = true;
$gateway->site_url = ‘https://web.na.bambora.com’;
$gateway->default_gateway_type_id = 1;
$gateway->save();
Then I ran
php artisan migrate
Migrating: 2021_07_04_062006_bambora
Error
Class ‘Gateway’ not found
at database/migrations/2021_07_04_062006_bambora.php:17
13▕ */
14▕ public function up()
15▕ {
16▕ // Add gateway record for Bambora
➜ 17▕ $gateway = new Gateway;
18▕ $gateway->name = 'Bambora';
19▕ $gateway->key = Str::lower(Str::random(32));
20▕ $gateway->provider = ‘Bambora’;
21▕ $gateway->is_offsite = true;
• A class import is missing: You have a missing class import. Try importing this class: App\Models\Gateway.
So I added
use App\Models\Gateway;
Running migrate again and I got a little further:
ERROR
Call to undefined method Dotenv\Util\Str::lower()
A class import is missing: You have a missing class import. Try importing this class: Dotenv\Util\Str
Success! Final code looked like this:
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use App\Models\Gateway; // Added line
use Illuminate\Support\Str; // Added line
class Bambora extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
// Add gateway record for Bambora
$gateway = new Gateway;
$gateway->name = 'Bambora';
$gateway->key = Str::lower(Str::random(32));
$gateway->provider = 'Bambora';
$gateway->is_offsite = true;
$gateway->fields = new \stdClass;
$gateway->visible = true;
$gateway->site_url = 'https://web.na.bambora.com';
$gateway->default_gateway_type_id = 1;
$gateway->save();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}
When I do Settings → Device Settings → Refresh, it fails with this error:
Error :: ‘[id, 57, name, Bambora, key, s5wpcmio3zjchi5xk6kenohykdkvfpja, provider, Bamb…’ to ‘minified:js’ failed due to: Deserializing ‘[]’ to ‘String’ failed due to: TypeError: Instance of ‘minified:Z’: type ‘minified:Z’ is not a subtype of type ‘String’
When I check the Gateway drop down list in the GUI, my new gateway is not there.
Why would the refresh fail after addeding the new record?
No luck with the /update?secret=
My new gateway does not appear in the list of gateways.
Am I supposed to append my key from the gateways table? I tried it with and without, but nothing.
It definitely worked once when things got all messed up.
When I do a grep -i bambora storage/framework/cache/data * -Rl on the files in the cache folder … it finds a match on this one file:
storage/framework/cache/data/4d/1c/4d1c9064b26ac53645286bdecd392fa851c36511
which was the messed up one. The files newer than this don’t have my bambora gateway in it.
Can I just remove the row from the gateways table and start the add process again?