PHP code example of jinseokoh / bootpay

1. Go to this page and download the library: Download jinseokoh/bootpay library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jinseokoh / bootpay example snippets


    public function verify(
        OrderVerifyRequest $request,
        BootPayHandler $bootPayHandler,
        OrderHandler $orderHandler
    ): JsonResponse {
        $orderId = $request->getOrderId();
        $receiptId = $request->getReceiptId();
        $order = $orderHandler->findById($orderId);

        try {
            $response = $bootPayHandler->verify($receiptId);
        } catch (\Throwable $e) {
            \Log::critical("[LOG] {$e->getMessage()}");
            throw $e;
        }
        :
        // 추가로직
        :
    }

    public function cancel(
        OrderCancelRequest $request,
        BootPayHandler $bootPayHandler,
        OrderHandler $orderHandler
    ): JsonResponse {
        $orderId = $request->getOrderId();
        $receiptId = $request->getReceiptId();
        $order = $orderHandler->findById($orderId);

        try {
            $response = $bootPayHandler->cancel($receiptId);
        } catch (\Throwable $e) {
            \Log::critical("[LOG] {$e->getMessage()}");
            throw $e;
        }
        :
        // 추가로직
        :
    }