PB调用C#动态库轻松实现微信、支付宝支付

 

PB调用C#动态库轻松实现微信、支付宝支付,可用于医院、超市

下载地址:https://download.csdn.net/download/weixin_41317666/10781025

 

if rb_2.checked=true then
//【生成传递参数】
if sle_4.text='' then
	messagebox('系统提示【MYSOFT】','订单号不能为空!')
	return
end if
if sle_code.text='' then
	messagebox('系统提示【MYSOFT】','付款码不能为空!')
	sle_code.setfocus()
	return
end if
string ls_data
string ls_url
ls_data=inv_wxpay.of_zfb_sign_pay(sle_code.text,sle_4.text,dec(em_1.text),'条码支付','条码支付')
ls_url='https://openapi.alipay.com/gateway.do?'
mle_1.text=ls_url
mle_2.text=ls_data
mle_2.text=inv_wxpay.of_post(ls_url,ls_data)
mle_1.text=inv_wxpay.of_json_to_xml(mle_2.text)
//【无效的APPID参数】
if gf_xml_resolve_t(mle_1.text,'msg')='Invalid Arguments' and gf_xml_resolve_t(mle_1.text,'code')='40002' then
	messagebox('系统提示【MYSOFT】',gf_xml_resolve_t(mle_1.text,'sub_msg'))
	return
end if
//【支付成功】
if gf_xml_resolve_t(mle_1.text,'msg')='Success' and gf_xml_resolve_t(mle_1.text,'code')='10000' then
messagebox('系统提示【MYSOFT】',"支付成功,交易单号:"+gf_xml_resolve_t(mle_1.text,'trade_no'))
 if dw_2.rowcount()=1 then
	dw_2.object.in_xml[1]=mle_1.text
	dw_2.object.out_xml[1]=mle_2.text
	dw_2.object.amount[1]=dec(em_1.text)
	dw_2.object.zfb_sign[1]=gf_xml_resolve(mle_1.text,'sign')
	dw_2.object.dd_code[1]=sle_4.text
	dw_2.object.fk_code[1]=sle_code.text
	dw_2.object.zffs[1]=1//【1刷卡,2扫码】
	if dw_2.update()=1 then
		commit;
		dw_2.retrieve(trim(sle_4.text))
	else
		rollback;
	end if
 end if
  cb_15.triggerevent(clicked!)//【执行查单】
  cb_7.triggerevent(clicked!)//【刷新】
end if
end if
//【需要输入密码】
if gf_xml_resolve_t(mle_1.text,'code')='10003' and  gf_xml_resolve_t(mle_1.text,'msg')='order success pay inprocess' then
	messagebox('支付提示【MYSOFT】','状态:【'+gf_xml_resolve_t(mle_1.text,'msg')+'】~n~n【特别注意】:请等候服务对象输入密码确认成功后点[确定]...~n~n还可通过【查询订单状态】检查订单支付情况!')
 if dw_2.rowcount()=1 then
	dw_2.object.in_xml[1]=mle_1.text
	dw_2.object.amount[1]=dec(em_1.text)
	//dw_2.object.barcode[1]=gf_xml_resolve(mle_2.text,'code_url')
	dw_2.object.dd_code[1]=sle_4.text
	dw_2.object.fk_code[1]=sle_code.text
	dw_2.object.zffs[1]=1//【1刷卡,2扫码】
	dw_2.object.trade_state[1]='订单未支付'
	if dw_2.update()=1 then
		commit using sqlca;
		dw_2.retrieve(trim(sle_4.text))
	else
		rollback using sqlca;
	end if
 end if
  cb_1.triggerevent(clicked!)
  cb_7.triggerevent(clicked!)
end if

