1. Go to this page and download the library: Download eseperio/omnipay-redsys library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$gateway = Omnipay::create('Redsys');
$gateway->initialize([
'merchantId' => '123456789',
'merchantKey' => 'sq7HjrUOBfKmC576ILgskD5srU870gJ7',
...
]);
$notification = $gateway->acceptNotification();
if ($notification->getTransactionStatus() === NotificationInterface::STATUS_COMPLETED) {
// Payment was successful
$transactionReference = $notification->getTransactionReference();
// Do your stuff here
} else {
// Payment failed
$message = $notification->getMessage();
// Do your stuff here
}
$gateway = Omnipay::create('Sermepa');
$response = $gateway->completePurchase()->send();
if($response->isSuccessful()){
// The payment was successful
// Confirm your order or other stuff
$orderId = $response->getTransactionId();
// ...
}
// Set the payment method to BIZUM
$request->setPayMethod(PayMethods::PAY_METHOD_BIZUM);
// Bizum is only compatible with AUTHORIZATION transactions
$gateway->setTransactionType(TransactionTypes::AUTHORIZATION);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.