protected function setUp() { parent::setUp(); $this->subscriptions = new Subscriptions($this->client); $this->plans = new Plans($this->client); $customer = $this->client->request('POST', 'customers'); $this->customerId = $customer['id']; $this->planId = $this->plans->createPlan(new CreatePlanRequest("test_plan" . rand(0, 999999), 350, "usd", "month", "test plan"))->getId(); }
protected function setUp() { parent::setUp(); $this->discounts = new Discounts($this->client); $this->customers = new Customers($this->client); $this->subscriptions = new Subscriptions($this->client); $this->coupons = new Coupons($this->client); $this->plans = new Plans($this->client); $this->couponId = $this->coupons->createCoupon($this->coupons->createCouponRequest('forever')->setPercentOff(50))->getId(); $customerRequest = $this->customers->createCustomerRequest()->setCard(new CreateCardRequest(self::VISA_1, 1, 2020, 123)); $this->customerId = $this->customers->createCustomer($customerRequest)->getId(); $planRequest = $this->plans->createPlanRequest("discounts_test_plan" . rand(0, 999999), 350, 'usd', 'month', 'test plan'); $this->planId = $this->plans->createPlan($planRequest)->getId(); }
/** * @return \Stripe\Response\Plans\PlanResponse */ protected function createPlan() { return $this->plans->createPlan(new CreatePlanRequest("test_plan" . rand(0, 999999), 350, "usd", "month", "test plan")); }