Closed midascodebreaker closed 8 years ago
it still has some bug... few days later....
Hello @midascodebreaker
yout could try....
Yes I would try to test now... would post some comment later thanks
okay
I tried to
composer require recca0120/laravel-payum payum/offline payum/paypal-express-checkout-nvp
then did publish
php artisan vendor publish
then do migrate.
php artisan migrate
then create controller...
php artisan make:controller PaymentController
namespace App\Http\Controllers;
use Illuminate\Routing\Controller as BaseController;
use Recca0120\LaravelPayum\Http\Controllers\Behavior\DoneBehavior;
use Recca0120\LaravelPayum\Http\Controllers\Behavior\PrepareBehavior;
class PaymentController extends BaseController
{
use PrepareBehavior,
DoneBehavior;
protected $gatewayName = 'offline';
public function onPrepare($payment, $gatewayName, $storage, $payum)
{
$payment->setNumber(uniqid());
$payment->setCurrencyCode('TWD');
$payment->setTotalAmount(100);
$payment->setDescription('A description');
$payment->setClientId('anId');
$payment->setClientEmail('foo@example.com');
$payment->setDetails([]);
return $payment;
}
public function onDone($status, $payment, $gateway, $token)
{
return response()->json([
'status' => $status->getValue(),
'client' => [
'id' => $payment->getClientId(),
'email' => $payment->getClientEmail(),
],
'number' => $payment->getNumber(),
'description' => $payment->getCurrencyCode(),
'total_amount' => $payment->getTotalAmount(),
'currency_code' => $payment->getCurrencyCode(),
'details' => $payment->getDetails(),
]);
}
}
Also add router
Route::get('payment', [
'as' => 'payment',
'uses' => 'PaymentController@prepare',
]);
Route::any('payment/done/{payumToken}', [
'as' => 'payment.done',
'uses' => 'PaymentController@done',
]);
i Hit my site url
domain.app/payment
i got this ERROR
http://domain.app/payment/capture/mmaBUyQTJ2Kc6zrMx89PbG5wQTX3Ylt3Ymo6IClf_gs
InvalidArgumentException in AbstractRegistry.php line 92:
Gateway "offline" does not exist.
Hmm what would i do in my config/payum.php
im confuse what to do...
can you give me sample where i can hook in paypal express pro and offline payment gateway using eloquent?
i wanna save the configuration inside database...
offline is a payum package, so you need to install it
composer require payum/offline
try it
composer require payum/offline
payum.php
return [
'router' => [
'prefix' => 'payment',
'as' => 'payment',
// don't remove web
'middleware' => 'web',
],
'storage' => [
// optioins: database, filesystem
'token' => 'filesystem',
// optioins: database, filesystem
'gatewayConfig' => 'filesystem',
],
// [
// 'customFactoryName' => \GateFactoryClass::class,
// 'customFactoryName2' => \GateFactoryClass2::class,
// ]
'gatewayFactories' => [
],
// 'customFactoryName' => [
// 'gatewayName' => 'customGatewayName',
// 'config' => [
// 'sandbox' => false
// ],
// ],
'gatewayConfigs' => [
],
];
when it show correct, then you could try store data in eloquent
vendor publish
artisan vender:publish
migrate
artisan migrate
return [
'router' => [
'prefix' => 'payment',
'as' => 'payment',
// don't remove web
'middleware' => 'web',
],
'storage' => [
// optioins: database, filesystem
'token' => 'database',
// optioins: database, filesystem
'gatewayConfig' => 'filesystem',
],
// [
// 'customFactoryName' => \GateFactoryClass::class,
// 'customFactoryName2' => \GateFactoryClass2::class,
// ]
'gatewayFactories' => [
],
// 'customFactoryName' => [
// 'gatewayName' => 'customGatewayName',
// 'config' => [
// 'sandbox' => false
// ],
// ],
'gatewayConfigs' => [
],
];
Can you provide a Installation Instruction and How to Use it?