protected function setUp()
 {
     parent::setUp();
     $this->invoiceItems = new InvoiceItems($this->client);
     $this->customers = new Customers($this->client);
     $this->customerId = $this->customers->createCustomer()->getId();
 }
예제 #2
0
 protected function setUp()
 {
     parent::setUp();
     $this->invoices = new Invoices($this->client);
     $this->customers = new Customers($this->client);
     $customerRequest = $this->customers->createCustomerRequest()->setCard(new CreateCardRequest(self::VISA_1, 1, 2020, 123));
     $this->customerId = $this->customers->createCustomer($customerRequest)->getId();
 }
예제 #3
0
 public function testListCustomers()
 {
     $customer1 = $this->customers->createCustomer();
     $customer2 = $this->customers->createCustomer();
     $this->customers->createCustomer();
     $this->customers->createCustomer();
     $request = new ListRequest();
     $request->setLimit(2);
     $list = $this->customers->listCustomers($request);
     $this->assertInstanceOf(Customers::LIST_CUSTOMERS_RESPONSE_CLASS, $list);
     $this->assertEquals(2, sizeof($list->getData()));
     $this->customers->deleteCustomer($customer1->getId());
     $this->customers->deleteCustomer($customer2->getId());
 }
예제 #4
0
 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();
 }