Evolution request #2 : Add a filter on the method

[ad_1]

Hi,

Evolution request.

Is it possible to add a filter on the “get_product_price” method of the “\Stripe\PaymentHelpers” class?

$price_search_args = apply_filters('ppress_stripe_search_price_args', $price_search_args, $subscription, $plan);

<?php 

/**
* @param SubscriptionEntity $subscription
*
* @return mixed
*
* @throws \Exception
*/

public static function get_product_price($subscription, $statement_descriptor)
{
    ...

    $price_search_args = [
        'product' => $stripe_product_id,
        'type'    => $is_recurring ? 'recurring' : 'one_time',
    ];

    if ($is_recurring) {
        $price_search_args['recurring'] = array('interval' => $period);
    }

    $price_search_args = apply_filters('ppress_stripe_search_price_args', $price_search_args, $subscription, $plan);

    $stripe_prices = APIClass::stripeClient()->prices->all($price_search_args)->toArray();

    ...

}

THANKS.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer