当前位置: 首页>>代码示例>>PHP>>正文


PHP GFFormDisplay::handle_confirmation方法代码示例

本文整理汇总了PHP中GFFormDisplay::handle_confirmation方法的典型用法代码示例。如果您正苦于以下问题:PHP GFFormDisplay::handle_confirmation方法的具体用法?PHP GFFormDisplay::handle_confirmation怎么用?PHP GFFormDisplay::handle_confirmation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GFFormDisplay的用法示例。


在下文中一共展示了GFFormDisplay::handle_confirmation方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: maybe_thankyou_page

 public static function maybe_thankyou_page()
 {
     if (!self::is_gravityforms_supported()) {
         return;
     }
     if ($str = RGForms::get("gf_paypal_return")) {
         $str = base64_decode($str);
         parse_str($str, $query);
         if (wp_hash("ids=" . $query["ids"]) == $query["hash"]) {
             list($form_id, $lead_id) = explode("|", $query["ids"]);
             $form = RGFormsModel::get_form_meta($form_id);
             $lead = RGFormsModel::get_lead($lead_id);
             if (!class_exists("GFFormDisplay")) {
                 require_once GFCommon::get_base_path() . "/form_display.php";
             }
             $confirmation = GFFormDisplay::handle_confirmation($form, $lead, false);
             if (is_array($confirmation) && isset($confirmation["redirect"])) {
                 header("Location: {$confirmation["redirect"]}");
                 exit;
             }
             GFFormDisplay::$submission[$form_id] = array("is_confirmation" => true, "confirmation_message" => $confirmation, "form" => $form, "lead" => $lead);
         }
     }
 }
开发者ID:bryanmonzon,项目名称:jenjonesdirect,代码行数:24,代码来源:paypal.php

示例2: maybe_thankyou_page

 public static function maybe_thankyou_page()
 {
     $instance = self::get_instance();
     if (!$instance->is_gravityforms_supported()) {
         return;
     }
     if ($str = rgget('gf_paypal_return')) {
         $str = base64_decode($str);
         parse_str($str, $query);
         if (wp_hash('ids=' . $query['ids']) == $query['hash']) {
             list($form_id, $lead_id) = explode('|', $query['ids']);
             $form = GFAPI::get_form($form_id);
             $lead = GFAPI::get_entry($lead_id);
             if (!class_exists('GFFormDisplay')) {
                 require_once GFCommon::get_base_path() . '/form_display.php';
             }
             $confirmation = GFFormDisplay::handle_confirmation($form, $lead, false);
             if (is_array($confirmation) && isset($confirmation['redirect'])) {
                 header("Location: {$confirmation['redirect']}");
                 exit;
             }
             GFFormDisplay::$submission[$form_id] = array('is_confirmation' => true, 'confirmation_message' => $confirmation, 'form' => $form, 'lead' => $lead);
         }
     }
 }
开发者ID:chawlie,项目名称:goldenrollers,代码行数:25,代码来源:class-gf-paypal.php

