$obj->paymentAmount = get_post_meta($pack_id, 'pack_price', true); $obj->currencyID = get_option('wp_estate_submission_curency', ''); $date = $save_data[$current_user->ID]['date']; $obj->startDate = urlencode($date); $obj->billingPeriod = urlencode($billing_period); $obj->billingFreq = urlencode($billing_freq); $pack_name = get_the_title($pack_id); $obj->productdesc = urlencode($pack_name . esc_html__(' package on ', 'wpestate') . get_bloginfo('name')); $obj->user_id = $current_user->ID; $obj->pack_id = $pack_id; if ($obj->getExpressCheckout($token_recursive)) { if (wpestate_check_downgrade_situation($current_user->ID, $pack_id)) { wpestate_downgrade_to_pack($current_user->ID, $pack_id); wpestate_upgrade_user_membership($current_user->ID, $pack_id, 2, ''); } else { wpestate_upgrade_user_membership($current_user->ID, $pack_id, 2, ''); } wp_redirect($dash_profile_link); } } } ////////////////////////////////////////////////////////////////////////////////////////// // 3rd party login code ////////////////////////////////////////////////////////////////////////////////////////// if (isset($_GET['code']) && isset($_GET['state'])) { estate_facebook_login($_GET); } else { if (isset($_GET['openid_mode']) && $_GET['openid_mode'] == 'id_res') { estate_open_id_login($_GET); } else { if (isset($_GET['code'])) {
if ($receiver_email != $paypal_rec_email) { exit; } if (wpestate_retrive_invoice_by_taxid($txn_id)) { // payment already processd exit; } if ($user_id == 0) { // no user with such profile id exit; } if ($amount != $price) { // received payment diffrent than pack value exit; } wpestate_upgrade_user_membership($user_id, $pack_id, 2, $txn_id); } else { // payment not completed if ($txn_type != 'recurring_payment_profile_created') { wpestate_downgrade_to_free($user_id); } } } else { exit('not right'); } ///////////////////////////////////////////////////////////////////////////////////// // get user by paypal recurring profile ///////////////////////////////////////////////////////////////////////////////////// function wpestate_retrive_user_by_profile($recurring_payment_id) { $recurring_payment_id = str_replace('-', 'xxx', $recurring_payment_id);