public/wordpress/wp-content/plugins/wp-courseware/includes/gateways/gateway-paypal.php
/**
	 * IPN Subscription: Get Subscription.
	 *
	 * Gets a subscription with the data passed.
	 *
	 * @param Order $order The order object.
	 * @param array $posted The data passed from PayPal.
	 * @param bool  $create Optional. If the subscription does not exist should it be created.
	 *
	 * @return bool|Subscription The Subscription object or false on failure.
	 */
IPN Subscription: Get Subscription.
Gets a subscription with the data passed.

@param Order $order The order object.
@param array $posted The data passed from PayPal.
@param bool  $create Optional. If the subscription does not exist should it be created.

@return bool|Subscription The Subscription object or false on failure.
IPN Subscription : Get Subscription . Gets a subscription with the data passed . @param Order $order The order object . @param array $posted The data passed from PayPal . @param bool $create Optional . If the subscription does not exist should it be created . @return bool|Subscription The Subscription object or false on failure .
protected function ipn_subscription_get_subscription( $order, $posted, $create = false ) {
		$profile_id = isset( $posted['subscr_id'] ) ? wpcw_clean( $posted['subscr_id'] ) : '';
		if ( empty( $profile_id ) ) {
			$profile_id = isset( $posted['recurring_payment_id'] ) ? wpcw_clean( $posted['recurring_payment_id'] ) : '';
		}
		$subscription = wpcw_get_subscription_by_profile_id( $profile_id );
		if ( ! $subscription && ( $subscription_id = $order->get_meta( '_subscription_id', true ) ) ) {
			$subscription = new Subscription( absint( $subscription_id ) );
		}
		if ( ! $subscription && $create ) {
			$subscription = new Subscription();
			$subscription->create();
		}
		return $subscription;
	}
protected function ipn_subscription_get_subscription ( $ order , $ posted , $ create = false ) { $ profile_id = isset ( $ posted [ 'subscr_id' ] ) ? wpcw_clean ( $ posted [ 'subscr_id' ] ) : '' ; if ( empty ( $ profile_id ) ) { $ profile_id = isset ( $ posted [ 'recurring_payment_id' ] ) ? wpcw_clean ( $ posted [ 'recurring_payment_id' ] ) : '' ; } $ subscription = wpcw_get_subscription_by_profile_id ( $ profile_id ) ; if ( ! $ subscription && ( $ subscription_id = $ order -> get_meta ( '_subscription_id' , true ) ) ) { $ subscription = new Subscription ( absint ( $ subscription_id ) ) ; } if ( ! $ subscription && $ create ) { $ subscription = new Subscription ( ) ; $ subscription -> create ( ) ; } return $ subscription ; }
IPN Subscription: Get Subscription.
IPN Subscription : Get Subscription .
// Get Profile Id. // Check for a different posted key in case its empty. // Check for existing subscription. // Check the order for the referenced subscription. // If all else fails, create a new Subscription.