/*
app_id	String	是	32	支付宝分配给开发者的应用ID	2014072300007148
method	String	是	128	接口名称	alipay.trade.pay
format	String	否	40	仅支持JSON	JSON
charset	String	是	10	请求使用的编码格式,如utf-8,gbk,gb2312等	utf-8
sign_type	String	是	10	商户生成签名字符串所使用的签名算法类型,目前支持RSA2和RSA,推荐使用RSA2	RSA2
sign	String	是	344	商户请求参数的签名串,详见签名	详见示例
timestamp	String	是	19	发送请求的时间,格式"yyyy-MM-dd HH:mm:ss"	2014-07-24 03:07:50
version	String	是	3	调用的接口版本,固定为:1.0	1.0
notify_url	String	否	256	支付宝服务器主动通知商户服务器里指定的页面http/https路径。	http://api.test.alipay.net/atinterface/receive_notify.htm
app_auth_token	String	否	40	详见应用授权概述	
biz_content	String	是		请求参数的集合,最大长度不限,除公共参数外所有请求参数都必须放在这个参数中传递,具体参照各产品快速接入文档	

out_trade_no	String	必选	64	商户订单号,64个字符以内、可包含字母、数字、下划线;需保证在商户端不重复	20150320010101001
scene	String	必选	32	支付场景 
条码支付,取值:bar_code 
声波支付,取值:wave_code	bar_code
auth_code	String	必选	32	支付授权码,25~30开头的长度为16~24位的数字,实际字符串长度以开发者获取的付款码长度为准	28763443825664394
product_code	String	可选	32	销售产品码	FACE_TO_FACE_PAYMENT
subject	String	必选	256	订单标题	Iphone6 16G
buyer_id	String	可选	28	买家的支付宝用户id,如果为空,会从传入了码值信息中获取买家ID	2088202954065786
seller_id	String	可选	28	如果该值为空,则默认为商户签约账号对应的支付宝用户ID	2088102146225135
total_amount	Price	可选	11	订单总金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000] 
如果同时传入【可打折金额】和【不可打折金额】,该参数可以不用传入; 
如果同时传入了【可打折金额】,【不可打折金额】,【订单总金额】三者,则必须满足如下条件:【订单总金额】=【可打折金额】+【不可打折金额】	88.88
trans_currency	String	可选	8	标价币种, total_amount 对应的币种单位。支持英镑:GBP、港币:HKD、美元:USD、新加坡元:SGD、日元:JPY、加拿大元:CAD、澳元:AUD、欧元:EUR、新西兰元:NZD、韩元:KRW、泰铢:THB、瑞士法郎:CHF、瑞典克朗:SEK、丹麦克朗:DKK、挪威克朗:NOK、马来西亚林吉特:MYR、印尼卢比:IDR、菲律宾比索:PHP、毛里求斯卢比:MUR、以色列新谢克尔:ILS、斯里兰卡卢比:LKR、俄罗斯卢布:RUB、阿联酋迪拉姆:AED、捷克克朗:CZK、南非兰特:ZAR、人民币:CNY	USD
settle_currency	String	可选	8	商户指定的结算币种,支持英镑:GBP、港币:HKD、美元:USD、新加坡元:SGD、日元:JPY、加拿大元:CAD、澳元:AUD、欧元:EUR、新西兰元:NZD、韩元:KRW、泰铢:THB、瑞士法郎:CHF、瑞典克朗:SEK、丹麦克朗:DKK、挪威克朗:NOK、马来西亚林吉特:MYR、印尼卢比:IDR、菲律宾比索:PHP、毛里求斯卢比:MUR、以色列新谢克尔:ILS、斯里兰卡卢比:LKR、俄罗斯卢布:RUB、阿联酋迪拉姆:AED、捷克克朗:CZK、南非兰特:ZAR、人民币:CNY	USD
discountable_amount	Price	可选	11	参与优惠计算的金额,单位为元,精确到小数点后两位,取值范围[0.01,100000000]。 
如果该值未传入,但传入了【订单总金额】和【不可打折金额】,则该值默认为【订单总金额】-【不可打折金额】	8.88
*/
/*
//【输入密码】
<?xml version="1.0" standalone="yes"?>
<root>
  <alipay_trade_pay_response>
    <code>10003</code>
    <msg> order success pay inprocess</msg>
    <buyer_logon_id>epg***@sandbox.com</buyer_logon_id>
    <buyer_pay_amount>0.00</buyer_pay_amount>
    <buyer_user_id>2088102176072774</buyer_user_id>
    <buyer_user_type>PRIVATE</buyer_user_type>
    <invoice_amount>0.00</invoice_amount>
    <out_trade_no>401466448333</out_trade_no>
    <point_amount>0.00</point_amount>
    <receipt_amount>0.00</receipt_amount>
    <total_amount>1.00</total_amount>
    <trade_no>2018060721001004770200414550</trade_no>
  </alipay_trade_pay_response>
  <sign>I1DyhmOtDD+mJvdWVPP4PFnNjJsIuujPtv8zEGiv8w+LHn49/VTQN4NKv2pP9dyGVljJbRQ0cX7MfVp54reRo8sY40rmdrVFnClAuf4PeldUTjxmu9NnpJ2wqf/G3y8gP2i9w0nJwIgYXs2/chOtkDe1bOaNM13L+WRgbhdwXPVf3fkPMQvSVdLdDa/iltv2Wg9fYc4cIVw3DzI2EjHouWj8sHAvAXorDueIjwSHiz9NocmXyDd670k67AMSWxFaLedcVzIRQzl054bD0w9ueFdNvhVO8fKNV09RKb7QLm8P12/kqJE6UPBqztgPZT8YhO74pqoSjtb3ibIEmsvMAA==</sign>
</root>

//【交易成功】
{"alipay_trade_pay_response":{"code":"10000","msg":"Success","buyer_logon_id":"epg***@sandbox.com","buyer_pay_amount":"16.20","buyer_user_id":"2088102176072774","buyer_user_type":"PRIVATE","fund_bill_list":[{"amount":"16.20","fund_channel":"ALIPAYACCOUNT"}],"gmt_payment":"2018-06-05 16:18:32","invoice_amount":"16.20","out_trade_no":"41466436603","point_amount":"0.00","receipt_amount":"16.20","total_amount":"16.20","trade_no":"2018060521001004770200409266","sign":"PWtxUOiDY0rXupcvmgxLS0SWNBu+mGYuYvZiotoLQOluf8i7UrufXlGymdKNgS/kPFz1eNjdug8w06ZybEiOidErYC8FuPJA7kcgbFTYFtn3memdQM8Q4ztdYLyrX4GWYu7R8vu9IztvgOje4evHkR88slZYzaSrbK5zgOEMRkxcxHcuScPQrsXGNp/oHs7pJpNqG/lC3nJw0e0sYvq9zogZaFxMetU3yjDXjDs0YL2g0vQJoFw3oDZU2wHuBDVIjuKz6+v/EYpkbOh/gqMqg24/sLHmLdhYKSbfIRmjEK/7GT0ZCwO8CqTORocorkmm4SVPX07xfh8GgHywp1UViA=="}}

<?xml version="1.0"?>
<alipay_trade_pay_response>
  <code>10000</code>
  <msg>Success</msg>
  <buyer_logon_id>epg***@sandbox.com</buyer_logon_id>
  <buyer_pay_amount>16.20</buyer_pay_amount>
  <buyer_user_id>2088102176072774</buyer_user_id>
  <buyer_user_type>PRIVATE</buyer_user_type>
  <fund_bill_list>
    <amount>16.20</amount>
    <fund_channel>ALIPAYACCOUNT</fund_channel>
  </fund_bill_list>
  <gmt_payment>2018-06-05 16:18:32</gmt_payment>
  <invoice_amount>16.20</invoice_amount>
  <out_trade_no>41466436603</out_trade_no>
  <point_amount>0.00</point_amount>
  <receipt_amount>16.20</receipt_amount>
  <total_amount>16.20</total_amount>
  <trade_no>2018060521001004770200409266</trade_no>
  <sign>PWtxUOiDY0rXupcvmgxLS0SWNBu+mGYuYvZiotoLQOluf8i7UrufXlGymdKNgS/kPFz1eNjdug8w06ZybEiOidErYC8FuPJA7kcgbFTYFtn3memdQM8Q4ztdYLyrX4GWYu7R8vu9IztvgOje4evHkR88slZYzaSrbK5zgOEMRkxcxHcuScPQrsXGNp/oHs7pJpNqG/lC3nJw0e0sYvq9zogZaFxMetU3yjDXjDs0YL2g0vQJoFw3oDZU2wHuBDVIjuKz6+v/EYpkbOh/gqMqg24/sLHmLdhYKSbfIRmjEK/7GT0ZCwO8CqTORocorkmm4SVPX07xfh8GgHywp1UViA==</sign>
</alipay_trade_pay_response>

//【未输入正确的付款码】
{"alipay_trade_pay_response":{"code":"40004","msg":"Business Failed","sub_code":"ACQ.PAYMENT_AUTH_CODE_INVALID","sub_msg":"支付失败,获取顾客账户信息失败,请顾客刷新付款码后重新收款,如再次收款失败,请联系管理员处理。[SOUNDWAVE_PARSER_FAIL]","buyer_pay_amount":"0.00","invoice_amount":"0.00","point_amount":"0.00","receipt_amount":"0.00","sign":"Bx9gySo/h9chpRxb5wIaWZe/b4/ST/AvBdv7jCbDVUHOIDWmR/K9pG2ks6QmrBFJpK9xwqIHugEkuaxZ7iuoFDQEUOP+4iIebfqckDeC56BvgeFT0JycvkwINmozVqrCW3LP1g/ciBVn14aGQ0ArmP7lhYe24cPQ4utFKJT/dW4KhILOoZYp6bTmZbhlzAXlA3zk1Md6pzWo9s3k3xpA3rqK31hUwit6QmrgeYAnBHjLGp/9c1H5HZpbIBow+tUyQcWumhxkyNNLl8Gdl6e4SVby642WO/tUs9FiKSpkmiOWoLSekL/b3yvRPCyA8K5Tw5EYuirs0MA2/ODEiTK5gQ=="}}

<?xml version="1.0"?>
<alipay_trade_pay_response>
  <code>40004</code>
  <msg>Business Failed</msg>
  <sub_code>ACQ.PAYMENT_AUTH_CODE_INVALID</sub_code>
  <sub_msg>支付失败,获取顾客账户信息失败,请顾客刷新付款码后重新收款,如再次收款失败,请联系管理员处理。[SOUNDWAVE_PARSER_FAIL]</sub_msg>
  <buyer_pay_amount>0.00</buyer_pay_amount>
  <invoice_amount>0.00</invoice_amount>
  <point_amount>0.00</point_amount>
  <receipt_amount>0.00</receipt_amount>
  <sign>Bx9gySo/h9chpRxb5wIaWZe/b4/ST/AvBdv7jCbDVUHOIDWmR/K9pG2ks6QmrBFJpK9xwqIHugEkuaxZ7iuoFDQEUOP+4iIebfqckDeC56BvgeFT0JycvkwINmozVqrCW3LP1g/ciBVn14aGQ0ArmP7lhYe24cPQ4utFKJT/dW4KhILOoZYp6bTmZbhlzAXlA3zk1Md6pzWo9s3k3xpA3rqK31hUwit6QmrgeYAnBHjLGp/9c1H5HZpbIBow+tUyQcWumhxkyNNLl8Gdl6e4SVby642WO/tUs9FiKSpkmiOWoLSekL/b3yvRPCyA8K5Tw5EYuirs0MA2/ODEiTK5gQ==</sign>
</alipay_trade_pay_response>
*/

 

-----------------------------------------------------------------------------------------------------

调用DLL轻松实现微信扫码、刷卡支付,支付宝当面付
-----------------------------------------------------------------------------------------------------
服务端:
1.运行环境采用.net Framework4.5
2.DLL负责PB数据端传入数据的上传,接收微信、支付宝返回的数据给客户端,所有参数都在PB端开发

3运行环境采用.net Framework4.5

4.易于集成到项目中,快速实现微信、支付宝支付的接入。

QQ:103556710

 

------------------------------------------------------------------------------------------------------

已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页