function ym_expiry_sub_dropdown_check()
 {
     $expired_pack_id = $this->pack_id;
     global $ym_packs;
     $packs = $ym_packs->packs;
     $pack_data = ym_get_pack_by_id($expired_pack_id);
     if ($pack_data) {
         // pack found
         if (isset($pack_data['on_expire_drop_to']) && $pack_data['on_expire_drop_to']) {
             // target package to drop to
             $new_pack = ym_get_pack_by_id($pack_data['on_expire_drop_to']);
             if ($new_pack) {
                 // it exists
                 $ypg = new ym_payment_gateway();
                 $ypg->name == 'ym_dropdown';
                 $ypg->code == 'ym_dropdown';
                 $ypg->nomore_eamil = TRUE;
                 $ypg->do_buy_subscription($pack_data['on_expire_drop_to'], $this->ID, TRUE);
                 return TRUE;
             }
         }
     }
     return FALSE;
 }
Exemple #2
0
         $ym_updating_a_user->save();
     }
     if ($package_apply == '-') {
         // package Removal
         $data['pack_id'] = '';
         $ym_updating_a_user->update($data);
         $ym_updating_a_user->save();
     } else {
         $pay = new ym_payment_gateway();
         $pay->code = 'ym_gift';
         $pay->name = 'ym_gift';
         $nomore_email = ym_post('apply_package_gift_notify', FALSE);
         $nomore_email = $nomore_email ? FALSE : TRUE;
         //invert
         $pay->nomore_email = $nomore_email;
         $pay->do_buy_subscription($package_apply, $user_id, TRUE);
     }
 } else {
     $data = array();
     if ($package_type) {
         $data['account_type'] = $package_type == '-' ? '' : $package_type;
         @ym_log_transaction(YM_ACCOUNT_TYPE_ASSIGNATION, $data['account_type'], $user_id);
         if ($data['account_type'] != $ym_updating_a_user->account_type) {
             $data['account_type_join_date'] = time();
         }
     }
     if (strlen($trial_on)) {
         $data['trial_on'] = $trial_on;
     }
     if ($trial_taken) {
         $data['trial_taken'] = $trial_taken == '-' ? '' : $trial_taken;