rewrite: payment

This commit is contained in:
tokumeikoi
2021-04-28 17:56:08 +09:00
parent 58b27cdd50
commit 22ee741200
15 changed files with 607 additions and 162 deletions

View File

@ -2,6 +2,7 @@
namespace App\Http\Controllers\User;
use App\Models\Payment;
use App\Utils\Dict;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
@ -19,4 +20,16 @@ class CommController extends Controller
]
]);
}
public function getStripePublicKey(Request $request)
{
$payment = Payment::where('id', $request->input('id'))
->where('payment', 'StripeCredit')
->first();
if (!$payment) abort(500, 'payment is not found');
$config = json_decode($payment->config, true);
return response([
'data' => $config['stripe_pk_live']
]);
}
}