Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
991 lars 1
<?php
2
 
3
namespace Srmklive\PayPal\Traits\PayPalAPI\BillingPlans;
4
 
5
use Throwable;
6
 
7
trait PricingSchemes
8
{
9
    protected $pricing_schemes = [];
10
 
11
    /**
12
     * Add pricing scheme for the billing plan.
13
     *
14
     * @param string $interval_unit
15
     * @param int    $interval_count
16
     * @param float  $price
17
     * @param bool   $trial
18
     *
19
     * @throws Throwable
20
     *
21
     * @return \Srmklive\PayPal\Services\PayPal
22
     */
23
    public function addPricingScheme(string $interval_unit, int $interval_count, float $price, bool $trial = false): \Srmklive\PayPal\Services\PayPal
24
    {
25
        $this->pricing_schemes[] = $this->addPlanBillingCycle($interval_unit, $interval_count, $price, $trial);
26
 
27
        return $this;
28
    }
29
 
30
    /**
31
     * Process pricing updates for an existing billing plan.
32
     *
33
     * @throws \Throwable
34
     *
35
     * @return array|\Psr\Http\Message\StreamInterface|string
36
     */
37
    public function processBillingPlanPricingUpdates()
38
    {
39
        return $this->updatePlanPricing($this->billing_plan['id'], $this->pricing_schemes);
40
    }
41
}