When getting ready to add a gateway, the first thing you'll want to do is find out what your gateway type is and what credentials you need to set it up. You can get a list of support gateways and options from Spreedly if you prefer.
Spreedly::gateway()->setup();
To see the gateways that you've created, you'd make the following call. The gateways returned will be sorted by created_at and then token. It returns the oldest 20 gateways.
Spreedly::gateway()->all();
// If you have more than 20 gateways, you can always paginate to get the remainder after the token specified.
Spreedly::gateway()->all($gatewayToken);
Get a specific gateway that has already been created.
Spreedly::gateway()->show();
If needed, use Spreedly::gateway()->setup()
to get a list of gateways and their configs.
// Example: Create a 'Test' Gateway.
Spreedly::gateway()->create('test');
// Example: Create a 'PayPal' Gateway.
Spreedly::gateway()->create('paypal', [
'mode' => 'delegate',
'email' => 'your_paypal_email_address'
]);
You can't update a gateway's type, but you can update its credentials if they change.
Spreedly::gateway($gatewayToken)->update([
'login' => 'new_login',
'password' => 'new_password'
]);
Gateways can't be deleted (since they're permanently associated with any transactions run against them), but the sensitive credential information in them can be redacted so that they're inactive.
Spreedly::gateway($gatewayToken)->disable();