fix: payment

This commit is contained in:
tokumeikoi 2021-04-29 01:25:11 +09:00
parent 3e60cbf968
commit aa78761115

View File

@ -14,9 +14,11 @@ class PaymentService
if (!class_exists($this->class)) abort(500, 'gate is not found');
if ($id) $payment = Payment::find($id)->toArray();
$this->config = [];
if (isset($payment) && $payment['config']) $this->config = json_decode($payment['config'], true);
$this->config['id'] = $id;
$this->config['enable'] = $payment['enable'];
if (isset($payment)) {
$this->config = json_decode($payment['config'], true);
$this->config['enable'] = $payment['enable'];
$this->config['id'] = $payment['id'];
};
$this->payment = new $this->class($this->config);
}