alipay 异步,同步重定向

feature/trippest
lyt 8 years ago
parent 9a14b97195
commit 2e08bba8ea

@ -1,20 +1,32 @@
## Alipay 支付说明 ##
> update : 2017.08.28 LYT <lyt@hainatravel.com>
## Alipay 国内支付宝支付说明 ##
> update : 2017.09.26 LYT <lyt@hainatravel.com>
国内支付宝仅支持人民币支付
#### 支付链接示例 ####
`https://www.chinahighlights.com/guide-use.php/apps/pay/AlipayTradeService/pay_fun?out_trade_no=20150320010101001&subject=Iphone6&total_amount=88.88&body=Iphone6&return_url=https://m.alipay.com/Gk8NF23&notify_url=https://api.xx.com/receive_notify.htm`
`https://www.chinahighlights.com/securealipay/?b3JkZXJfaWQ9MTUwNDE0NzIwMyZzdWJqZWN0PUlwaG9uZTYmdG90YWxfYW1vdW50PTAuMDEmYm9keT1UcmFja2luZyBDb2RlOjE1MDQxNDcyMDMgVHJhdmVsIEFkdmlzb3I6TGlseSBDb250ZW50OlBheSBmb3IgdG91cg`
##### 链接说明 #####
链接最后一段为base64加密后的订单数据字符串
如上示例链接的
b3JkZXJfaWQ9MTUwNDE0NzIwMyZzdWJqZWN0PUlwaG9uZTYmdG90YWxfYW1vdW50PTAuMDEmYm9keT1UcmFja2luZyBDb2RlOjE1MDQxNDcyMDMgVHJhdmVsIEFkdmlzb3I6TGlseSBDb250ZW50OlBheSBmb3IgdG91cg
加密前为:
order_id=1504147203&subject=Iphone6&total_amount=0.01&body=Tracking Code:1504147203 Travel Advisor:Lily Content:Pay for tour
##### 参数说明 #####
参数 | 类型 | 是否必填 | 最大长度 | 描述 | 示例值
参数 | 类型 | 是否必填 | 最大长度 | 描述 | 示例值
--- | --- | -- | ---- | --- | ---
out_trade_no| String| 是| 64| 商户订单号64个字符以内、可包含字母、数字、下划线需保证在商户端不重复 | 20150320010101001
total_amount | Price | 是 | 11 | 订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] | 88.88
order_id| String| 是| 64| 商户订单号64个字符以内、可包含字母、数字、下划线<br><b style="color:red;">需保证在商户端不重复</b> | 20150320010101001
total_amount | Price | 是 | 11 | 订单总金额,单位为元,精确到小数点后两位 | 88.88
subject | String | 是 | 256 | 订单标题 | Iphone6
body | String | 否 | 128 | 订单描述 | Iphone6
return_url | String | 否 | 256 | 同步返回地址HTTP/HTTPS开头字符串 | https://m.alipay.com/Gk8NF23
notify_url | String | 否 | 256 | 支付宝服务器主动通知商户服务器里指定的页面http/https路径。 | https://api.xx.com/receive_notify.htm
#### 测试 ####
账号| ckdstw3726@sandbox.com
--|--
登录密码|111111
支付密码|111111
余额|约1000
return_url | String | 否 | 256 | 同步跳转地址,**HTTP/HTTPS开头**字符串<br>默认为CH首页 | https://www.chinahighlights.com
notify_url | String | 否 | 256 | 支付宝服务器主动通知商户服务器里指定的页面**HTTP/HTTPS开头**的路径。 | https://api.xx.com/receive_notify.htm
##### 支付选项logo
https://data.chinahighlights.com/pic/alipay_logo_228_80.png
![支付图标地址](http://data.chinahighlights.com/pic/alipay_logo_228_80.png)

@ -1,37 +1,12 @@
<?php
$config['app_id'] = "2017080708076334";
$config['seller_id'] = "2088602150907804";
$config['merchant_private_key'] = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDpDYXixYrQtmcKnHNd3dj0way+D0YTl7bvk44DcgeOOa3HAL/09UjPMDawmH8+/eEaJJHchWybFWfFMFWaEpnZ0UUPTi2jnOXPy84+eRvipx2GTUdIH95ZEUcqgG1rGVpOz97bOtVPaYTPuhrVRg1MCJccZHFxSiU+0mz98QCRxZPNNqdIxHKSimtBI1bB0pjGQtOXpODdyEaW8boQuuMHP9F052am1f2fZAQ3PeTpCQ80KCckcdg3MdbsnlFppy4m6o8uhFfQivnJbHNfKaH9GGmGeNDGN9hGiPJdnAagJbYu7IXw5DcKzgjWfH+5Tg3RClDkAhbvWcxabEV10nyHAgMBAAECggEAEmyEQho10CwrVzZpFGmeZjMNcfUJKDFdP/FdT75rBH5g05OmmTnu6Jo6KJnVrWgqrINpmJJftJ7rljYs/kIsMYEOwZf/maikrlnBU0UFxFRLzDs9wGDslgP8qUp/2/CkKAjc6F3tURrZagafam7gTDt9nrv+D+O5sA64mRa9YcijOAlPzR0MquF28ed9R0rOzXH02OLYkZsmHyPu2SCRtyz/7xAaj737IlPz3meZnBoiE7MMo8uwVfmCsUbP/KJOLUU9O47UspvoCCI5bYQ2g9jrGamXqzqViY9F2BrawhPVNm4KFb1nn/a4jEIfhbF+iQ0qaM/bBXLWZlB2TkmM0QKBgQD3jkjiolhAmHRCW+xo0MmbnOGPTboShbPnn46pXUnIucglUtRSbiXp67wClX7cdfybEKvhFkyy7wmgyt45nTWxLdlna7/9dvQKXmXZYZcKk0oepE8l6iZblAJ1Wm+oGcAXfyFikhE2fxlx1Qs0S6qQg++0V1k8ZY3y7dFSPGApeQKBgQDxAJhLbFKDHRzWwWtYiFQKPj5RieuGVFaYd4H/TiDEiYQrBKxFyeF+kCy3Jr0BpTa9q8Fuxx/zcUZeaZ5uS7Zge8ntww9yC7ABJ525FUIl9kLB754ptRH+JdxYYURwdvOQcXkwU7tdkarH+Shf2B6DJ3ehV+y0IXJS0gENeWRV/wKBgHANFzB+CzQxzW277eYDmz20ZORYakC4BBZzQj+m2h7g+JbsRu6IrOCUsyT4RdPEE/KcOTBIx662Q8VkDfJGFmd8OUt2mhBAJ3YKBE/AvH0s7f+wn6KpuXL6K6KyrJeKEEiSYqobM29XWE0OAWRKW4nOLlGSt/F+hiHPQ0/VxDEBAoGBAKSK/G/aaEd+c/coHatXgNFxh8jR+o0/PdRhG898vyCQpz1btmb7m8p2kyEFANyDuWksQCfrKiRi/WFuiS3S4ZTkT4zWtc/urN9M9gGswvn6NcAFYp4lM0CrBtMMrdZ/UHIZF13ofS84Sjq4IVm2y7ZOFv6AcmrVvyFOoktZyyhvAoGBAOD+zKnbLfKaQmxV8Kg3M/OoDjg8H65aSlrxEeax14T6G8vuJCvBrwngA8F0IsZ15/Qyj+kVj0cZcG3OehuY/GwaPCVKVyO+dcgWGWy3FTcH16Ve2o5EeOGcWXCdAnaVPY6LFNzt93dr1NcC5hUmblwU5MocnLn/Qw0b+OWUgqzj";
$config['notify_url'] = "http://外网可访问网关地址/alipay.trade.page.pay-PHP-UTF-8/notify_url.php";
$config['return_url'] = "http://外网可访问网关地址/alipay.trade.page.pay-PHP-UTF-8/return_url.php";
$config['charset'] = "UTF-8";
$config['sign_type'] = "RSA2";
$config['gatewayUrl'] = "https://openapi.alipay.com/gateway.do";
$config['alipay_public_key'] = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjzkd4BFPKltUscLDPk3QnPnxcxXDY/xlh4r3iYi3zBt8nqp+i6amXI1oqJ0RCWuffHK+EF7aRIY3bTtHL5F9dcMrLrpLRAQc9FOuVXEPIHtCjV7Jbqqa5tpHTsPP4rKv33yjhJrXiSkvpI0O4I9rX2pS2IyZBo9pYrLxlmfVMTSkyrtLkD1tKkaVw+tTkF7gBANzUzY2CU2sieXWJyF4da35j8UWyhgEDGHTsDJ1iM0WZj9F165T4/JbjuHBbiF5KZ6KJ+svxqqyAaJaM3DdNtaxj75rBeRxCZ0tAUWDDBXjb0I42vICu1X5e2hYYKcTj/rdtSiry4Jky15/6JMHVwIDAQAB";
/*
$alipay_config = array (
//应用ID,您的APPID。
'app_id' => "2017080708076334",
//商户私钥
'merchant_private_key' => "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDpDYXixYrQtmcKnHNd3dj0way+D0YTl7bvk44DcgeOOa3HAL/09UjPMDawmH8+/eEaJJHchWybFWfFMFWaEpnZ0UUPTi2jnOXPy84+eRvipx2GTUdIH95ZEUcqgG1rGVpOz97bOtVPaYTPuhrVRg1MCJccZHFxSiU+0mz98QCRxZPNNqdIxHKSimtBI1bB0pjGQtOXpODdyEaW8boQuuMHP9F052am1f2fZAQ3PeTpCQ80KCckcdg3MdbsnlFppy4m6o8uhFfQivnJbHNfKaH9GGmGeNDGN9hGiPJdnAagJbYu7IXw5DcKzgjWfH+5Tg3RClDkAhbvWcxabEV10nyHAgMBAAECggEAEmyEQho10CwrVzZpFGmeZjMNcfUJKDFdP/FdT75rBH5g05OmmTnu6Jo6KJnVrWgqrINpmJJftJ7rljYs/kIsMYEOwZf/maikrlnBU0UFxFRLzDs9wGDslgP8qUp/2/CkKAjc6F3tURrZagafam7gTDt9nrv+D+O5sA64mRa9YcijOAlPzR0MquF28ed9R0rOzXH02OLYkZsmHyPu2SCRtyz/7xAaj737IlPz3meZnBoiE7MMo8uwVfmCsUbP/KJOLUU9O47UspvoCCI5bYQ2g9jrGamXqzqViY9F2BrawhPVNm4KFb1nn/a4jEIfhbF+iQ0qaM/bBXLWZlB2TkmM0QKBgQD3jkjiolhAmHRCW+xo0MmbnOGPTboShbPnn46pXUnIucglUtRSbiXp67wClX7cdfybEKvhFkyy7wmgyt45nTWxLdlna7/9dvQKXmXZYZcKk0oepE8l6iZblAJ1Wm+oGcAXfyFikhE2fxlx1Qs0S6qQg++0V1k8ZY3y7dFSPGApeQKBgQDxAJhLbFKDHRzWwWtYiFQKPj5RieuGVFaYd4H/TiDEiYQrBKxFyeF+kCy3Jr0BpTa9q8Fuxx/zcUZeaZ5uS7Zge8ntww9yC7ABJ525FUIl9kLB754ptRH+JdxYYURwdvOQcXkwU7tdkarH+Shf2B6DJ3ehV+y0IXJS0gENeWRV/wKBgHANFzB+CzQxzW277eYDmz20ZORYakC4BBZzQj+m2h7g+JbsRu6IrOCUsyT4RdPEE/KcOTBIx662Q8VkDfJGFmd8OUt2mhBAJ3YKBE/AvH0s7f+wn6KpuXL6K6KyrJeKEEiSYqobM29XWE0OAWRKW4nOLlGSt/F+hiHPQ0/VxDEBAoGBAKSK/G/aaEd+c/coHatXgNFxh8jR+o0/PdRhG898vyCQpz1btmb7m8p2kyEFANyDuWksQCfrKiRi/WFuiS3S4ZTkT4zWtc/urN9M9gGswvn6NcAFYp4lM0CrBtMMrdZ/UHIZF13ofS84Sjq4IVm2y7ZOFv6AcmrVvyFOoktZyyhvAoGBAOD+zKnbLfKaQmxV8Kg3M/OoDjg8H65aSlrxEeax14T6G8vuJCvBrwngA8F0IsZ15/Qyj+kVj0cZcG3OehuY/GwaPCVKVyO+dcgWGWy3FTcH16Ve2o5EeOGcWXCdAnaVPY6LFNzt93dr1NcC5hUmblwU5MocnLn/Qw0b+OWUgqzj",
//异步通知地址
'notify_url' => "http://外网可访问网关地址/alipay.trade.page.pay-PHP-UTF-8/notify_url.php",
//同步跳转
'return_url' => "http://外网可访问网关地址/alipay.trade.page.pay-PHP-UTF-8/return_url.php",
//编码格式
'charset' => "UTF-8",
//签名方式
'sign_type'=>"RSA2",
//支付宝网关
'gatewayUrl' => "https://openapi.alipay.com/gateway.do",
//支付宝公钥,查看地址https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
'alipay_public_key' => "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjzkd4BFPKltUscLDPk3QnPnxcxXDY/xlh4r3iYi3zBt8nqp+i6amXI1oqJ0RCWuffHK+EF7aRIY3bTtHL5F9dcMrLrpLRAQc9FOuVXEPIHtCjV7Jbqqa5tpHTsPP4rKv33yjhJrXiSkvpI0O4I9rX2pS2IyZBo9pYrLxlmfVMTSkyrtLkD1tKkaVw+tTkF7gBANzUzY2CU2sieXWJyF4da35j8UWyhgEDGHTsDJ1iM0WZj9F165T4/JbjuHBbiF5KZ6KJ+svxqqyAaJaM3DdNtaxj75rBeRxCZ0tAUWDDBXjb0I42vICu1X5e2hYYKcTj/rdtSiry4Jky15/6JMHVwIDAQAB",
);
*/
$config['app_id'] = "2017092108849921";
$config['seller_id'] = "2088221900308281";
$config['notify_url'] = "http://www.mycht.cn/webht.php/apps/pay/alipaytradeservice/alipay_notice";
$config['return_url'] = "https://www.chinahighlights.com/secureipay/alipay_return";
$config['charset'] = "UTF-8";
$config['sign_type'] = "RSA2";
$config['gatewayUrl'] = "https://openapi.alipay.com/gateway.do";
$config['timeout_express'] = "1m";
$config['alipay_public_key'] = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsMpRXezVgTE4/ROKVgWO7AWiVLspzW36lkLF18g2neHV9mfV/kANzrdV170RzJirOuxPecG5LgnKO+MV6giwGJPpUyaRhgYwe1B6Po0LoU4QvI088xjDqNw1vzN7xPRYSgb63mdafVe1qGiHuwelyRYJTZFE3GSb3HSL/5O8MLu0FrIRabgkgOqN7EdznA/WjiGev3tA/10YSrneCcPe49XhKVLvS6cQ3abX48lRr2qxQqh538jYB8/Z/UUVhfQ4BoBqe9JpDQrv4TeIlAXjdqM0Fgz0LXHwXsAiDIeUiKBc+9bAz2vgkRycI+1F3A8VlUG8lwBjqXwzvxZvYzAZYQIDAQAB";
$config['merchant_private_key'] = "MIIEowIBAAKCAQEAzlwm2yj4lHDuGmBnbgdhMry5kfUmQ2ZeZtuTICi5oUATMlcxjHoVYXe5pN+vcZWM1laC8UuKX1K2gSV+46ax4WcAGjb4eItCmvQyq0REYUua+ybYwWtWn1481NLSPfvW2HwM8O9jXj3XBhfQzJsAJJTikM9lZO++6pC2Wtmhw3FjF+O1gkd015MujRUidXESrIwrmnbO/i1IERblXk1gVnvovWnq6VRB2gC9AfzLdkWo3Pq9rAX+MY/eYto/z8UaYU5BNanVIhQ6pAIQazIMawxqsu28AsPRcM8CwFTYcNktAB3feMRhLMqj9GWzkmDWhjrL3NYR+vsYHDAgj7L5ewIDAQABAoIBAFUxVhlEYNtng+T/x7N0+HupzjKjsphAuthb7fFo3rnjagluVdZY0Frcwpd+gT+zLeGO9aAIP6f6zb2jbS8usmEL1M79wraBR44RIpnyJQjF3cWx0+qGFczVauex4XoVbi0RiYYuTieqAAtT6a+OjhCMJr0B4io5j+fmtmHrVw0IFMmbAesV867EH7sn+MmnJCK79KbL5G7lBxZJZempS9ZhwR18WSGpCk90qHGoI9GlPPDWrN2nAVsGVl501vQKc+fUOQSXmAVc+K87q9SeUmrQdM1GbX5UCj+gMEC7sNAnWthCT2H4AFXxvzGLVhvBzRTLZT1SfmAS8zS8LINDxAECgYEA5gWwtS6Ot96E4MHQxjQEx0cP1+P71uI4huA8Lyx+guPymeM2+u4SiWpkuFyzmoNvMxh2fem3Add3kCNF0PNJRIbI0w2vqF+6gQYVIwcS3kqXUeq9oNN6raqFoad1adAUjGQM1SBwc8ARfF3gw8CkePaxikMzFJ6FS15GeA4SueECgYEA5apZCt3dsFzmMyf+/I/X9Bo+fXhnya6QLN+NsLcwnFpWN//rRHnMR7i9jUpyUUDefz9pLAmTkx3roevoGbI7kikqvWallH1rwkgynQAbyHU1XYjM/tRv9zs2TiorakbqrGvzmTdoClwM+dZOXTT4/TbkmcchvlvXkQWGozaIttsCgYEAqKDxS9Im5Jrn1RGhaTyHaEQrVD0Zyg2sHQzUckzvLivIFZLiIpFX24+46QNk09iZM98yNtqYxGvehjelnipMw0UAguEcrpYHV0FLS5OK/JW4W2B4xidjX1+MedcXF4xpFAbg9XnDlsfuybrU5Q0cRmWsAE2FbA9ObtNdW/QNPGECgYAd44J9EIy2VBC9XZoooku3f+bcC1xueeJXhKx68AxKfNM1rH+gxL0aJGe+yI6CFpAePVFhoslq3vz4cKwfE/v+tI7UYVRxM7Vfbmfv2MDE4MQWLSSIkXsU0Mbrez91ME+AKvhj2zsWBg7GQOan6Knywj8T6D9y957hR7fS69j0+wKBgA1Ph+8DTRbvfXKj95KraLdrPGq6hyK0PaF044pi3u2Z1iys99f7aKM0F19akVE9KG1niR4Zit6S1Hqxx+9V6cLw/xxfEl9t9NK8QxGDqmVk9T6TnyMZvMjAi+FADn3hzbRkp1HGT/XUYe2nFuUaATaNhNuuDcuVZtAr78joA+HV";

@ -1,10 +1,17 @@
<?php
$config['app_id'] = "2016073000128520";
$config['seller_id'] = "2088102169208005";
$config['notify_url'] = "https://www.chinahighlights.com/guide-use.php/apps/pay/AlipayTradeService/notify_url";
$config['return_url'] = "http://202.103.68.79/guide-use.php/apps/pay/AlipayTradeService/return_url";
$config['charset'] = "UTF-8";
$config['sign_type'] = "RSA2";
$config['gatewayUrl'] = "https://openapi.alipaydev.com/gateway.do";
$config['app_id'] = "2016073000128520";
$config['seller_id'] = "2088102169208005";
$config['return_url'] = "http://202.103.68.79:88/";
// $config['return_url'] = "http://202.103.68.79:88/securealipay/order_done";
$config['notify_url'] = "https://www.chinahighlights.com/";
// $config['notify_url'] = "http://www.mycht.cn/webht.php/apps/pay/AlipayTradeService/alipay_notice";
$config['charset'] = "UTF-8";
$config['sign_type'] = "RSA2";
$config['gatewayUrl'] = "https://openapi.alipaydev.com/gateway.do";
$config['timeout_express'] = "1m";
$config['alipay_public_key'] = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAohTMgbZ94L1L6OutsOJXNHbD0AbVSrGXSydbbZyO8XrYNqNA7XAGKoRIGPbP17CbQCzeDh1v5DNj/91l7bc1FrL0XIzDHpO656vxhMMrgtpBmm3pgRC+v2REtL32eYu25hGbpAbnYYSnobkQNsAF6vJQiTQtQh1WsFWTM1u7uSDMnkhD19HbBhCgYtEuv8qer5vvkzkG8Zh8c4w4Cd5v5H+8lQ+uMMSgfZXmMUZbvT9J6gPJn2hRGF3rMIKgrOZ0MZWLlt7BRUopMNHQsv5S7Nh2n+K0zP0/1mMwq+kWMgghbsUwS2jZM3lP5BaGbxMMuwpZ02sSQlkNBpREDP+7VwIDAQAB";
$config['merchant_private_key'] = "MIIEpQIBAAKCAQEAx3w/8ArB6EE2mg367cxYGUM1oECgFZmzzEfpVweGz52MS1XCKxk4O/Az/8PD5grKGZ+h7v9JxUpsWBNykmMX3HkfozL6WyWPqEFVU0QInY6zfTUltpFCDVbyiMV9JxhR7HSN/cczVs+6PCdjJF2GIU8PYoaUDB/zsZ+l6GaQXaySJF4AGKisF8om6uBnV2Qt4+gXuGoykQI8/Xg/NhsAs64sjRzJOP9YBpiBYRvlhsj1+L+Row1IdeginkSt+Ms/+hH9KSmyX7uMn56ovXsUPKfEGZzz4SeAKrzhW/9w72sVSTACqGgMC/6TAO3bB8cIHK4NcnpolPqeGITqXUfqswIDAQABAoIBAFeoM3hJYderAFFFn2PrDTNcoy3d9/pF5gn394L0nbqRYlqgPogtttYvwMm8vlJRn2kPCls49rOo9l7lfMzymkOZPdu6xORUZwHqY5IJLTf+wsRcHExTHBE8iaqsDUimmSksNlCzvc2BzjYsoJYUOqJcWUhUFq4VREJjAsZSe1GNgiPtzkw6MiXYF3zIawqC9w6ibtx2eKrLdYF5R0WXi0c9g2ekuKuftIAEWeZKAdZWTeIiLo922jnstj1JO5KWzx//5UqZlRxs8cIPrmKu2RMTlzojqTYnZO3MW+Ynr5VKBmlpbF9A4RrfsuXUaFLU7oTjHlwz7fkDIF6yQyGssXECgYEA8+IG6QL7IhVuDPJjHJSElCBUqVa4zoKzswPWYHnK3kKXPxqv+S9ui2+/BSE9nnwAKcicSsGq6VqM3qMbmsSGUoGiORsBYq5GUcBfo9vGB9I5kl3PqRl9FJyzHiIhBnrM8xH70SOdPuyBaRDVh1o31qXpXgofZ55/zH41iJcvVe8CgYEA0WWGfKx1EdKe+WjV+a4/7mC6p/pHQgP+bI9y9l+6/xcRQBLTgF3VtaOW6+VfubInnHKPQquAVPdGSOx2Pv7XBTLAZmQceRm2rEH10aOqT+fR5XI+BE46yzsa+bJFoBYN++y2FrzNgB/Rz81un/Tpw+lJQI/ATphrRIKWVulRW30CgYEA0DP9LD20QaPD4N+pB0Qvbvmu7SYw/XQNj11OTeyL6XU2A9R3uKbqm7VZgTqgjUVVKlauPw/ZJgB81LCwp07xUUyEPnY0l5cqRy6RN6UvCYxKRA88ciNlagxgye/e+9YoU7bdoOzjmE12KUkK0dOOafwYH4VKzD4+4kg40ZQoABcCgYEAzbGHjMz0K0/U7ne3Sg+LqaTHdt76RLUbppS7f53GWXLVdTWJIh4LIuTSCmRFxmplUt+OLxW9eLl3B4eRGIzJt8eFDI/nEGbb9RbOXOMDGH9GxreUiDI4uw8Sjpo6nulLT1/V9zv8OpIHTrQkqWiygcqWNJ+BbzN2m9QTzshfLRkCgYEA6DKuf9i5pXwmnpMhN5ItoykdS3iMaUUxRo0pxUiapnBl2c4OFD7LQPzPYfCoPRGyT0re6mLV25rSZVcpCPOnJla97JUsUT5WxaiPUxutK1HuXtiAQFr4JyYbxXVHg29e6lDaIlApp0oO9w2Dpz/n6NAvVhicSfT9YFtpWNdHMI8=";

@ -3,6 +3,8 @@
if (!defined('BASEPATH'))
exit('No direct script access allowed');
require_once __DIR__ ."/Mobile_Detect.php";
class AlipayTradeService extends CI_Controller
{
//支付宝网关地址
@ -31,17 +33,23 @@ class AlipayTradeService extends CI_Controller
//签名方式
public $signtype = "RSA2";
public $timeout_express = "1m";
// cht
public function __construct(){
parent::__construct();
$this->load->library('alipay/AopSdk');
// real URL
// $this->config->load('alipay');
$this->config->load('alipay');
// test URL
$this->config->load('dev_alipay');
// $this->config->load('dev_alipay');
$this->load->model('AlipayTradePagePayContentBuilder');
$this->load->model('AlipayTradeWapPayContentBuilder');
$this->load->model('AlipayTradeQueryContentBuilder');
$this->load->model('Alipay_note_model');
$this->load->model('Alipay_model');
$this->load->helper('payment');
$this->gateway_url = $this->config->item('gatewayUrl');
$this->appid = $this->config->item('app_id');
@ -50,48 +58,145 @@ class AlipayTradeService extends CI_Controller
$this->alipay_public_key = $this->config->item('alipay_public_key');
$this->charset = $this->config->item('charset');
$this->signtype = $this->config->item('sign_type');
$this->timeout_express = $this->config->item('timeout_express');
$this->return_url = $this->config->item('return_url');
$this->notify_url = $this->config->item('notify_url');
if(empty($this->appid)||trim($this->appid)==""){
throw new Exception("appid should not be NULL!");
log_message('error','Alipay ERROR appid should not be NULL!');
}
if(empty($this->private_key)||trim($this->private_key)==""){
throw new Exception("private_key should not be NULL!");
log_message('error','Alipay ERROR private_key should not be NULL!');
}
if(empty($this->alipay_public_key)||trim($this->alipay_public_key)==""){
throw new Exception("alipay_public_key should not be NULL!");
log_message('error','Alipay ERROR alipay_public_key should not be NULL!');
}
if(empty($this->charset)||trim($this->charset)==""){
throw new Exception("charset should not be NULL!");
log_message('error','Alipay ERROR charset should not be NULL!');
}
if(empty($this->gateway_url)||trim($this->gateway_url)==""){
throw new Exception("gateway_url should not be NULL!");
log_message('error','Alipay ERROR gateway_url should not be NULL!');
}
}
/*!
* 异步通知
* 必须返回"success"给支付系统
* @author LYT <lyt@hainatravel.com>
* @date 2017-09-13
* @return [type] [description]
*/
public function alipay_notice()
{
$resp_arr = $this->input->post();
$asyns_resp = $this->check($resp_arr);
// 未得到结果
if (empty($asyns_resp->data->out_trade_no)) {
echo "failed";
return;
}
if (true === $this->if_note_exists($dealId)) {
echo "success";
return;
}
$code = $asyns_resp->data->code ? strval($asyns_resp->data->code) : NULL ;
$buyer = $asyns_resp->data->buyer_logon_id ? strval($asyns_resp->data->buyer_logon_id) : NULL ;
if (strcmp(strval($asyns_resp->data->trade_status), "TRADE_SUCCESS") == 0) {
$this->Alipay_note_model->save_alipay(
strval($asyns_resp->data->trade_no)
,strval($asyns_resp->data->out_trade_no)
,"CNY"
,strval($asyns_resp->data->total_amount)
,NULL
,NULL
,strval($asyns_resp->data->gmt_create)
,strval($asyns_resp->data->gmt_payment)
,json_encode($asyns_resp->data)
,strval("pay")
,$code
,strval($asyns_resp->data->trade_status)
,NULL
,$buyer
);
}
// 返回状态码200
echo "success";
return;
}
public function if_note_exists($dealId)
{
return $this->Alipay_note_model->note_exists($dealId) ? true : false;
}
public function request_faild()
{
$data["code"] = 1;
$data["msg"] = "Unknow request";
$data["error_code"] = "Unknow";
$url_query = "";
foreach ($data as $key => $v) {
$url_query .= $key . "=" . urlencode($v) ."&";
}
redirect("https://www.chinahighlights.com/secureipay/load_return" . "?" . substr($url_query, 0, -1));
}
public function get_url_string()
{
$param = ($this->input->get_post('param'));
return base64_decode($param);
}
// cht
public function pay_fun()
{
$param_string = $this->get_url_string();
@parse_str($param_string, $param_arr);
if ( ! $param_string || empty($param_arr['order_id'])) {
$this->request_faild();
return false;
}
//商户订单号,商户网站订单系统中唯一订单号,必填
$out_trade_no = trim($this->input->get_post('out_trade_no'));
$out_trade_no = trim($param_arr['order_id']);
//订单名称,必填
$subject = trim($this->input->get_post('subject'));
$subject = trim($param_arr['subject']);
//付款金额,必填
$total_amount = trim($this->input->get_post('total_amount'));
$total_amount = trim($param_arr['total_amount']);
//商品描述,可空
$body = trim($this->input->get_post('body'));
$this->AlipayTradePagePayContentBuilder->setBody($body);
$this->AlipayTradePagePayContentBuilder->setSubject($subject);
$this->AlipayTradePagePayContentBuilder->setTotalAmount($total_amount);
$this->AlipayTradePagePayContentBuilder->setOutTradeNo($out_trade_no);
$url = $this->pagePay(
$this->AlipayTradePagePayContentBuilder,
$this->config->item('return_url'),
$this->config->item('notify_url'));
$body = str_replace("\n", "<br>", trim($param_arr['body']));
$post_return = $param_arr["return_url"] ? trim($param_arr["return_url"]) : false;
$post_notify = $param_arr["notify_url"] ? trim($param_arr["notify_url"]) : false;
$this->return_url = !empty($post_return) ? ($post_return) : $this->return_url;
$this->notify_url = !empty($post_notify) ? ($post_notify) : $this->notify_url;
$detect = new Mobile_Detect;
if ($detect->isMobile() && !$detect->isTablet()) {
// mobile page
$this->AlipayTradeWapPayContentBuilder->setBody($body);
$this->AlipayTradeWapPayContentBuilder->setSubject($subject);
$this->AlipayTradeWapPayContentBuilder->setOutTradeNo($out_trade_no);
$this->AlipayTradeWapPayContentBuilder->setTotalAmount($total_amount);
$this->AlipayTradeWapPayContentBuilder->setTimeExpress($timeout_express);
$result = $this->wapPay(
$this->AlipayTradeWapPayContentBuilder,
$this->return_url,
$this->notify_url
);
} else {
// PC page
$this->AlipayTradePagePayContentBuilder->setBody($body);
$this->AlipayTradePagePayContentBuilder->setSubject($subject);
$this->AlipayTradePagePayContentBuilder->setTotalAmount($total_amount);
$this->AlipayTradePagePayContentBuilder->setOutTradeNo($out_trade_no);
$url = $this->pagePay(
$this->AlipayTradePagePayContentBuilder,
$this->return_url,
$this->notify_url
);
}
return;
}
@ -105,8 +210,6 @@ class AlipayTradeService extends CI_Controller
function pagePay($builder,$return_url,$notify_url) {
$biz_content=$builder->getBizContent();
//打印业务参数 cht
log_message('error',"\r\n"." Begin \r\n".$biz_content);
$request = new AlipayTradePagePayRequest();
@ -119,6 +222,29 @@ class AlipayTradeService extends CI_Controller
return $response;
}
/**
* alipay.trade.wap.pay
* @param $builder 业务参数使用buildmodel中的对象生成。
* @param $return_url 同步跳转地址,公网可访问
* @param $notify_url 异步通知地址,公网可以访问
* @return $response 支付宝返回的信息
*/
function wapPay($builder,$return_url,$notify_url) {
$biz_content=$builder->getBizContent();
$request = new AlipayTradeWapPayRequest();
$request->setNotifyUrl($notify_url);
$request->setReturnUrl($return_url);
$request->setBizContent ( $biz_content );
// 首先调用支付api
$response = $this->aopclientRequestExecute ($request,true);
// $response = $response->alipay_trade_wap_pay_response;
return $response;
}
/**
* sdkClient
* @param $request 接口请求参数对象。
@ -149,86 +275,280 @@ class AlipayTradeService extends CI_Controller
$result = $aop->Execute($request);
}
//打开后将报文写入log文件 cht
log_message('error',"\r\n\r\nResponse: \r\n".var_export($result,true));
// 打开后将报文写入log文件 cht test
// log_message('error',"\r\n\r\nResponse: \r\n".var_export($result,true));
return $result;
}
public function send_alipay($pn_txn_id = false)
{
$data = array();
$int = 0;
//优先处理指定的交易号,用于修正交易号直接发送通知
if ( ! empty($pn_txn_id)) {
$data['unsend_list'] = array($this->Alipay_note_model->note($pn_txn_id));
}
// 待处理的
if (empty($data['unsend_list'])) {
$data['unsend_list'] = $this->Alipay_note_model->unsend(10);
}
//没有未处理的数据再查找处理失败的数据
if (empty($data['unsend_list'])) {
$data['unsend_list'] = $this->Alipay_note_model->failnote(20);
}
$show_index = 0;
foreach ($data['unsend_list'] as $item) {
//已经发送的不处理,防止重复发送
if ($item->ALI_sent == 'send') {
continue;
}
//退款状态默认为已经处理,陆燕在退款前手动通知外联了,系统跳过处理
if ($item->ALI_payType == 'Refunded') {
$this->Alipay_note_model->update_send($item->ALI_dealId, 'send');
continue;
}
//只处理完成状态,其他状态由陆燕处理
if (strcmp(trim($item->ALI_resultMsg), "TRADE_SUCCESS")) {
$this->Alipay_note_model->update_send($item->ALI_dealId, 'send');
continue;
}
//检测是否是APP订单,默认不处理
// if ((strpos($item->pn_memo, 'China Train Booking') !== false) || (strpos($item->pn_memo, 'ChinaTrainBooking') !== false)) { //APP自动出票的订单不需要处理
// $this->Alipay_note_model->update_send($item->ALI_dealId, 'send');
// continue;
// }
//根据note信息找到订单号
$orderid_info = analysis_orderid($item->ALI_orderId);
//找不到订单号,设置为发送失败标示
if (empty($orderid_info)) {
$this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail');
continue;
}
//根据订单号查找外联信息
$orderid_info = json_decode($orderid_info);
$advisor_info = $this->Alipay_model->get_order($orderid_info->orderid, false, $orderid_info->ordertype);
//查不到订单信息
if (empty($advisor_info)) {
$this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail');
continue;
}
//更新正确的订单信息到记录中,以这个为主
$this->Alipay_note_model->set_invoice($item->ALI_dealId, $orderid_info->orderid . '_' . $orderid_info->ordertype);
//检测是否是APP订单,默认不处理
if ($orderid_info->ordertype == 'A') { //APP自动出票的订单不需要处理
$this->Alipay_note_model->update_send($item->ALI_dealId, 'send');
continue;
}
//添加支付信息入库
//没有分配订单之前先添加付款记录,这个过程可能会执行多次,必须在添加记录前查找是否有数据
if (!empty($orderid_info)) {
//更新还没有填的客邮和交易号de收款记录商务订单
if (isset($advisor_info->order_type) && $advisor_info->order_type == 0) {
$ht_memo = '交易号(自动录入):' . $item->ALI_dealId;
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
//CHTAPP订单添加记录前判断是否有记录以前的APP版本没有交易号只能拿金额来判断
if (substr($advisor_info->COLI_WebCode, 0, 6) == 'CHTAPP') {
//只判断前6位字符CHTAPP-fr CHTAPP-jp等各语种都属于APP订单
// $this->Alipay_model->add_account_info_forAPP($GAI_COLI_SN, $advisor_info->COLI_ID, $item->pn_mc_gross, $item->pn_payment_date, mb_strtoupper($item->pn_mc_currency), $item->pn_payment_date, $item->pn_payment_date, $item->pn_payment_date, '', $item->pn_payer_email, $item->ALI_dealId, $ht_memo);
// if ($advisor_info->COLI_WebCode == 'CHTAPP' && $advisor_info->COLI_State == 11) { //只修改APP组的订单状态并且订单进度是我的订单
// $this->Alipay_model->update_biz_coli_state($GAI_COLI_SN, 8); //把订单状态改为已付款
// }
} else {
$this->Alipay_model->add_account_info(
$GAI_COLI_SN,
$advisor_info->COLI_ID,
$item->ALI_orderAmount,
$item->ALI_completeTime,
mb_strtoupper($item->ALI_currencyCode),
$item->ALI_completeTime,
$item->ALI_completeTime,
$item->ALI_acquiringTime,
$item->ALI_payerName,
$item->ALI_payerEmail,
$item->ALI_dealId,
$ht_memo
);
}
}
//更新还没有填的客邮和交易号de收款记录传统订单
elseif (isset($advisor_info->order_type) && $advisor_info->order_type == 1) {
$ht_memo = '交易号(自动录入):' . $item->ALI_dealId;
$GAI_COLI_SN = isset($advisor_info->COLI_SN) ? $advisor_info->COLI_SN : 0;
$this->Alipay_model->add_tour_account_info(
$GAI_COLI_SN,
$item->ALI_orderAmount,
$item->ALI_acquiringTime,
mb_strtoupper($item->ALI_currencyCode),
$item->ALI_completeTime,
$item->ALI_completeTime,
$item->ALI_acquiringTime,
$item->ALI_payerName,
$item->ALI_payerEmail,
$item->ALI_dealId,
$ht_memo
);
//添加汉特的订单提醒
$this->Alipay_model->update_coli_introduction($GAI_COLI_SN, '已支付 ' . mb_strtoupper($item->ALI_currencyCode) . $item->ALI_orderAmount);
}
}
$opi_email = !empty($advisor_info->OPI_Email) ? $advisor_info->OPI_Email : ''; //lussie@chinahighlights.net
$opi_firstname = !empty($advisor_info->OPI_FirstName) ? $advisor_info->OPI_FirstName : !empty($advisor_info->OPI_Name) ? $advisor_info->OPI_Name : ''; //lussie
//没有外联信息表示订单未分配
if (empty($opi_email) || empty($opi_firstname)) {
$this->Alipay_note_model->update_send($item->ALI_dealId, 'sendfail');
continue;
}
//添加邮件发送记录
//给外联发送通知邮件
$fromName = 'iPayLinks';
$fromEmail = '';
$toName = !empty($opi_firstname) ? $opi_firstname : '';
$toEmail = !empty($opi_email) ? $opi_email : '';
$subject = $orderid_info->orderid . '_' . $orderid_info->ordertype . ' / ' . $item->ALI_orderAmount . $item->ALI_currencyCode . ' / ' . $fromName;
$body = $this->load->view('receipt_mail', $item, true);
$M_RelatedInfo = $item->ALI_sn;
$M_AddTime = $item->ALI_completeTime;
$M_State = 0;
$this->Alipay_model->save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo, $M_State, $M_AddTime, 'iPayLinks note');
//添加邮件发送记录 end
$this->Alipay_note_model->update_send($item->ALI_dealId, 'send');
$int++;
}
// 批量结果
if (empty($pn_txn_id)) {
echo "done. recorde count:".$int;
}
return;
}
/**
* alipay.trade.query (统一收单线下交易查询)
* @param $builder 业务参数使用buildmodel中的对象生成。
* @return $response 支付宝返回的信息
* @return Array object $response 支付宝返回的信息
*/
function Query($builder){
$biz_content=$builder->getBizContent();
//打印业务参数
$request = new AlipayTradeQueryRequest();
$request->setBizContent ( $biz_content );
$response = $this->aopclientRequestExecute ($request);
$response = $response->alipay_trade_query_response;
// test asyns
// $resp_arr = (Array) $response;
// $asyns_resp = $this->check($resp_arr);
// if (strcmp(strval($response->trade_status), "TRADE_SUCCESS") == 0) {
// $this->Alipay_note_model->save_alipay(
// strval($response->trade_no)
// ,strval($response->out_trade_no)
// ,"CNY"
// ,strval($response->total_amount)
// ,NULL
// ,NULL
// ,strval($response->send_pay_date)
// ,strval($response->send_pay_date)
// ,json_encode($response)
// ,strval("pay")
// ,strval($response->code)
// ,strval($response->trade_status)
// ,NULL
// ,strval($response->buyer_logon_id)
// );
// $query = $this->query_pay_result($asyns_resp->data);
// }
return $response;
}
public function query_pay($dealId,$orderId=NULL)
{
$this->AlipayTradeQueryContentBuilder->setTradeNo($dealId);
if ($orderId) {
$this->AlipayTradeQueryContentBuilder->setOutTradeNo($orderId);
}
$response = $this->Query($this->AlipayTradeQueryContentBuilder);
if ( strcmp(trim($response->code), "10000")) {
log_message('error',"Alipay payment failed! error code:".$response->code."; result Msg: ".$response->msg.'; orderId:'.$response->out_trade_no.'; dealId:'.$response->trade_no."; ");
}
$html = '<table>';
foreach ($response as $key => $value) {
$html .= "<tr><td>$key</td><td>$value</td>";
}
$html .= '</table>';
echo $html;
return;
}
/**
* 验签方法
* @param $arr 验签支付宝返回的信息,使用支付宝公钥。
* @return boolean
*/
function check($arr){
$ret = new ArrayObject();
$ret->check = false;
$ret->data = NULL;
$ret->data = $arr_obj = (object) $arr;
$aop = new AopClient();
$aop->alipayrsaPublicKey = $this->alipay_public_key;
$result = $aop->rsaCheckV1($arr, $this->alipay_public_key, $this->signtype);
$ret->check = $result = $aop->rsaCheckV1($arr, $this->alipay_public_key, $this->signtype);
if ($result === false) {
return $result;
log_message('error','Alipay sign ERROR ! orderId:'.$arr_obj->out_trade_no.'; dealId:'.$arr_obj->trade_no . "; Original return:".json_encode($arr)."; ");
return $ret;
}
// cht
// 1.app_id
// 2.seller_id
// 3.查询数据库,验证订单信息,订单号
// 4.订单金额
$verify_ret = true;
if ($arr['app_id'] !== $this->appid) {
$verify_ret = false;
log_message('error','Alipay ERROR APPID verify failed '.$arr_obj->app_id." !== ".$this->appid."; orderId:".$arr_obj->out_trade_no."; dealId:".$arr_obj->trade_no);
return $ret;
}
// 2.seller_id
if ($arr['seller_id'] !== $this->seller_id) {
$verify_ret = false;
log_message('error','Alipay ERROR SELLERID verify failed '.$arr_obj->seller_id." !== ".$this->seller_id."; orderId:".$arr_obj->out_trade_no."; dealId:".$arr_obj->trade_no);
return $ret;
}
log_message('error',"\r\n\r\n Check result: ".$result);
return $verify_ret;
}
// cht
function return_url()
{
$arr = $this->input->get();
$result = $this->check($arr);
if ($result) {
$this->load->view("iPayLinks_rep",array("code"=>0,"msg"=>""));
// echo "付款成功!支付宝交易号:".$arr["trade_no"];
} else {
echo "付款失败!";
// 3.pay status
if (strcmp(strval($arr_obj->trade_status), "TRADE_SUCCESS")) {
log_message('error',"Alipay payment failed! error code:".$arr_obj->trade_status."; result Msg: ".$arr_obj->trade_status.'; orderId:'.$arr_obj->out_trade_no.'; dealId:'.$arr_obj->trade_no."; ");
return $ret;
}
return;
$ret->check = true;
return $ret;
}
// cht
function notify_url()
{
$arr = $this->input->post();
$result = $this->check($arr);
log_message('error',"\r\n\r\n Notify:\r\n".var_export($arr,true));
if ($result) {
/*!
* Do NOT touch
* 不要改这里,必须返回这5个字符
*/
echo "success";
} else {
echo "fail";
}
return;
/** *利用google api生成二维码图片
* $content二维码内容参数
* $size生成二维码的尺寸宽度和高度的值
* $lev可选参数纠错等级
* $margin生成的二维码离边框的距离
*/
function create_erweima($content, $size = '200', $lev = 'L', $margin= '0') {
$content = urlencode($content);
$image = '<img src="http://chart.apis.google.com/chart?chs='.$size.'x'.$size.'&amp;cht=qr&chld='.$lev.'|'.$margin.'&amp;chl='.$content.'" widht="'.$size.'" height="'.$size.'" />';
// http://chart.apis.google.com/chart?chs=200x200&amp;cht=qr&amp;chl=http://www.chinahighlights.com/
return $image;
}
}

File diff suppressed because one or more lines are too long

@ -930,4 +930,8 @@ class IPayLinksService extends CI_Controller
$this->load->view('receipt_mail', $data);
}
public function alipay_return()
{
redirect('https://www.chinahighlights.com');
}
}

@ -0,0 +1,10 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

@ -0,0 +1,182 @@
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
function array_unique_fb($array2D)
{
foreach ($array2D as $v)
{
$v = join(",",$v); //降维,也可以用implode,将一维数组转换为用逗号连接的字符串
$temp[] = $v;
}
$temp = array_unique($temp); //去掉重复的字符串,也就是重复的一维数组
foreach ($temp as $k => $v)
{
$temp[$k] = explode(",",$v); //再将拆开的数组重新组装
}
return $temp;
}
function my_array_unique($array, $keep_key_assoc = false)
{
$duplicate_keys = array();
$tmp = array();
foreach ($array as $key=>$val)
{
// convert objects to arrays, in_array() does not support objects
if (is_object($val))
$val = (array)$val;
if (!in_array($val, $tmp))
$tmp[] = $val;
else
$duplicate_keys[] = $key;
}
foreach ($duplicate_keys as $key)
unset($array[$key]);
return $keep_key_assoc ? $array : array_values($array);
}
//根据URL获取月份
function getaqiMonth($url){
$monArr = array('January','February','March','April','May','June','July','August','September','October','November','December');
$monObj = array(
'January' => '01',
'February' => '02',
'March' => '03',
'April' => '04',
'May' => '05' ,
'June' => '06',
'July' => '07',
'August' => '08',
'September' => '09',
'October' => '10',
'November' => '11',
'December' => '12');
$urlarr = explode("/",$url);
$tmp = $urlarr[(count($urlarr)-1)];
$tmp = ucfirst(str_ireplace('.htm','',$tmp));
//$d=strtotime("00:01am ".$tmp." 15 2015");
if(in_array($tmp,$monArr)){
return $monObj[$tmp];
}else{
return false;
}
}
/*
* 把数组元素组合为字符串
* $container:用来包含元素的符号
* $se:分隔符
* $arr需要重新组合的数组
* 例如:$arr=['aaaa','bbbb'];myimplode("'",",",$arr);得到
* 'aaaa','bbbb'
*/
function my_implode($container,$se,$arr)
{
$str = "";
if ($arr != '') {
$str = "";
$tcount = count($arr);
$tcountInt = 0;
foreach ($arr as $i) {
$tcountInt++;
if ($tcount == $tcountInt) {
$str .= $container . $i . $container;
} else {
$str .= $container . $i . $container . $se;
}
}
}
return $str;
}
/*!
* 解析订单号
* @author LYT <lyt@hainatravel.com>
* @date 2017-09-18
* @param [type] $note_invoice_string [description]
*/
function analysis_orderid($note_invoice_string) {
$data = array();
//空字符串或者小于8位都属于不正确的订单号
if (empty($note_invoice_string) || strlen($note_invoice_string) < 8) {
return false;
}
//APP订单处理如标题China Train Booking-160617462
if ((strpos($note_invoice_string, 'China Train Booking') !== false) || (strpos($note_invoice_string, 'ChinaTrainBooking') !== false)) {
$note_invoice_string = explode('-', $note_invoice_string);
if (isset($note_invoice_string[1])) {
$note_invoice_string = trim($note_invoice_string[1]);
}
return json_encode(array('orderid' => $note_invoice_string, 'ordertype' => 'A')); //APP订单不需要处理交易记录和通知
}
//订单号例子 160420021_B--9608
//Tracking code:2016-05-06-JJ160319027 /Travel advisor:Fiona Jiang /Content:Shanghai, Beijing, Pingyao, Xian, Guilin, Yangshuo, S
if (strpos($note_invoice_string, 'Tracking Code:') !== false) {
$note_invoice_string = explode('Tracking Code:', $note_invoice_string);
$note_invoice_string = explode('Travel Advisor', $note_invoice_string[1]);
$note_invoice_string = trim($note_invoice_string[0]);
}
//订单号过滤
$note_invoice_string = explode('--', $note_invoice_string);
$note_invoice_string = $note_invoice_string[0];
$note_invoice_string = explode('_', $note_invoice_string);
//订单类型识别
$ordertype = 'N';
if (isset($note_invoice_string[1])) {
$ordertype_temp = trim($note_invoice_string[1]);
if (substr($ordertype_temp, 0, 1) == 'T') {
$ordertype = 'T';
} elseif (substr($ordertype_temp, 0, 1) == 'B') {
$ordertype = 'B';
}
}
//手机订单、机票订单都没有加标示,在这里帮加上,暂时的,今后还是要在网前设置好
if ($ordertype == 'N' && isset($note_invoice_string[0])) {
$orderid_temp = $note_invoice_string[0];
if (strlen($orderid_temp) == 9 && substr($orderid_temp, 0, 2) == '16') {
$ordertype = 'B';
}
}
//前台预付款订单以45开头如45117640类型的订单号这个类型的订单会分配到某个新订单去需要查找COLI_AddCode来找新订单号然后再发送通知
if ($ordertype == 'N' && isset($note_invoice_string[0])) {
$orderid_temp = $note_invoice_string[0];
if (strlen($orderid_temp) == 8 && substr($orderid_temp, 0, 2) == '45') {
$ordertype = 'M';
}
}
//新的订单号14733661876255
if ($ordertype == 'N' && isset($note_invoice_string[0])) {
$orderid_temp = $note_invoice_string[0];
if (strlen($orderid_temp) == 14 && substr($orderid_temp, 0, 2) == '14') {
$ordertype = 'M';
}
}
if ($ordertype == 'N') {
return false; //没有编号的订单直接显示错误,由人工分配
}
$note_invoice_string = $note_invoice_string[0];
$note_invoice_string = explode(',', $note_invoice_string);
$orderid = trim($note_invoice_string[0]);
$temp_orderid = explode('-', $orderid);
if (isset($temp_orderid[1])) {
$orderid = trim($temp_orderid[1]);
}
$tempid = explode(' ', $orderid);
$pm_orderid = $tempid[0]; //订单号
if (empty($pm_orderid) || strlen($pm_orderid) < 8) {
return false;
}
return json_encode(array('orderid' => $pm_orderid, 'ordertype' => $ordertype));
}

@ -0,0 +1,124 @@
<?php
/* *
* 功能:支付宝手机网站支付接口(alipay.trade.wap.pay)接口业务参数封装
* 版本2.0
* 修改日期2016-11-01
* 说明:
* 以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己网站的需要,按照技术文档编写,并非一定要使用该代码。
*/
class AlipayTradeWapPayContentBuilder extends CI_Model
{
// 订单描述,可以对交易或商品进行一个详细地描述,比如填写"购买商品2件共15.00元"
private $body;
// 订单标题,粗略描述用户的支付目的。
private $subject;
// 商户订单号.
private $outTradeNo;
// (推荐使用,相对时间) 支付超时时间5m 5分钟
private $timeExpress;
// 订单总金额整形此处单位为元精确到小数点后2位不能超过1亿元
private $totalAmount;
// 如果该字段为空则默认为与支付宝签约的商户的PID也就是appid对应的PID
private $sellerId;
// 产品标示码固定值QUICK_WAP_PAY
private $productCode;
private $bizContentarr = array();
private $bizContent = NULL;
public function getBizContent()
{
if(!empty($this->bizContentarr)){
$this->bizContent = json_encode($this->bizContentarr,JSON_UNESCAPED_UNICODE);
}
return $this->bizContent;
}
public function __construct()
{
$this->bizContentarr['productCode'] = "QUICK_WAP_PAY";
}
public function AlipayTradeWapPayContentBuilder()
{
$this->__construct();
}
public function getBody()
{
return $this->body;
}
public function setBody($body)
{
$this->body = $body;
$this->bizContentarr['body'] = $body;
}
public function setSubject($subject)
{
$this->subject = $subject;
$this->bizContentarr['subject'] = $subject;
}
public function getSubject()
{
return $this->subject;
}
public function getOutTradeNo()
{
return $this->outTradeNo;
}
public function setOutTradeNo($outTradeNo)
{
$this->outTradeNo = $outTradeNo;
$this->bizContentarr['out_trade_no'] = $outTradeNo;
}
public function setTimeExpress($timeExpress)
{
$this->timeExpress = $timeExpress;
$this->bizContentarr['timeout_express'] = $timeExpress;
}
public function getTimeExpress()
{
return $this->timeExpress;
}
public function setTotalAmount($totalAmount)
{
$this->totalAmount = $totalAmount;
$this->bizContentarr['total_amount'] = $totalAmount;
}
public function getTotalAmount()
{
return $this->totalAmount;
}
public function setSellerId($sellerId)
{
$this->sellerId = $sellerId;
$this->bizContentarr['seller_id'] = $sellerId;
}
public function getSellerId()
{
return $this->sellerId;
}
}
?>

@ -0,0 +1,277 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Alipay_model extends CI_Model {
private $HT;
function __construct() {
parent::__construct();
$this->HT = $this->load->database('HT', TRUE);
}
//根据订单号获取外联邮箱
public function get_order($COLI_ID, $orderinfo = false, $ordertype = 'N') {
$result = '';
$fieldsql = $orderinfo == false ? '' : " ,* ";
//先查商务订单B,APP订单A、再查传统订单T
if ($ordertype == 'B' || $ordertype == 'A') {
$sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_ID =?";
$query = $this->HT->query($sql, array($COLI_ID));
$result = $query->result();
}
//后查传统订单的原因是因为传统订单的订单号去掉外联名字首字母后可能会和商务订单的重合。
if (empty($result) && ($ordertype == 'T')) {
$sql = "SELECT TOP 1 1 as order_type, COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_ID like '%$COLI_ID'";
$query = $this->HT->query($sql);
$result = $query->result();
}
//查传统订单add_code网前实时支付会先生成一个临时订单号存在add_code里如订单45103248
if (empty($result) && ($ordertype == 'M')) {
$sql = "SELECT TOP 1 1 as order_type, COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode $fieldsql from ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_AddCode =? ";
$query = $this->HT->query($sql, array($COLI_ID));
$result = $query->result();
}
if (empty($result) && ($ordertype == 'M')) {
$sql = "SELECT TOP 1 1 as order_type, COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode $fieldsql from ConfirmLineInfo cli
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where
EXISTS (
SELECT TOP 1 1
FROM ConfirmLineInfoTmp clit
WHERE clit.COLI_ID = ?
AND cli.COLI_AddCode = CAST(clit.COLI_SN AS VARCHAR(10))
)
";
$query = $this->HT->query($sql, array($COLI_ID));
$result = $query->result();
}
//订单号查询不到尝试使用团号查询
if (empty($result) && $ordertype == 'B') {
$sql = "SELECT TOP 1 0 as order_type,COLI_SN,COLI_ID,OPI_Email,OPI_FirstName,OPI_Name,COLI_WebCode,COLI_State $fieldsql from BIZ_ConfirmLineInfo
LEFT JOIN OperatorInfo ON COLI_OPI_ID=OPI_SN
where COLI_GroupCode like '%-$COLI_ID%'";
$query = $this->HT->query($sql);
$result = $query->result();
}
//团号查询不到尝试使用客人邮箱查询(预订多次的老客户得按日期新旧排序,取最新的数据)
if (!empty($result)) {
//print_r($result[0]);
//die();
$result = $result[0];
}
return $result;
}
//获取收款记录(商务订单)
public function get_money_list($GAI_COLI_ID, $GAI_SQJE, $GAI_SQJECurrency) {
$sql = "SELECT GAI_SN,GAI_CusEmail,GAI_Memo
FROM BIZ_GroupAccountInfo bgai
WHERE bgai.GAI_COLI_ID = ? and GAI_SQJE=? and GAI_SQJECurrency=?
ORDER BY bgai.GAI_SN ASC";
$query = $this->HT->query($sql, array($GAI_COLI_ID, $GAI_SQJE, $GAI_SQJECurrency));
$result = $query->result();
return $result;
}
//获取收款记录(传统订单)
public function get_money_list2($COLI_ID, $GAI_SQJE, $GAI_SQJECurrency) {
$sql = "SELECT COLI_ID,GroupAccountInfo.*
from GroupAccountInfo
left join ConfirmLineInfo on GAI_COLI_SN=COLI_SN
where COLI_ID=? and GAI_SQJE=? and GAI_SQJECurrency=?
ORDER BY GAI_SN ASC";
$query = $this->HT->query($sql, array($COLI_ID, $GAI_SQJE, $GAI_SQJECurrency));
$result = $query->result();
return $result;
}
//更新收款记录(商务订单)
public function update_account_info($GAI_CusEmail, $GAI_Memo, $GAI_SN, $GAI_AccreditNo) {
$sql = "UPDATE BIZ_GroupAccountInfo SET GAI_CusEmail=?, GAI_Memo=?,GAI_AccreditNo=? WHERE GAI_SN=?";
$query = $this->HT->query($sql, array($GAI_CusEmail, $GAI_Memo, $GAI_AccreditNo, $GAI_SN));
return $query;
}
//更新收款记录(传统订单)
public function update_account_info2($GAI_CusEmail, $GAI_Memo, $GAI_SN) {
$sql = "UPDATE GroupAccountInfo SET GAI_CusEmail=?, GAI_Memo=? WHERE GAI_SN=?";
$query = $this->HT->query($sql, array($GAI_CusEmail, $GAI_Memo, $GAI_SN));
return $query;
}
//修改订单状态
public function update_biz_coli_state($coli_sn, $coli_state) {
$sql = "
UPDATE BIZ_ConfirmLineInfo
SET COLI_State = ?
WHERE COLI_SN = ?
";
$query = $this->HT->query($sql, array($coli_state, $coli_sn));
return $query;
}
//添加收款记录(商务订单),APP会自动增加记录所以添加前根据金额来判断是否有重复记录
public function add_account_info_forAPP($GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo) {
//先判断是否有这条数据
$sql = "
IF NOT EXISTS(
SELECT TOP 1 1
FROM BIZ_GroupAccountInfo
WHERE GAI_COLI_SN = ? AND GAI_SQJE=?
)
INSERT INTO BIZ_GroupAccountInfo (
GAI_COLI_SN
,GAI_COLI_ID
,GAI_Type
,GAI_SQJE
,GAI_SQDate
,GAI_SQJECurrency
,GAI_SSDate
,GAI_AccountDate
,GAI_SubmitDate
,GAI_CusName
,GAI_CusEmail
,GAI_AccreditNo
,GAI_Memo
,GAI_State
,DeleteFlag
) VALUES (?,?,15015,?,?,?,?,?,?,?,?,?,?,0,0)";
$query = $this->HT->query($sql, array($GAI_COLI_SN, $GAI_SQJE, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo));
$insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
return $query;
}
//添加收款记录(商务订单)
public function add_account_info($GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo) {
//先判断是否有这条数据
$sql = "
IF NOT EXISTS(
SELECT TOP 1 1
FROM BIZ_GroupAccountInfo
WHERE GAI_AccreditNo = ? OR GAI_Memo LIKE '%$GAI_AccreditNo%'
)
INSERT INTO BIZ_GroupAccountInfo (
GAI_COLI_SN
,GAI_COLI_ID
,GAI_Type
,GAI_SQJE
,GAI_SQDate
,GAI_SQJECurrency
,GAI_SSDate
,GAI_AccountDate
,GAI_SubmitDate
,GAI_CusName
,GAI_CusEmail
,GAI_AccreditNo
,GAI_Memo
,GAI_State
,DeleteFlag
) VALUES (?,?,15015,?,?,?,?,?,?,?,?,?,?,0,0)";
$query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_COLI_ID, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo));
$insertid = $this->HT->last_id('BIZ_GroupAccountInfo');
return $query;
}
//添加收款记录(传统订单)
public function add_tour_account_info($GAI_COLI_SN, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo) {
//先判断是否有这条数据
$sql = "
IF NOT EXISTS(
SELECT TOP 1 1
FROM GroupAccountInfo
WHERE GAI_AccreditNo = ? OR GAI_Memo LIKE '%$GAI_AccreditNo%'
)
INSERT INTO GroupAccountInfo (
GAI_COLI_SN
,GAI_Type
,GAI_SQJE
,GAI_SQDate
,GAI_SQJECurrency
,GAI_SSDate
,GAI_AccountDate
,GAI_SubmitDate
,GAI_CusName
,GAI_CusEmail
,GAI_AccreditNo
,GAI_Memo
,GAI_State
,DeleteFlag
) VALUES (?,15015,?,?,?,?,?,?,?,?,?,?,0,0)";
$query = $this->HT->query($sql, array($GAI_AccreditNo, $GAI_COLI_SN, $GAI_SQJE, $GAI_SQDate, $GAI_SQJECurrency, $GAI_SSDate, $GAI_AccountDate, $GAI_SubmitDate, $GAI_CusName, $GAI_CusEmail, $GAI_AccreditNo, $GAI_Memo));
$insertid = $this->HT->last_id('GroupAccountInfo');
return $query;
}
//更新线路提醒
public function update_coli_introduction($coli_sn, $msg) {
$sql = "
update ConfirmLineInfo
set COLI_Introduction=ISNULL(COLI_Introduction,'')+' '+?
where 1=1
AND ISNULL(COLI_Introduction,'')=''
AND COLI_SN=?
";
// isnull(COLI_Sended,0) in (0,1) 之前判断是新订单或者未分配状态才添加提示的,有些团是后面付款的,所以把限制取消掉
$query = $this->HT->query($sql, array($msg, $coli_sn));
return $query;
}
//存储paypal的实时通知
public function save_paypal_note($pn_txn_id, $pn_invoice, $pn_mc_gross, $pn_item_name, $pn_item_number, $pn_mc_currency, $pn_payment_status, $pn_payer_email, $pn_payment_date, $pn_memo) {
$sql = "
INSERT INTO paypal_note
(
pn_txn_id,pn_invoice, pn_mc_gross, pn_item_name, pn_item_number,pn_mc_currency, pn_payment_status,pn_payer_email,pn_payment_date, pn_memo,pn_datetime
)
VALUES
(
?,?,?,N?,N?,?,?,N?,?, N?, GETDATE()
)
";
$query = $this->HT->query($sql, array($pn_txn_id, $pn_invoice, $pn_mc_gross, $pn_item_name, $pn_item_number, $pn_mc_currency, $pn_payment_status, $pn_payer_email, $pn_payment_date, $pn_memo));
$insertid = $this->HT->last_id('paypal_note');
return $query;
}
public function update_mail($mail_sn, $mail_to, $mail_to_name, $mail_sendstate = 0) {
$sql = "UPDATE Email_AutomaticSend SET M_ToEmail=N?,M_ToName=N?,M_State=? WHERE M_SN =? ";
$query = $this->HT->query($sql, array($mail_to, $mail_to_name, $mail_sendstate, $mail_sn));
return $query;
}
public function save_automail($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_RelatedInfo = '', $M_State = 0, $M_AddTime = '', $frominfo = 'paypal msg', $M_Web = 'paypal msg') {
$sql = "INSERT INTO
Email_AutomaticSend (
M_ReplyToName,
M_ReplyToEmail,
M_ToName,
M_ToEmail,
M_Title,
M_Body,
M_Web,
M_FromName,
M_ServiceSN,
M_State,
M_AddTime
) VALUES (N?, N?, N?, N?, N?, N?, ?, N?, ?,?,getdate()) ";
$query = $this->HT->query($sql, array($fromName, $fromEmail, $toName, $toEmail, $subject, $body, $M_Web, $frominfo, $M_RelatedInfo, $M_State));
return $query;
}
}

