public function testCreateCustomerFromAttributes()
 {
     $customer = PaymentCustomer::fromAttributes(array('email' => '*****@*****.**', 'first_name' => 'John', 'last_name' => 'Doe', 'address1' => 'rue abc', 'address2' => 'cba', 'postcode' => '12345', 'country' => 'FR'));
     $this->assertEquals('*****@*****.**', $customer->email);
     $this->assertEquals('John', $customer->first_name);
     $this->assertEquals('Doe', $customer->last_name);
     $this->assertEquals('rue abc', $customer->address1);
     $this->assertEquals('cba', $customer->address2);
     $this->assertEquals('12345', $customer->postcode);
     $this->assertEquals('FR', $customer->country);
 }
Example #2
0
 /**
  * The factory method that constructs the API resource.
  *
  * @param   array $attributes the default attributes.
  *
  * @return  PaymentCustomer The new resource.
  */
 public static function fromAttributes(array $attributes)
 {
     $object = new PaymentCustomer();
     $object->initialize($attributes);
     return $object;
 }