Пример #1
0
 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;
 }
Пример #2
0
 case 'update':
     $ym_updating_a_user = new YourMember_User($user_id);
     if ($package_apply) {
         // gifting
         if ($package_apply_skip_trial) {
             $data['trial_taken'] = $package_apply;
             $ym_updating_a_user->update($data);
             $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();