Skip to content

Commit

Permalink
[2.2.23] 카카오페이 정기결제 2중반목 문제 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
nonameP765 committed Jul 21, 2021
1 parent 34bc612 commit d6fd012
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
2 changes: 1 addition & 1 deletion IamportPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: 우커머스용 아임포트 플러그인(국내 모든 PG를 한 번에)
* Plugin URI: http://www.iamport.kr
* Description: 우커머스용 한국PG 연동 플러그인 ( 신용카드 / 실시간계좌이체 / 가상계좌 / 휴대폰소액결제 - 에스크로포함 )
* Version: 2.2.22
* Version: 2.2.23
* Author: SIOT
* Author URI: http://www.siot.do
*
Expand Down
24 changes: 4 additions & 20 deletions iamport-kakao.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public function __construct() {
//actions
// add_action( 'woocommerce_thankyou_'.$this->id, array( $this, 'iamport_order_detail' ) ); woocommerce_order_details_after_order_table 로 대체. 중복으로 나오고 있음

add_action( 'woocommerce_scheduled_subscription_payment_' . $this->id, array( $this, 'scheduled_subscription_payment' ), 10, 2 );
add_action( 'woocommerce_scheduled_subscription_payment_' . $this->id, array( $this, 'scheduled_subscription_payment' ), 10, 2 );
$this->init();
}

protected function get_gateway_id() {
Expand Down Expand Up @@ -314,15 +315,6 @@ private function has_subscription( $order_id ) {
return function_exists( 'wcs_order_contains_subscription' ) && ( wcs_order_contains_subscription( $order_id ) || wcs_is_subscription( $order_id ) || wcs_order_contains_renewal( $order_id ) );
}

}

class IamportKakaoButton {
private $gateway;

public function __construct($gateway) {
$this->gateway = $gateway;
}

public function init() {
add_filter( 'woocommerce_available_payment_gateways', array($this, 'kakao_unset_gateway_by_category'));
}
Expand All @@ -347,8 +339,8 @@ public function kakao_unset_gateway_by_category($available_gateways) {
$cart_items = WC()->cart->get_cart();
if ( count($cart_items) == 0 ) return; //장바구니가 비어있으면 패스

$categories = $this->gateway->get_display_categories();
$disabled_categories = $this->gateway->get_disabled_categories();
$categories = $this->get_display_categories();
$disabled_categories = $this->get_disabled_categories();
$product_ids = array();
$enabled = true;

Expand All @@ -368,11 +360,3 @@ public function kakao_unset_gateway_by_category($available_gateways) {
return $available_gateways;
}
}

add_action( 'init', function() {
$gateway = new WC_Gateway_Iamport_Kakao(); //TODO : 더 좋은 방법을 고민해야 함

$instPayButton = new IamportKakaoButton($gateway);

$instPayButton->init();
});
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Donate link: http://www.iamport.kr
Tags: 네이버페이, 카카오페이, 페이코, 이니시스, KCP, naverpay, naver, payco, kakao, kakaopay, kpay, inicis, 유플러스, lguplus, uplus, 나이스, 나이스페이, nice, nicepay, 제이티넷, 티페이, jtnet, tpay, 다날, danal, 모빌리언스, mobilians, 정기결제, subscription, 해외카드, visa, master, jcb, shopping, mall, iamport
Requires at least: 3.5
Tested up to: 5.5.1
Stable tag: 2.2.22
Stable tag: 2.2.23
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -60,6 +60,9 @@ https://www.facebook.com/iamportservice


== Changelog ==
= 2.2.23 =
* 카카오페이 정기결제 2중반목 문제 수정

= 2.2.22 =
* 카카오페이 정기결제 이슈 수정

Expand Down

0 comments on commit d6fd012

Please sign in to comment.