【发布时间】:2017-10-07 15:51:39
【问题描述】:
我已将 payum Paypal Rest. Credit card purchase 设置到我的 laravel 应用程序中以使用信用卡付款,一切都已设置,但它给了我例外,例如:
模型 Payum\Paypal\Rest\Model\PaymentDetails 的存储不是 挂号的。有用于下一个模型的存储: Payum\Core\Model\Payment, Payum\Core\Model\ArrayObject, Payum\Core\Model\Payout。
AppServiceProvider.php
//For payment gateway...
$this->app->resolving('payum.builder', function(\Payum\Core\PayumBuilder $payumBuilder) {
$payumBuilder
// this method registers filesystem storages, consider to change them to something more
// sophisticated, like eloquent storage
->addDefaultStorages()
//->getPayum();
->addGateway('paypal_ec', [
'factory' => 'paypal_express_checkout',
'username' => config('payment.paypalusername'),
'password' => config('payment.paypalpassword'),
'signature' => config('payment.paypalsignature'),
'sandbox' => true
])
->addGateway('paypalRest', [
'factory' => 'paypal_rest',
'client_id' => config('payment.paypalclientid'),
'client_secret' => config('payment.paypalsecret'),
'config_path' => '%kernel.root_dir%/config/sdk_config.ini'
]);
});
prepare.php
$storage = $this->getPayum()->getStorage('Payum\Paypal\Rest\Model\PaymentDetails');
$payment = $storage->create();
.
.
.
我需要在哪里为模型 Payum\Paypal\Rest\Model\PaymentDetails 注册存储?
【问题讨论】:
标签: paypal laravel-5.2 credit-card paypal-rest-sdk payum