Skip to content

Commit

Permalink
* CP - recurring_change callback processing added.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahaenor committed Dec 11, 2017
1 parent 9169779 commit 4380a51
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion gateways/cp/leyka-class-cp-gateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,17 @@ public function _handle_service_calls($call_type = '') {
die(json_encode(array('code' => '0'))); // Payment completed / fail registered

case 'recurring_change':
/** @todo Add recurring cancelling support */
case 'recurrent_change':

if( !empty($_POST['Id']) ) { // Recurring subscription ID in the CP system

$_POST['Id'] = trim($_POST['Id']);
$init_recurring_donation = $this->get_init_recurrent_donation($_POST['Id']);

if($init_recurring_donation && $init_recurring_donation->recurring_is_active) {
$init_recurring_donation->recurring_is_active = false;
}
}

default:
}
Expand Down

0 comments on commit 4380a51

Please sign in to comment.