/** * Build a paymentMethod entity based on a json-decoded payment_method stdClass * * @param stdClass $response The payment method data * @return Syspay_Merchant_Entity_PaymentMethod The payment method object */ public static function buildFromResponse(stdClass $response) { $paymentMethod = new self(); $paymentMethod->setType(isset($response->type) ? $response->type : null); $paymentMethod->setDisplay(isset($response->display) ? $response->display : null); return $paymentMethod; }