diff --git a/app/Config/Constants.php b/app/Config/Constants.php index d37d107..34f2a44 100644 --- a/app/Config/Constants.php +++ b/app/Config/Constants.php @@ -209,6 +209,15 @@ define("MALLS", [ "master" => "master@idcjp.jp", "title" => "Mall Master", 'card' => "TEST", + 'payment' => [ + 'CookiePayment' => [ + 'token_url' => getenv("payment.card.pay2.token_url") ?: "{TOKEN 발행 URL}", + 'token_id' => getenv("payment.card.pay2.id") ?: 'cookiepayments에서 발급받은 ID', + 'token_key' => getenv("payment.card.pay2.key") ?: 'cookiepayments에서 발급받은 연동키', + 'api_key' => getenv("payment.card.pay2.apikey") ?: "COOKIEPAY에서 발급받은 연동키", + 'api_url' => getenv("payment.card.pay2.url") ?: "{요청도메인}/keyin/payment", + ], + ], "banks" => [ ["name" => "신한은행", "account" => "계좌번호", "holder" => "예금주"], ["name" => "국민은행", "account" => "계좌번호1", "holder" => "예금주1"], diff --git a/app/Libraries/Adapter/Payment/CookiePayment.php b/app/Libraries/Adapter/Payment/CookiePayment.php index 603637f..c503304 100644 --- a/app/Libraries/Adapter/Payment/CookiePayment.php +++ b/app/Libraries/Adapter/Payment/CookiePayment.php @@ -19,10 +19,10 @@ class CookiePayment extends Payment $adapter = new APIAdapter(); $adapter->setHeader("content-type", "application/json; charset=utf-8"); /* 토큰 발행 API */ - $adapter->setURL(getenv("payment.card.pay2.token_url") ?: "{TOKEN 발행 URL}"); + $adapter->setURL(MALLS['payment']['CookiePayment']['token_url']); $adapter->setDatas(array( - 'pay2_id' => getenv("payment.card.pay2.id") ?: 'cookiepayments에서 발급받은 ID', - 'pay2_key' => getenv("payment.card.pay2.key") ?: 'cookiepayments에서 발급받은 연동키', + MALLS['payment']['CookiePayment']['token_id'], + MALLS['payment']['CookiePayment']['token_key'], )); $token = $adapter->execute(); /* 여기 까지 */ @@ -35,9 +35,9 @@ class CookiePayment extends Payment { $adapter = new APIAdapter(); $adapter->setHeader("content-type", "application/json; charset=utf-8"); - $adapter->setHeader("ApiKey", getenv("payment.card.pay2.apikey") ?: "COOKIEPAY에서 발급받은 연동키"); + $adapter->setHeader("ApiKey", MALLS['payment']['CookiePayment']['api_key']); $adapter->setHeader("TOKEN", $this->getToken()); - $adapter->setURL(getenv("payment.card.pay2.url") ?: "{요청도메인}/keyin/payment"); + $adapter->setURL(MALLS['payment']['CookiePayment']['api_url']); $datas = $this->getDatas(); // array(