Braintree\SubscriptionSearch::daysPastDue PHP Method

daysPastDue() public static method

public static daysPastDue ( )
    public static function daysPastDue()
    {
        return new RangeNode('days_past_due');
    }

Usage Example

 public function testSearch_daysPastDue()
 {
     $creditCard = SubscriptionHelper::createCreditCard();
     $triallessPlan = SubscriptionHelper::triallessPlan();
     $subscription = Braintree\Subscription::create(['paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id']])->subscription;
     $http = new Braintree\Http(Braintree\Configuration::$global);
     $path = Braintree\Configuration::$global->merchantPath() . '/subscriptions/' . $subscription->id . '/make_past_due';
     $http->put($path, ['daysPastDue' => 5]);
     $found = false;
     $collection = Braintree\Subscription::search([Braintree\SubscriptionSearch::daysPastDue()->between(2, 10)]);
     foreach ($collection as $item) {
         $found = true;
         $this->assertTrue($item->daysPastDue <= 10);
         $this->assertTrue($item->daysPastDue >= 2);
     }
     $this->assertTrue($found);
 }
All Usage Examples Of Braintree\SubscriptionSearch::daysPastDue