示例3: confirm_express_checkout

 public static function confirm_express_checkout($form, $entry, $config, $billing_data)
 {
     $token = rgget("token");
     //finalize PayPal transaction
     if ($config["meta"]["type"] != "product") {
         $fields = "METHOD=CreateRecurringPaymentsProfile&" . "TOKEN={$token}&" . "PROFILESTARTDATE=" . urlencode(gmdate(DATE_ATOM)) . "&" . "DESC=" . urlencode(self::get_recurring_description($config, $billing_data)) . "&" . "MAXFAILEDPAYMENTS=0&" . "BILLINGPERIOD=" . self::get_interval_unit($config["meta"]["billing_cycle_type"]) . "&" . "BILLINGFREQUENCY=" . $config["meta"]["billing_cycle_number"] . "&" . "AMT=" . $billing_data["amount"] . "&" . "CURRENCYCODE=" . GFCommon::get_currency() . "&" . "TOTALBILLINGCYCLES=" . $config["meta"]["recurring_times"] . "&";
         $trial_data = self::get_trial_data($config, $billing_data);
         $trial_amount = 0;
         if ($trial_data) {
             $fields .= "TRIALBILLINGPERIOD=" . $trial_data["period"] . "&" . "TRIALBILLINGFREQUENCY=" . $trial_data["frequency"] . "&" . "TRIALTOTALBILLINGCYCLES=" . $trial_data["cycles"] . "&";
             if ($trial_data["amount"] > 0) {
                 $fields .= "TRIALAMT=" . $trial_data["amount"] . "&";
             }
         }
         //setup fee
         $setup_fee_amount = self::get_setup_fee($config, $billing_data);
         if ($setup_fee_amount) {
             $fields .= "INITAMT=" . $setup_fee_amount;
         }
         $success = self::send_request($config, $fields, $response, $form, $entry);
         if (!$success || !in_array($response["PROFILESTATUS"], array("PendingProfile", "ActiveProfile"))) {
             //3a- if failure, display message and abort
             self::log_error("Error on CreateRecurringPaymentsProfile \n\nFields:\n{$fields} \n\nResponse:\n " . print_r($response, true));
             return __("There was an error while confirming your payment. Your payment could not be processed. Please try again later.", "gravityformspaypalpro");
         } else {
             //Everything OK. confirm subscription
             $subscriber_id = rgar($response, "PROFILEID");
             $is_pending = $response["PROFILESTATUS"] == "PendingProfile";
             $amount = $billing_data["amount"];
             //marking entry as Active
             self::update_entry($entry, $form, $subscriber_id, true, $amount, $is_pending);
             //inserting initial signup transaction
             GFPayPalProData::insert_transaction($entry["id"], $config["id"], "signup", $subscriber_id, "", "", 0);
             //fulfilling order if profile was created successfully
             if (!$is_pending) {
                 self::fulfill_order($entry, $subscriber_id, $setup_fee_amount, $amount);
             }
             $confirmation = GFFormDisplay::handle_confirmation($form, $entry);
             return $confirmation;
         }
     } else {
         //Confirm payment
         $fields = "METHOD=DoExpressCheckoutPayment&" . "PAYERID=" . rgget("PayerID") . "&" . "PAYMENTREQUEST_0_AMT=" . $billing_data["amount"] . "&" . "PAYMENTREQUEST_0_NOTIFYURL=" . urlencode(get_bloginfo("url") . "/?page=gf_paypalpro_ipn") . "&" . "TOKEN={$token}&";
         $success = self::send_request($config, $fields, $response, $form, $entry);
         if (!$success || !in_array($response["PAYMENTINFO_0_PAYMENTSTATUS"], array("Pending", "Completed"))) {
             //GCCommon::log_error("paypalpro", "Error on DoExpressCheckoutPayment \n\nFields:\n{$fields} \n\nResponse:\n " . print_r($response, true));
             return __("There was an error while confirming your payment. Your payment could not be processed. Please try again later.", "gravityformspaypalpro");
         } else {
             $transaction_id = rgar($response, "PAYMENTINFO_0_TRANSACTIONID");
             $is_pending = $response["PAYMENTINFO_0_PAYMENTSTATUS"] == "Pending";
             $amount = $response["PAYMENTINFO_0_AMT"];
             self::confirm_payment($entry, $form, "", $transaction_id, false, $amount, 0, $is_pending);
             $confirmation = GFFormDisplay::handle_confirmation($form, $entry);
             return $confirmation;
         }
     }
 }
开发者ID:bryanmonzon,项目名称:jenjonesdirect,代码行数:57,代码来源:paypalpro.php

