/** * The factory method that constructs the API resource. * * @param array $attributes the default attributes. * * @return PaymentPaymentFailure The new resource. */ public static function fromAttributes(array $attributes) { $object = new PaymentPaymentFailure(); $object->initialize($attributes); return $object; }
public function testCreatePaymentFailureFromAttributes() { $paymentFailure = PaymentPaymentFailure::fromAttributes(array('code' => 'card_stolen', 'message' => 'The card is stolen.')); $this->assertEquals('card_stolen', $paymentFailure->code); $this->assertEquals('The card is stolen.', $paymentFailure->message); }