Skip to content

Commit

Permalink
Improve doc
Browse files Browse the repository at this point in the history
Add a new plan to demo
  • Loading branch information
8ctopus committed May 28, 2024
1 parent 7682034 commit 71ac72c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions demo.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,19 @@
$taxes = new Taxes(0.10, false);
*/

/*
$billingCycles = (new BillingCycles())
->add(new BillingCycle(TenureType::Regular, new Frequency(IntervalUnit::Month, 1), 0, new PricingScheme(4.99, 'USD')));
$paymentPreferences = new PaymentPreferences(true, 'USD', 0, SetupFeeFailure::Continue, 1);
$taxes = new Taxes(0, false);
*/

// first year $24 then from year 2 $1 yearly
$billingCycles = (new BillingCycles())
->add(new BillingCycle(TenureType::Trial, new Frequency(IntervalUnit::Year, 1), 1, new PricingScheme(24, 'USD')))
->add(new BillingCycle(TenureType::Regular, new Frequency(IntervalUnit::Year, 1), 0, new PricingScheme(1, 'USD')));

$paymentPreferences = new PaymentPreferences(true, 'USD', 0, SetupFeeFailure::Continue, 1);
$taxes = new Taxes(0, false);

Expand Down
4 changes: 2 additions & 2 deletions src/Plans.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

/**
* @reference https://developer.paypal.com/docs/api/subscriptions/v1/#plans_list
* @reference https://developer.paypal.com/docs/api/subscriptions/v1/
*/

declare(strict_types=1);
Expand Down Expand Up @@ -80,7 +80,7 @@ public function get(string $id) : array
* @param string $name
* @param string $description
* @param Status $status
* @param BillingCycles $cycles
* @param BillingCycles $cycles - A plan can have at most two trial cycles and only one regular cycle
* @param PaymentPreferences $payment
* @param Taxes $taxes
*
Expand Down

0 comments on commit 71ac72c

Please sign in to comment.