public/wordpress/wp-content/plugins/wp-courseware/includes/gateways/gateway-paypal.php
/**
	 * IPN Subscription: Get PayPal Period.
	 *
	 * @since 4.3.0
	 *
	 * @param string $paypal_period The paypal period that is passed with the request.
	 *
	 * @return string $period The actual period name.
	 */
IPN Subscription: Get PayPal Period.

@param string $paypal_period The paypal period that is passed with the request.

@return string $period The actual period name.
IPN Subscription : Get PayPal Period . @param string $paypal_period The paypal period that is passed with the request . @return string $period The actual period name .
protected function ipn_subscription_get_paypal_period( $paypal_period ) {
		$period   = substr( $paypal_period, - 1, 1 );
		$interval = absint( substr( $paypal_period, 0, 1 ) );
		$actual   = '';
		$this->log( sprintf( 'Passed Period: %s', $paypal_period ) );
		$this->log( sprintf( 'Period: %s', $period ) );
		$this->log( sprintf( 'Interval: %s', $interval ) );
		switch ( $period ) {
			case 'D' :
				$actual = 'day';
				break;
			case 'W' :
				$actual = 'week';
				break;
			case 'M' :
				$actual = 'month';
				if ( 3 === absint( $interval ) ) {
					$actual = 'quarter';
				}
				if ( 6 === absint( $interval ) ) {
					$actual = 'semi-year';
				}
				break;
			case 'Y' :
				$actual = 'year';
				break;
			default :
				$actual = 'month';
				break;
		}
		$this->log( sprintf( 'Actual: %s', $actual ) );
		return $actual;
	}
protected function ipn_subscription_get_paypal_period ( $ paypal_period ) { $ period = substr ( $ paypal_period , - 1 , 1 ) ; $ interval = absint ( substr ( $ paypal_period , 0 , 1 ) ) ; $ actual = '' ; $ this -> log ( sprintf ( 'Passed Period: %s' , $ paypal_period ) ) ; $ this -> log ( sprintf ( 'Period: %s' , $ period ) ) ; $ this -> log ( sprintf ( 'Interval: %s' , $ interval ) ) ; switch ( $ period ) { case 'D' : $ actual = 'day' ; break ; case 'W' : $ actual = 'week' ; break ; case 'M' : $ actual = 'month' ; if ( 3 === absint ( $ interval ) ) { $ actual = 'quarter' ; } if ( 6 === absint ( $ interval ) ) { $ actual = 'semi-year' ; } break ; case 'Y' : $ actual = 'year' ; break ; default : $ actual = 'month' ; break ; } $ this -> log ( sprintf ( 'Actual: %s' , $ actual ) ) ; return $ actual ; }
IPN Subscription: Get PayPal Period.
IPN Subscription : Get PayPal Period .