scheduled_subscription_payment

The WooCommerce Billogram Integration scheduled subscription payment function.

Description

scheduled_subscription_payment( (number) $amount_to_charge, $order ); 

Parameters (2)

0. $amount_to_charge (number)
The amount to charge.
1. $order
The order.

Usage

  1. if ( !function_exists( 'scheduled_subscription_payment' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce-billogram-integration/woocommerce-billogram2-extended.php'; 
  3.  
  4. // The amount to charge. 
  5. $amount_to_charge = null; 
  6.  
  7. // The order. 
  8. $order = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = scheduled_subscription_payment($amount_to_charge, $order); 
  12.  

Defined (1)

The function is defined in the following location(s).

/woocommerce-billogram2-extended.php  
  1. function scheduled_subscription_payment($amount_to_charge, $order) { 
  2. logthis("scheduled_subscription_payment_billogram-invoice run for order"); 
  3. logthis($order); 
  4. include_once("class-billogram2-database-interface.php"); 
  5. $fnox = new WC_Billogram_Extended(); 
  6. $database = new WCB_Database_Interface(); 
  7. $database->create_unsynced_order($order->id); 
  8. $customerNumber = $fnox->get_or_create_customer($order); 
  9. $orderNumber = $fnox->send_scheduled_subscription_order_to_billogram($amount_to_charge, $order, $customerNumber); 
  10. if($orderNumber == 0) { 
  11. $database->set_as_synced_subscription($order->id); 
  12. return true;