public function notify(){
$response = file_get_contents( "php://input");
$result = json_decode($response,true);
if($result['password']!='秘钥'){//判断秘钥
$this->error("password error","",500);
}
//产品ID
$product_id = $result['auto_renew_product_id'];
//获取原始交易ID
foreach ($result['unified_receipt']['pending_renewal_info'] as $kk => $vv){
if($vv['product_id'] == $product_id){
$original_transaction_id = $vv['original_transaction_id'];
}
}
if(!$original_transaction_id){
$this->error("original_transaction_id error","",500);
}
//当前交易信息
$latest_receipt_info = $result['unified_receipt']['latest_receipt_info'][0];
//过期时间
$ex
|