Esempio n. 1
0
 function testCreateCustomerWithCardToken()
 {
     /* Token should be created via JavaScipt library Beautiful.js */
     /* more info here: https://docs.start.payfort.com/guides/beautiful.js/ */
     $token = TestHelper::createToken(array("number" => "4242424242424242", "exp_month" => 11, "exp_year" => 2020, "cvc" => "123"));
     $customer = Start_Customer::create(array("email" => "*****@*****.**", "card" => $token["id"]));
     $this->assertEquals($customer["email"], "*****@*****.**");
     $this->assertEquals($customer["default_card_id"], $token["card"]["id"]);
     $this->assertCount(1, $customer["cards"]);
     $this->assertEquals($customer["cards"][0]["id"], $token["card"]["id"]);
 }
 function testRetrieveCustomerId()
 {
     $result = Start_Customer::create($this->success_data);
     $this->assertArrayHasKey('id', $result);
 }