public/wordpress/wp-content/plugins/wp-courseware/includes/gateways/stripe/stripe-api.php
/**
	 * Internal Stripe Api: Get Subscription Payment.
	 *
	 * @since 4.3.0
	 *
	 * @param string $id The subscription id.
	 *
	 * @return Charge The subscription charge.
	 */
Internal Stripe Api: Get Subscription Payment.

@param string $id The subscription id.

@return Charge The subscription charge.
Internal Stripe Api : Get Subscription Payment . @param string $id The subscription id . @return Charge The subscription charge .
protected function api_get_subscription_payment( $id = '' ) {
		if ( empty( $id ) ) {
			throw new Stripe_Exception( 'stripe-api-subscription-id-empty', esc_html__( 'The subscription id required to get the charge/payment is empty or not set. Please try again.', 'wp-courseware' ) );
		}
		$invoices = $this->get_invoices( array(
			'subscription' => $id,
			'limit'        => 1,
			'expand'       => array( 'data.charge.balance_transaction' ),
		) );
		if ( ! empty( $invoices->error ) ) {
			return $invoices;
		}
		$payment = false;
		if ( is_array( $invoices->data ) && isset( $invoices->data[0] ) ) {
			$payment = $invoices->data[0]->charge;
		}
		return $payment;
	}
protected function api_get_subscription_payment ( $ id = '' ) { if ( empty ( $ id ) ) { throw new Stripe_Exception ( 'stripe-api-subscription-id-empty' , esc_html__ ( 'The subscription id required to get the charge/payment is empty or not set. Please try again.' , 'wp-courseware' ) ) ; } $ invoices = $ this -> get_invoices ( array ( 'subscription' => $ id , 'limit' => 1 , 'expand' => array ( 'data.charge.balance_transaction' ) , ) ) ; if ( ! empty ( $ invoices -> error ) ) { return $ invoices ; } $ payment = false ; if ( is_array ( $ invoices -> data ) && isset ( $ invoices -> data [ 0 ] ) ) { $ payment = $ invoices -> data [ 0 ] -> charge ; } return $ payment ; }
Internal Stripe Api: Get Subscription Payment.
Internal Stripe Api : Get Subscription Payment .