示例4: gpoll_ajax

 /**
  * Handler for the gpoll_ajax AJAX request.
  * Returns the json encoded result for processing by gpoll.js.
  */
 public function gpoll_ajax()
 {
     $output = array();
     $form_id = rgpost('formId');
     $form = RGFormsModel::get_form_meta($form_id);
     $preview_results = rgpost('previewResults');
     $preview_results = $preview_results == '1' ? true : false;
     $has_voted = isset($_COOKIE['gpoll_form_' . $form_id]);
     $override = false;
     if (rgpost('override') == 1) {
         $show_results_link = rgpost('showResultsLink') == '1' ? true : false;
         $display_results = rgpost('displayResults') == '1' ? true : false;
         $confirmation = rgpost('confirmation') == '1' ? true : false;
         $percentages = rgpost('percentages') == '1' ? true : false;
         $counts = rgpost('counts') == '1' ? true : false;
         $cookie_duration = urldecode(rgpost('cookieDuration'));
         $style = rgpost('style');
         $checksum = rgpost('checksum');
         if ($checksum == $this->generate_checksum($display_results, $show_results_link, $cookie_duration, $confirmation, $percentages, $counts, $style)) {
             $override = true;
         }
     }
     if (false === $override) {
         $show_results_link = $this->get_form_setting($form, 'showResultsLink');
         $display_results = $this->get_form_setting($form, 'displayResults');
         $confirmation = true;
         $percentages = $this->get_form_setting($form, 'showPercentages');
         $counts = $this->get_form_setting($form, 'showCounts');
         $style = $this->get_form_setting($form, 'style');
         $block_repeat_voters = $this->get_form_setting($form, 'blockRepeatVoters');
         if ($block_repeat_voters) {
             $cookie_duration = $this->get_form_setting($form, 'cookie');
         } else {
             $cookie_duration = '';
         }
     }
     $can_vote = !$has_voted || empty($cookie_duration) && $has_voted;
     $output['canVote'] = $can_vote;
     if ($preview_results || false === $can_vote) {
         if ('' === $show_results_link) {
             $show_results_link = true;
         }
         if ($preview_results && $show_results_link || $display_results) {
             $results = $this->gpoll_get_results($form_id, '0', $style, $percentages, $counts);
             $results_summary = $results['summary'];
             $output['resultsUI'] = $results_summary;
         } else {
             if ($confirmation) {
                 require_once GFCommon::get_base_path() . '/form_display.php';
                 $output['resultsUI'] = GFFormDisplay::handle_confirmation($form, null);
             } else {
                 $output['resultsUI'] = '';
             }
         }
     } else {
         $output['resultsUI'] = '';
     }
     echo json_encode($output);
     die;
 }
开发者ID:GravityPDF,项目名称:gravityformspolls,代码行数:64,代码来源:class-gf-polls.php

示例5: get_confirmation

 /**
  * Get confirmations for lead based on payment status.
  *
  * @param $lead
  *
  * @param string $payment_status
  *
  * @return mixed
  */
 public function get_confirmation($lead, $payment_status = Pronamic_WP_Pay_Statuses::OPEN)
 {
     $form = GFAPI::get_form($lead['form_id']);
     $feed = get_pronamic_gf_pay_feed_by_entry_id($lead['id']);
     $link = Pronamic_WP_Pay_Extensions_GravityForms_Links::transform_status($payment_status);
     if (!class_exists('GFFormDisplay')) {
         require_once GFCommon::get_base_path() . '/form_display.php';
     }
     // Use only link confirmation if set
     if (isset($feed->links[$link]['confirmation_id']) && !empty($feed->links[$link]['confirmation_id'])) {
         $confirmation_id = $feed->links[$link]['confirmation_id'];
         if (isset($form['confirmations'][$confirmation_id])) {
             $form['confirmations'] = array_intersect_key($form['confirmations'], array($confirmation_id => true));
         }
     }
     return GFFormDisplay::handle_confirmation($form, $lead, false);
 }
开发者ID:wp-pay-extensions,项目名称:gravityforms,代码行数:26,代码来源:Extension.php


注:本文中的GFFormDisplay::handle_confirmation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。