본문으로 건너뛰기

PAYCO 복합결제(카드+포인트) 지원

PHP 8 · GODO26
변경 파일 수: 7개
변경 파일 목록
7
변경 파일 코드
추가삭제
Admin/order/refund_do_new.php+1-11
변경 전refund_do_new.php
if(refundAccountFl) $('#refundBank').removeClass('display-none');
// 페이코 처리
<?php
if(isset($paycoCoupon) && $paycoCoupon > 0) {
?>
if (<?=$paycoCoupon?> > $('[name=\'check[totalSettlePrice]\']').val())
{
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
alert('환불예정금액이 페이코 쿠폰 사용액(<?=number_format($paycoCoupon)?>원)보다 작아 PG환불을 진행할 수 없습니다.');
return;
}
<?php
} else if(isset($firstHand) && $firstHand == 'Y') {
?>
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
 
변경 후refund_do_new.php
if(refundAccountFl) $('#refundBank').removeClass('display-none');
// 페이코 처리
<?php
if (isset($firstHand) && $firstHand === 'Y') {
 
 
 
 
 
 
 
 
 
 
?>
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
 
Admin/order/refund_do.php+1-11
변경 전refund_do.php
$('#pgRefundPrice').removeClass('display-none');
// 페이코 처리
<?php
if(isset($paycoCoupon) && $paycoCoupon > 0) {
?>
if (<?=$paycoCoupon?> > $('[name=\'check[totalSettlePrice]\']').val())
{
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
alert('환불예정금액이 페이코 쿠폰 사용액(<?=number_format($paycoCoupon)?>원)보다 작아 PG환불을 진행할 수 없습니다.');
return;
}
<?php
} else if(isset($firstHand) && $firstHand == 'Y') {
?>
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
 
변경 후refund_do.php
$('#pgRefundPrice').removeClass('display-none');
// 페이코 처리
<?php
if (isset($firstHand) && $firstHand === 'Y') {
 
 
 
 
 
 
 
 
 
 
?>
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
 
Admin/order/refund_view.php+2-23
변경 전refund_view.php
 
// 페이코 처리
<?php
if(isset($paycoCoupon) && $paycoCoupon > 0) {
?>
if(<?=$paycoCoupon?> > $('[name=\'check[totalSettlePrice]\']').val()) {
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
alert('환불예정금액이 페이코 쿠폰 사용액(<?=number_format($paycoCoupon)?>원)보다 작아 PG환불을 진행할 수 없습니다.');
return;
}
<?php
} else if(isset($firstHand) && $firstHand == 'Y') {
?>
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
}
 
<?php
if(isset($paycoCoupon) && $paycoCoupon > 0) {
?>
if(<?=$paycoCoupon?> > firstRefundPrice)
{
if($('[name=\'info[refundMethod]\'] :selected').val() == 'PG환불') {
$('[name=\'info[refundMethod]\'] :selected').attr('disabled', 'disabled');
$('[name=\'info[refundMethod]\']').find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').parent().parent().append('<p id="paycoCouponRefund" class="notice-danger">환불예정금액이 페이코 쿠폰 사용액(<?=number_format($paycoCoupon)?>원)보다 작아 PG환불을 진행할 수 없습니다.</p>');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
}
}
<?php
} else if(isset($firstHand) && $firstHand == 'Y') {
?>
if($('[name=\'info[refundMethod]\'] :selected').val() == 'PG환불') {
$('[name=\'info[refundMethod]\'] :selected').attr('disabled', 'disabled');
 
변경 후refund_view.php
 
// 페이코 처리
<?php
if (isset($firstHand) && $firstHand === 'Y') {
 
 
 
 
 
 
 
 
 
?>
$(this).find('option:first-child').prop('selected', true).end().trigger('liszt:updated');
$('[name=\'info[completePgPrice]\']').attr('disabled', 'disabled').val('');
}
 
<?php
if (isset($firstHand) && $firstHand === 'Y') {
 
 
 
 
 
 
 
 
 
 
 
 
?>
if($('[name=\'info[refundMethod]\'] :selected').val() == 'PG환불') {
$('[name=\'info[refundMethod]\'] :selected').attr('disabled', 'disabled');
 
Component/Order/OrderAdminNew.php+7-1
변경 전OrderAdminNew.php
use Globals;
use LogHandler;
use Origin\Enum\Order\OrderSettleKind;
 
 
 
use Origin\Service\Statistics\Analytics\Order\OrderCompleteAnalyticsCollectorService;
use Origin\Service\WebHook\OrderWebHookService;
use Request;
 
// 처리하려는 주문상품이 환불, 교환처리된 주문상품이라면 통신을 하지 않는다.
$handleMode = $this->getOnlyOrderHandleMode($bundleData['sno'][0]);
if (gd_in_array(substr($changeStatus, 0, 1), ['r', 'e', 'z']) === false && $handleMode !== 'z') {
 
 
 
$payco = \App::load('\\Component\\Payment\\Payco\\Payco');
$response = $payco->paycoOrderStatus($orderNo, $bundleData['sno'][0], $changeStatus, $orderData);
if ($response->code != '000') {
 
변경 후OrderAdminNew.php
use Globals;
use LogHandler;
use Origin\Enum\Order\OrderSettleKind;
use Origin\Enum\Order\OrderHandleMode;
use Origin\Enum\Order\OrderStatusCode;
use Origin\Enum\Order\OrderStatusGroup;
use Origin\Service\Statistics\Analytics\Order\OrderCompleteAnalyticsCollectorService;
use Origin\Service\WebHook\OrderWebHookService;
use Request;
 
// 처리하려는 주문상품이 환불, 교환처리된 주문상품이라면 통신을 하지 않는다.
$handleMode = $this->getOnlyOrderHandleMode($bundleData['sno'][0]);
// PG확인요망(f4)은 솔루션 내부 상태로 페이코 주문상태 통보 제외
if (!in_array(substr($changeStatus, 0, 1), [OrderStatusGroup::REFUND->value, OrderStatusGroup::EXCHANGE->value, OrderStatusGroup::EXCHANGE_ADD->value])
&& $changeStatus !== OrderStatusCode::PAYMENT_PG_CHECK_REQUIRED->value
&& $handleMode !== OrderHandleMode::EXCHANGE_ADD->value) {
$payco = \App::load('\\Component\\Payment\\Payco\\Payco');
$response = $payco->paycoOrderStatus($orderNo, $bundleData['sno'][0], $changeStatus, $orderData);
if ($response->code != '000') {
 
Component/Order/OrderAdmin.php+7-1
변경 전OrderAdmin.php
use Globals;
use LogHandler;
use Origin\Enum\Order\OrderSettleKind;
 
 
 
use Origin\Service\Statistics\Analytics\Order\OrderCompleteAnalyticsCollectorService;
use Origin\Service\WebHook\OrderWebHookService;
use Request;
 
// 처리하려는 주문상품이 환불, 교환처리된 주문상품이라면 통신을 하지 않는다.
$handleMode = $this->getOnlyOrderHandleMode($bundleData['sno'][0]);
if (gd_in_array(substr($changeStatus, 0, 1), ['r', 'e', 'z']) === false && $handleMode !== 'z') {
 
 
 
$payco = \App::load('\\Component\\Payment\\Payco\\Payco');
$response = $payco->paycoOrderStatus($orderNo, $bundleData['sno'][0], $changeStatus, $orderData);
if ($response->code != '000') {
 
변경 후OrderAdmin.php
use Globals;
use LogHandler;
use Origin\Enum\Order\OrderSettleKind;
use Origin\Enum\Order\OrderHandleMode;
use Origin\Enum\Order\OrderStatusCode;
use Origin\Enum\Order\OrderStatusGroup;
use Origin\Service\Statistics\Analytics\Order\OrderCompleteAnalyticsCollectorService;
use Origin\Service\WebHook\OrderWebHookService;
use Request;
 
// 처리하려는 주문상품이 환불, 교환처리된 주문상품이라면 통신을 하지 않는다.
$handleMode = $this->getOnlyOrderHandleMode($bundleData['sno'][0]);
// PG확인요망(f4)은 솔루션 내부 상태로 페이코 주문상태 통보 제외
if (!in_array(substr($changeStatus, 0, 1), [OrderStatusGroup::REFUND->value, OrderStatusGroup::EXCHANGE->value, OrderStatusGroup::EXCHANGE_ADD->value])
&& $changeStatus !== OrderStatusCode::PAYMENT_PG_CHECK_REQUIRED->value
&& $handleMode !== OrderHandleMode::EXCHANGE_ADD->value) {
$payco = \App::load('\\Component\\Payment\\Payco\\Payco');
$response = $payco->paycoOrderStatus($orderNo, $bundleData['sno'][0], $changeStatus, $orderData);
if ($response->code != '000') {
 
Controller/Admin/Order/RefundViewController.php+3-5
변경 전RefundViewController.php
}
 
 
// 페이코 주문이고, 페이코 쿠폰이 사용된 경우 쿠폰이 환불할 금액보다 큰 경우 PG환불 제한 - 페이코 쿠폰은 신용카드 결제에서만 사용가능
if ($getData['pgName'] == 'payco' && substr($getData['settleKind'], 1, 1) == 'c') {
$checkoutData = json_decode($getData['checkoutData']);
if ($checkoutData->paycoCouponUseStatus == 'Y' && $checkoutData->repayPaycoCoupon == 'N' && $checkoutData->paycoFirsthandRepay != 'Y') {
$this->setData('paycoCoupon', $checkoutData->paycoCouponPrice);
} else if ($checkoutData->paycoFirsthandRepay == 'Y') {
$this->setData('firstHand', $checkoutData->paycoFirsthandRepay);
}
}
 
변경 후RefundViewController.php
}
 
 
// 페이코 주문이고, 수기환불 이력이 있는 경우 PG환불 제한
if ($getData['pgName'] == 'payco' && substr($getData['settleKind'], 1, 1) == 'c') {
$checkoutData = (object) $getData['checkoutData'];
if ($checkoutData->paycoFirsthandRepay == 'Y') {
 
 
$this->setData('firstHand', $checkoutData->paycoFirsthandRepay);
}
}
 
Controller/Admin/Order/RefundViewNewController.php+2-4
변경 전RefundViewNewController.php
throw new AlertCloseException(__('해외상점 취소/교환/반품/환불은 전체 처리만 가능합니다.'));
}
 
// 페이코 주문이고, 페이코 쿠폰이 사용된 경우 쿠폰이 환불할 금액보다 큰 경우 PG환불 제한 - 페이코 쿠폰은 신용카드 결제에서만 사용가능
if ($getData['pgName'] == 'payco' && substr($getData['settleKind'], 1, 1) == 'c') {
$checkoutData = (object) $getData['checkoutData'];
if ($checkoutData->paycoCouponUseStatus == 'Y' && $checkoutData->repayPaycoCoupon == 'N' && $checkoutData->paycoFirsthandRepay != 'Y') {
$this->setData('paycoCoupon', $checkoutData->paycoCouponPrice);
} else if ($checkoutData->paycoFirsthandRepay == 'Y') {
$this->setData('firstHand', $checkoutData->paycoFirsthandRepay);
}
}
 
변경 후RefundViewNewController.php
throw new AlertCloseException(__('해외상점 취소/교환/반품/환불은 전체 처리만 가능합니다.'));
}
 
// 페이코 주문이고, 수기환불 이력이 있는 경우 PG환불 제한
if ($getData['pgName'] == 'payco' && substr($getData['settleKind'], 1, 1) == 'c') {
$checkoutData = (object) $getData['checkoutData'];
if ($checkoutData->paycoFirsthandRepay == 'Y') {
 
 
$this->setData('firstHand', $checkoutData->paycoFirsthandRepay);
}
}