當前位置: 首頁>>代碼示例>>PHP>>正文


PHP WC_Subscriptions_Manager::requires_manual_renewal方法代碼示例

本文整理匯總了PHP中WC_Subscriptions_Manager::requires_manual_renewal方法的典型用法代碼示例。如果您正苦於以下問題:PHP WC_Subscriptions_Manager::requires_manual_renewal方法的具體用法?PHP WC_Subscriptions_Manager::requires_manual_renewal怎麽用?PHP WC_Subscriptions_Manager::requires_manual_renewal使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WC_Subscriptions_Manager的用法示例。


在下文中一共展示了WC_Subscriptions_Manager::requires_manual_renewal方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: maybe_generate_manual_renewal_order

 /**
  * Generate an order to record a subscription payment. 
  *
  * This function is hooked to the scheduled subscription payment hook to create a pending
  * order for each scheduled subscription payment.
  *
  * When a payment gateway calls the @see WC_Subscriptions_Manager::process_subscription_payment()
  * @see WC_Order::payment_complete() will be called for the renewal order.
  *
  * @param $user_id int The id of the user who purchased the subscription
  * @param $subscription_key string A subscription key of the form created by @see WC_Subscriptions_Manager::get_subscription_key()
  * @since 1.2
  */
 public static function maybe_generate_manual_renewal_order($user_id, $subscription_key)
 {
     if (WC_Subscriptions_Manager::requires_manual_renewal($subscription_key, $user_id)) {
         $subscription = WC_Subscriptions_Manager::get_users_subscription($user_id, $subscription_key);
         self::generate_renewal_order($subscription['order_id'], $subscription['product_id'], 'child');
     }
 }
開發者ID:edelkevis,項目名稱:git-plus-wordpress,代碼行數:20,代碼來源:class-wc-subscriptions-renewal-order.php

示例2: maybe_generate_manual_renewal_order

 /**
  * Generate an order to record a subscription payment.
  *
  * This function is hooked to the scheduled subscription payment hook to create a pending
  * order for each scheduled subscription payment.
  *
  * When a payment gateway calls the @see WC_Subscriptions_Manager::process_subscription_payment()
  * @see WC_Order::payment_complete() will be called for the renewal order.
  *
  * @param int $user_id The id of the user who purchased the subscription
  * @param string $subscription_key A subscription key of the form created by @see WC_Subscriptions_Manager::get_subscription_key()
  * @since 1.2
  */
 public static function maybe_generate_manual_renewal_order($user_id, $subscription_key)
 {
     if (WC_Subscriptions_Manager::requires_manual_renewal($subscription_key, $user_id)) {
         $subscription = WC_Subscriptions_Manager::get_subscription($subscription_key);
         $renewal_order_id = self::generate_renewal_order($subscription['order_id'], $subscription['product_id'], array('new_order_role' => 'child'));
         do_action('woocommerce_generated_manual_renewal_order', $renewal_order_id);
     }
 }
開發者ID:bulats,項目名稱:chef,代碼行數:21,代碼來源:class-wc-subscriptions-renewal-order.php

示例3: maybe_generate_manual_renewal_order

 /**
  * Generate an order to record a subscription payment.
  *
  * This function is hooked to the scheduled subscription payment hook to create a pending
  * order for each scheduled subscription payment.
  *
  * When a payment gateway calls the @see WC_Subscriptions_Manager::process_subscription_payment()
  * @see WC_Order::payment_complete() will be called for the renewal order.
  *
  * @param int $user_id The id of the user who purchased the subscription
  * @param string $subscription_key A subscription key of the form created by @see WC_Subscriptions_Manager::get_subscription_key()
  * @since 1.2
  */
 public static function maybe_generate_manual_renewal_order($user_id, $subscription_key)
 {
     if (WC_Subscriptions_Manager::requires_manual_renewal($subscription_key, $user_id)) {
         $subscription = WC_Subscriptions_Manager::get_subscription($subscription_key);
         // $0 renewals don't require a pending renewal order, instead a paid renewal order will be created by WC_Subscriptions_Manager::maybe_process_subscription_payment()
         if (WC_Subscriptions_Order::get_recurring_total($subscription['order_id']) > 0) {
             $renewal_order_id = self::generate_renewal_order($subscription['order_id'], $subscription['product_id'], array('new_order_role' => 'child'));
             do_action('woocommerce_generated_manual_renewal_order', $renewal_order_id);
         }
     }
 }
開發者ID:jgabrielfreitas,項目名稱:MultipagosTestesAPP,代碼行數:24,代碼來源:class-wc-subscriptions-renewal-order.php


注:本文中的WC_Subscriptions_Manager::requires_manual_renewal方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。