This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
reynierpm
I'm trying to use a Alias defined in boot()
plugin method as follow:
public function boot()
{
\App::register('Ignited\LaravelOmnipay\LaravelOmnipayServiceProvider');
\Illuminate\Foundation\AliasLoader::getInstance()->alias('Omnipay', 'Ignited\LaravelOmnipay\Facades\OmnipayFacade');
UserModel::extend(function($model){
$model->hasMany['payment'] = ['Alomicuba\BalanceRecharge\Models\Payment'];
});
}
Then on the onRun()
method from the component I'm doing this:
public function onRun()
{
$step = $this->param('step');
$sandboxMode = Settings::get('sandbox_enabled');
$gateway = Omnipay::create('PayPal_Express');
$sandboxMode ? $gateway->setUsername(Settings::get('ppal_api_username_sandbox')) : $gateway->setUsername(Settings::get('ppal_api_username'));
$sandboxMode ? $gateway->setPassword(Settings::get('ppal_api_password_sandbox')) : $gateway->setPassword(Settings::get('ppal_api_password'));
$sandboxMode ? $gateway->setSignature(Settings::get('ppal_api_signature_sandbox')) : $gateway->setSignature(Settings::get('ppal_api_signature'));
$this->page['step'] = $step;
}
But I'm getting an error on this line $gateway = Omnipay::create('PayPal_Express');
, can I not use this alias from there? Where is the problem?
reynierpm
Can not find OmniPay class, I move to another Laravel package that use Omnipay but now I'm having another issue, I opened a new post at Stackoverflow, can you take a look?
1-3 of 3