Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 네이버페이 useCfmYmdt 값을 설정에서 변경 가능하도록 수정 #28

Merged
merged 3 commits into from
May 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion iamport-naverpay-ext.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,20 @@ public function init_form_fields() {
'type' => 'text',
'default' => "",
),
'useCfm' => array(
'title' => __( '이용완료일 사용 여부', 'iamport-for-woocommerce' ),
'label' => __( '이용완료일 사용 여부', 'iamport-for-woocommerce' ),
'description' => __( '이용완료일 기준 정산 및 포인트 적립 가맹점에서만 사용해주세요', 'iamport-for-woocommerce' ),
'type' => 'checkbox',
'default' => "yes",
),
'cfmYmdt' => array(
'title' => __( '이용완료일(yyyyMMdd)', 'iamport-for-woocommerce' ),
'label' => __( '이용완료일(yyyyMMdd)', 'iamport-for-woocommerce' ),
'description' => __( '사용 여부를 체크한 뒤 20991231와 같은 형식으로 적어주세요.', 'iamport-for-woocommerce' ),
'type' => 'text',
'default' => "20991231",
),
), $this->form_fields, array(
'use_manual_pg' => array(
'title' => __( 'PG설정 구매자 선택방식 사용', 'woocommerce' ),
Expand Down Expand Up @@ -250,7 +264,12 @@ public function iamport_payment_info( $order_id ) {
}

$response["naverProducts"] = $naverProducts;
$response["naverUseCfm"] = "20991231";
$useCfm = $this->settings["useCfm"];
if (!isset($useCfm)) {
$response["naverUseCfm"] = "20991231";
} else if ($useCfm == 'yes') {
$response["naverUseCfm"] = $this->settings["cfmYmdt"];
}
$response["unblock"] = true;

if ( !wp_is_mobile() ) {
Expand Down