@ -0,0 +1,194 @@
<?php
if (!defined('BASEPATH'))
exit('No direct script access allowed');
class Alipay_note_model extends CI_Model {
var $topnum = false;
var $orderby = false;
var $send = false;
var $search = false;
var $dealId = false;
var $payment_status = false;
function __construct() {
parent::__construct();
$this->INFO = $this->load->database('INFO', TRUE);
}
public function init() {
$this->topnum = false;
$this->send = false;
$this->search = false;
$this->payment_status = false;
$this->dealId = false;
$this->orderby = ' ORDER BY pn.ALI_sn DESC ';
}
public function unsend($topnum = 2) {
$this->init();
$this->topnum = $topnum;
$this->send = " AND (ALI_sent='unsend' OR ALI_sent='' OR ALI_sent IS NULL) ";
return $this->get_list();
}
public function failnote($topnum = 2) {
$this->init();
$this->topnum = $topnum;
$this->send = " AND ALI_sent='sendfail' ";
return $this->get_list();
}
public function search_date($date) {
$this->init();
$search_sql = " AND pn.ALI_noticeTime BETWEEN '$date 00:00:00' AND '$date 23:59:59' ";
$this->search = $search_sql;
$this->orderby=" ORDER BY CASE pn.ALI_sent WHEN 'sendfail' THEN 1 ELSE 2 END ,pn.ALI_sn DESC ";
return $this->get_list();
}
public function note($txn_id){
$this->init();
$this->topnum=1;
$this->dealId=" AND pn.ALI_dealId=".$this->INFO->escape($txn_id);
return $this->get_list();
}
public function note_order($orderid,$notice_time)
{
$this->init();
$this->topnum=1;
$this->dealId=" AND pn.ALI_orderId=".$this->INFO->escape($orderid)." AND pn.ALI_noticeTime=".$this->INFO->escape($notice_time);
return $this->get_list();
}
public function search_key($search_key) {
$this->init();
$this->topnum = 300; //限制最大数量,防止查询单词过短
$search_sql = '';
$search_key = trim($search_key);
if (!empty($search_key)) {
$search_sql.=" AND ( pn.ALI_dealId = '$search_key'
OR pn.ALI_orderId like '%$search_key%' )";
}
$this->search = $search_sql;
return $this->get_list();
}
public function note_exists($dealId)
{
$this->init();
$this->topnum = 1;
$this->search = " AND pn.ALI_dealId = '".$dealId."' ";
return $this->get_list();
}
/*!
* 存储IPayLinks的实时通知
* @author LYT <lyt@hainatravel.com>
* @date 2017-08-29
*/
public function save_alipay($ALI_dealId,$ALI_orderId,$ALI_currencyCode,$ALI_orderAmount,$ALI_payAmount,$ALI_stateCode,$ALI_acquiringTime,$ALI_completeTime,$ALI_memo,$ALI_payType,$ALI_resultCode=null,$ALI_resultMsg=null,$ALI_payerName=null,$ALI_payerEmail=NULL) {
$sql = "
INSERT INTO AlipayLog
(
ALI_dealId,ALI_orderId,ALI_currencyCode,ALI_orderAmount,ALI_payAmount,ALI_stateCode,ALI_acquiringTime,ALI_completeTime,ALI_memo,ALI_sent,ALI_noticeTime,ALI_payType,ALI_resultCode,ALI_resultMsg,ALI_payerName,ALI_payerEmail
)
VALUES
(
?,?,?,?,?,?,?,?,?,'unsend', GETDATE(),?,?,N?,?,N?
)
";
// echo "<br><br>".$this->INFO->compile_binds($sql,
$query = $this->INFO->query($sql,
array($ALI_dealId
,$ALI_orderId
,strtoupper($ALI_currencyCode)
,$ALI_orderAmount
,$ALI_payAmount
,$ALI_stateCode
,$ALI_acquiringTime
,$ALI_completeTime
,$ALI_memo
,$ALI_payType
,$ALI_resultCode
,$ALI_resultMsg
,$ALI_payerName
,$ALI_payerEmail
));
$insertid = $this->INFO->last_id('AlipayLog');
return $query;
}
public function get_list() {
$this->topnum ? $sql = "SELECT TOP " . $this->topnum : $sql = "SELECT ";
$sql .= "
pn.ALI_sn
,pn.ALI_dealId
,pn.ALI_orderId
,pn.ALI_currencyCode
,pn.ALI_orderAmount
,pn.ALI_payAmount
,pn.ALI_stateCode
,pn.ALI_resultCode
,pn.ALI_resultMsg
,pn.ALI_acquiringTime
,pn.ALI_completeTime
,pn.ALI_memo
,pn.ALI_sent
,pn.ALI_payType
,pn.ALI_noticeTime
,pn.ALI_payerName
,pn.ALI_payerEmail
FROM AlipayLog pn
WHERE 1=1
";
$this->send ? $sql.=$this->send : false;
$this->search ? $sql.=$this->search : false;
$this->dealId ? $sql.=$this->dealId : false;
$this->orderby ? $sql.=$this->orderby : false;
$query = $this->INFO->query($sql);
if ($this->topnum === 1) {
if ($query->num_rows() > 0) {
$row = $query->row();
return $row;
} else {
return FALSE;
}
} else {
return $query->result();
}
}
public function update_send($pn_txn_id, $pn_send) {
$sql = "
UPDATE AlipayLog
SET ALI_sent = ?
WHERE ALI_dealId = ?
";
return $this->INFO->query($sql, array($pn_send, $pn_txn_id));
}
//设置订单号
public function set_invoice($pn_txn_id, $pn_invoice) {
$sql = "
UPDATE AlipayLog
SET ALI_orderId = ?
WHERE ALI_dealId = ?
";
return $this->INFO->query($sql, array($pn_invoice, $pn_txn_id));
}
public function update_query($dealId,$stateCode,$payAmount)
{
$sql = "
UPDATE AlipayLog
SET ALI_stateCode = ?,
ALI_payAmount = ?
where ALI_dealId = ?
";
return $this->INFO->query($sql, array($stateCode,$payAmount,$dealId));
}
}
Loading…
Cancel
Save