/** * This method compares the Sign string sent by Alipay's response with a Sign string generated with local values * @return bool */ public function compareSign() { require_once dirname(__FILE__) . '/alipay.api.php'; $default_config = array('partner_id' => false, 'service' => false); $credentials = AlipayTools::getCredentials(false, $default_config); $alipayapi = new AlipayApi($credentials); $generated_string = $alipayapi->getResponseSign($this); if ($this->sign != $generated_string) { return false; } return true; }