Silverstripe Version: 4.2.1
Question:
Has anyone got MIGs omnipay gateway working with Silverstripe 4?
or for that matter will silverstripe/silverstripe-omnipay work with omnipay v3? the docs imply that it will only work with omnipay 2.4.
Silverstripe Version: 4.2.1
Question:
Has anyone got MIGs omnipay gateway working with Silverstripe 4?
or for that matter will silverstripe/silverstripe-omnipay work with omnipay v3? the docs imply that it will only work with omnipay 2.4.
It looks like the silverstripe/silverstripe-omnipay
module is compatible with Omnipay 3.x. The module’s documentation mentions that it supports Omnipay 2.4 and above, which includes version 3.x.
To use the MIGS gateway with silverstripe/silverstripe-omnipay
, you will need to install the omnipay/migs
package via Composer. Once you have done this, you should be able to use the MIGS gateway with the silverstripe/silverstripe-omnipay
module in your SilverStripe 4 project.
Here is an example of how you can use the MIGS gateway with silverstripe/silverstripe-omnipay
:
use Omnipay\Omnipay;
// Set up the gateway
$gateway = Omnipay::create('Migs_ThreeParty');
$gateway->setMerchantId('your_merchant_id');
$gateway->setMerchantAccessCode('your_merchant_access_code');
$gateway->setSecureHash('your_secure_hash');
// Start the purchase process
$response = $gateway->purchase(array(
'amount' => '10.00',
'currency' => 'USD',
'returnUrl' => 'https://www.example.com/return',
'notifyUrl' => 'https://www.example.com/notify',
))->send();
// Process the response
if ($response->isSuccessful()) {
// Payment was successful
print_r($response);
} elseif ($response->isRedirect()) {
// Redirect to offsite payment gateway
$response->redirect();
} else {
// Payment failed
echo $response->getMessage();
}