price() public static method

public static price ( )
 public function testIn_multipleValues()
 {
     $creditCard = SubscriptionHelper::createCreditCard();
     $triallessPlan = SubscriptionHelper::triallessPlan();
     $activeSubscription = Braintree\Subscription::create(array('paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id'], 'price' => '4'))->subscription;
     $canceledSubscription = Braintree\Subscription::create(array('paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id'], 'price' => '4'))->subscription;
     Braintree\Subscription::cancel($canceledSubscription->id);
     $collection = Braintree\Subscription::search(array(Braintree\SubscriptionSearch::status()->in(array(Braintree\Subscription::ACTIVE, Braintree\Subscription::CANCELED)), Braintree\SubscriptionSearch::price()->is('4')));
     $this->assertTrue(Test\Helper::includes($collection, $activeSubscription));
     $this->assertTrue(Test\Helper::includes($collection, $canceledSubscription));
 }
 public function testSearch_price()
 {
     $creditCard = SubscriptionHelper::createCreditCard();
     $triallessPlan = SubscriptionHelper::triallessPlan();
     $subscription_850 = Braintree\Subscription::create(['paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id'], 'price' => '8.50'])->subscription;
     $subscription_851 = Braintree\Subscription::create(['paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id'], 'price' => '8.51'])->subscription;
     $subscription_852 = Braintree\Subscription::create(['paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id'], 'price' => '8.52'])->subscription;
     $collection = Braintree\Subscription::search([Braintree\SubscriptionSearch::price()->between('8.51', '8.52')]);
     $this->assertTrue(Test\Helper::includes($collection, $subscription_851));
     $this->assertTrue(Test\Helper::includes($collection, $subscription_852));
     $this->assertFalse(Test\Helper::includes($collection, $subscription_850));
 }
 public function testSearch_price_isRangeNode()
 {
     $node = Braintree\SubscriptionSearch::price();
     $this->assertInstanceOf('Braintree\\RangeNode', $node);
 }
Exemplo n.º 4
-1
 public function testContains()
 {
     $creditCard = SubscriptionHelper::createCreditCard();
     $triallessPlan = SubscriptionHelper::triallessPlan();
     $trialPlan = SubscriptionHelper::trialPlan();
     $trialSubscription = Braintree\Subscription::create(['paymentMethodToken' => $creditCard->token, 'planId' => $trialPlan['id'], 'price' => '9'])->subscription;
     $triallessSubscription = Braintree\Subscription::create(['paymentMethodToken' => $creditCard->token, 'planId' => $triallessPlan['id'], 'price' => '9'])->subscription;
     $collection = Braintree\Subscription::search([Braintree\SubscriptionSearch::planId()->contains("ration_trial_pl"), Braintree\SubscriptionSearch::price()->is("9")]);
     $this->assertTrue(Test\Helper::includes($collection, $trialSubscription));
     $this->assertFalse(Test\Helper::includes($collection, $triallessSubscription));
 }