I am using a stripe "wc_gateway_stripe_process_response" to get payment information. What is needed is what is the payment interval for that product and what the user's subscription id is. This is the code I have to date:
function woointerface_ProcessOrder($order_id)
{
$order = new WC_Order( $order_id );
$TransactionId = $order->get_transaction_id();
$szOrderId = $order->get_order_number();
// Find all products associated with this order
$order_data = $order->get_data();
$order_billing_email = $order->get_billing_email();
$payment_method = $order->get_payment_method_title();
$PaymentDate = $order->get_date_paid();
$OrderNumber = $order->get_order_number();
$User = get_user_by( 'email', $order_billing_email );
$FirstName = $User->first_name;
$LastName = $User->last_name;
$UserId = $User->ID;
$PayerName = $FirstName . ' ' . $LastName;
$items = $order->get_items();
foreach( $items as $item_id => $product )
{
$ProductName = $product->get_name();
$ProductId = $product->get_product_id();
$PaymentAmount = $product->get_total();
$ProductIndex = wc_get_product($ProductId);
if(! WC_Subscriptions_Product::is_subscription( $ProductIndex ) )
continue;
$UserSubscriptionId = ??
$BillingCycle = ??
// Store in local table.
}
Looking for how to get the User subscription id and billing cycle for this order.