PHP code example of stephenjude / laravel-payment-gateways
1. Go to this page and download the library: Download stephenjude/laravel-payment-gateways 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/ */
stephenjude / laravel-payment-gateways example snippets
use Stephenjude\PaymentGateway\DataObjects\TransactionData;
function (TransactionData $payment){
$order->update([
'status' => $payment->status,
'amount' => $payment->amount,
'currency' => $payment->currency
]);
$customer->notify(new OrderPaymentNotification($order));
}
use Stephenjude\PaymentGateway\PaymentGateway;
use Stephenjude\PaymentGateway\DataObjects\TransactionData;
$provider = PaymentGateway::make('paystack')
$paymentSession = $provider->initializeCheckout([
'currency' => 'NGN', // yment verification happens immediately after the customer makes payment.
* The payment data obtained from the verification will be injected into this closure.
*/
logger('payment details', [
'currency' => $payment->currency,
'amount' => $payment->amount,
'status' => $payment->status,
'reference' => $payment->reference,
'provider' => $payment->provider,
'date' => $payment->date,
]);
},
]);
$paymentSession->provider;
$paymentSession->checkoutUrl;
$paymentSession->expires;