| @@ -1,60 +0,0 @@ | |||||
| <?php | |||||
| namespace App\Http\Controllers\Web\BanckCheck; | |||||
| use App\Http\Controllers\Web\WebController; | |||||
| use App\Kintone\Models\BankCheckResult; | |||||
| use App\Util\DateUtil; | |||||
| use Illuminate\Http\Request; | |||||
| use Illuminate\Http\Response; | |||||
| use Illuminate\Support\Carbon; | |||||
| use Illuminate\Support\Str; | |||||
| class EntryController extends WebController | |||||
| { | |||||
| public function name(): string | |||||
| { | |||||
| return "バンクチェック 受付"; | |||||
| } | |||||
| public function description(): string | |||||
| { | |||||
| return "バンクチェック 受付"; | |||||
| } | |||||
| public function __construct(protected EntryParam $param) | |||||
| { | |||||
| parent::__construct(); | |||||
| } | |||||
| protected function run(Request $request): Response | |||||
| { | |||||
| $param = $this->param; | |||||
| if ($param->token !== config('custom.bank-check.token')) { | |||||
| abort(403); | |||||
| } | |||||
| $model = new BankCheckResult(); | |||||
| $model->customerCode = $param->customerCode; | |||||
| $model->entryRecordNo = $param->entryRecordNo; | |||||
| $model->shopOrderNo = $param->cod; | |||||
| $model->paymentNo = $param->gid; | |||||
| $model->orderCode = $param->god; | |||||
| $model->entryResult = $param->rst; | |||||
| $model->entryErrorCode = $param->ec; | |||||
| $model->paymentPlanAmount = intval($param->am); | |||||
| $model->paymentExpiresDate = Carbon::createFromFormat("Ymd", $param->exp); | |||||
| $requestArr = $request->toArray(); | |||||
| unset($requestArr["token"]); | |||||
| $model->dataEntry = json_encode($requestArr); | |||||
| $model->save(); | |||||
| return response()->view('bank-check.ok'); | |||||
| } | |||||
| } | |||||
| @@ -1,46 +0,0 @@ | |||||
| <?php | |||||
| namespace App\Http\Controllers\Web\BanckCheck; | |||||
| use App\Http\Controllers\Web\BaseParam; | |||||
| /** | |||||
| * @property string $gid 決済受付時に発行された決済番号 | |||||
| * @property string $rst 決済結果(1:OK 2:NG) | |||||
| * @property string $ap 入金:完了(BAN_SAL) | |||||
| * @property string $ec エラーコード | |||||
| * @property string $god オーダーコード | |||||
| * @property string $cod 店舗側オーダー番号 | |||||
| * @property string $am 決済金額 | |||||
| * @property string $tx 税金額 | |||||
| * @property string $sf 送料 | |||||
| * @property string $ta 合計金額 | |||||
| * @property string $bank 振込先口座情報(ドット「.」区切りの文字列)[銀行コード].[銀行名].[支店コード].[支店名].[口座種別].[口座番号].[口座名義] | |||||
| * @property string $exp 支払期限(yyyymmdd形式) | |||||
| * @property string $customerCode カスタム-顧客コード | |||||
| * @property int $entryRecordNo カスタム-定期申込レコード番号 | |||||
| * @property string $token カスタム-トークン | |||||
| */ | |||||
| class EntryParam extends BaseParam | |||||
| { | |||||
| public function rules(): array | |||||
| { | |||||
| return [ | |||||
| 'gid' => $this->str(), | |||||
| 'rst' => $this->str(), | |||||
| 'ap' => $this->str(), | |||||
| 'ec' => $this->str(), | |||||
| 'god' => $this->str(), | |||||
| 'cod' => $this->str(), | |||||
| 'am' => $this->numeric(), | |||||
| 'tx' => $this->numeric(), | |||||
| 'sf' => $this->numeric(), | |||||
| 'ta' => $this->numeric(), | |||||
| 'bank' => $this->str(), | |||||
| 'exp' => $this->str(), | |||||
| 'customer_code' => $this->str(), | |||||
| 'entry_record_no' => $this->numeric(), | |||||
| 'token' => $this->str(), | |||||
| ]; | |||||
| } | |||||
| } | |||||
| @@ -1,6 +1,6 @@ | |||||
| <?php | <?php | ||||
| namespace App\Http\Controllers\Web\BanckCheck; | |||||
| namespace App\Http\Controllers\Web\RobotPayment\BanckCheck; | |||||
| use App\Exceptions\AppCommonException; | use App\Exceptions\AppCommonException; | ||||
| use App\Http\Controllers\Web\WebController; | use App\Http\Controllers\Web\WebController; | ||||
| @@ -44,7 +44,7 @@ class PaymentInfoController extends WebController | |||||
| } | } | ||||
| return response()->view('bank-check.ok'); | |||||
| return response()->view('robot-payment.bank-check.ok'); | |||||
| } | } | ||||
| private function handleEntry() | private function handleEntry() | ||||
| @@ -1,6 +1,6 @@ | |||||
| <?php | <?php | ||||
| namespace App\Http\Controllers\Web\BanckCheck; | |||||
| namespace App\Http\Controllers\Web\RobotPayment\BanckCheck; | |||||
| use App\Http\Controllers\Web\BaseParam; | use App\Http\Controllers\Web\BaseParam; | ||||
| @@ -0,0 +1,35 @@ | |||||
| <?php | |||||
| namespace App\Http\Controllers\Web\RobotPayment\BanckCheck; | |||||
| use App\Http\Controllers\Web\WebController; | |||||
| use Illuminate\Http\Request; | |||||
| use Illuminate\Http\Response; | |||||
| class RegisterController extends WebController | |||||
| { | |||||
| public function name(): string | |||||
| { | |||||
| return "バンクチェック 登録画面遷移"; | |||||
| } | |||||
| public function description(): string | |||||
| { | |||||
| return "バンクチェック 登録画面遷移"; | |||||
| } | |||||
| public function __construct(protected RegisterParam $param) | |||||
| { | |||||
| $this->middleware('fromKintone'); | |||||
| parent::__construct(); | |||||
| } | |||||
| protected function run(Request $request): Response | |||||
| { | |||||
| $param = $this->param; | |||||
| return response()->view('robot-payment.bank-check.register', $param->toArray()); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,31 @@ | |||||
| <?php | |||||
| namespace App\Http\Controllers\Web\RobotPayment\BanckCheck; | |||||
| use App\Http\Controllers\Web\BaseParam; | |||||
| /** | |||||
| * @property string $aid | |||||
| * @property string $cod | |||||
| * @property string $am | |||||
| * @property string $tx | |||||
| * @property string $sf | |||||
| * @property string $customerCode カスタム-顧客コード | |||||
| * @property int $entryRecordNo カスタム-定期申込レコード番号 | |||||
| */ | |||||
| class RegisterParam extends BaseParam | |||||
| { | |||||
| public function rules(): array | |||||
| { | |||||
| return [ | |||||
| 'aid' => $this->str(), | |||||
| 'cod' => $this->str(), | |||||
| 'jb' => $this->str(true), | |||||
| 'am' => $this->str(), | |||||
| 'tx' => $this->str(), | |||||
| 'sf' => $this->numeric(), | |||||
| 'customer_code' => $this->str(), | |||||
| 'entry_record_no' => $this->numeric(), | |||||
| ]; | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,28 @@ | |||||
| <html> | |||||
| <body> | |||||
| <span> | |||||
| ...遷移中 | |||||
| </span> | |||||
| <form id="target-form" action="https://credit.j-payment.co.jp/link/bankcheck" method="post"> | |||||
| <input type="hidden" name="aid" value="{{ $aid }}"> | |||||
| <input type="hidden" name="cod" value="{{ $cod }}"> | |||||
| <input type="hidden" name="jb" value="{{ $jb }}"> | |||||
| <input type="hidden" name="am" value="{{ $am }}"> | |||||
| <input type="hidden" name="tx" value="{{ $tx }}"> | |||||
| <input type="hidden" name="sf" value="{{ $sf }}"> | |||||
| <input type="hidden" name="customer_code" value="{{ $customer_code }}"> | |||||
| <input type="hidden" name="entry_record_no" value="{{ $entry_record_no }}"> | |||||
| <input type="hidden" name="token" value="{{ config('custom.bank-check.token') }}"> | |||||
| </form> | |||||
| <script> | |||||
| window.onload = () => { | |||||
| document.getElementById('target-form').submit() | |||||
| } | |||||
| </script> | |||||
| </body> | |||||
| </html> | |||||
| @@ -19,10 +19,11 @@ RouteHelper::get('/pdf', App\Http\Controllers\PDFController::class); | |||||
| // 画像取得 | // 画像取得 | ||||
| RouteHelper::get('/image/season-ticket-contract/{id}', App\Http\Controllers\Web\Image\SeasonTicketContractImageController::class); | RouteHelper::get('/image/season-ticket-contract/{id}', App\Http\Controllers\Web\Image\SeasonTicketContractImageController::class); | ||||
| RouteHelper::get('/test/bank', App\Http\Controllers\Web\Image\SeasonTicketContractImageController::class); | |||||
| // ロボットペイメント画面遷移 | |||||
| RouteHelper::get('/robot-payment/bank-check/register', App\Http\Controllers\Web\RobotPayment\BanckCheck\RegisterController::class); | |||||
| // BANK CHECK WEBHOOK | // BANK CHECK WEBHOOK | ||||
| RouteHelper::get('/bank-check/info', App\Http\Controllers\Web\BanckCheck\PaymentInfoController::class); | |||||
| RouteHelper::get('/robot-payment/bank-check/info', App\Http\Controllers\Web\RobotPayment\BanckCheck\PaymentInfoController::class); | |||||
| // ルーティングで適合しない場合はフロント側のRoutingにゆだねる | // ルーティングで適合しない場合はフロント側のRoutingにゆだねる | ||||