Current location - Quotes Website - Signature design - How to do the B2C payment interface of PHP ICBC?
How to do the B2C payment interface of PHP ICBC?
MerID: provided by the bank. When a merchant opens an account with ICBC, ICBC will inform him of the code that uniquely identifies the merchant.

MerAcct: the account number provided by the bank is charged by the mall (specified at the time of transaction).

Programmers who know html code and PHP.

Methods/steps

Opening an account in a bank means you need to make a B2C online payment interface. At this time, the bank will provide you with merID and merAcct.

Programmers can follow the following steps and add the following controls to the page where the form is submitted in the mall.

& lthtml xmlns = et . com . cn/servlet/icbcinbsubebusinessservlet " & gt;

& lt! -

Orders can only be submitted by mail; If it is a simulated test environment, use "mybank.dccnet.com.cn".

-& gt;

& ltINPUT NAME = " interfaceName " TYPE = " text " value = " ICBC _ per bank _ B2C " >

& lt! -the interface name is fixed as "ICBC _ perbank _ B2C"->

& ltINPUT NAME = " interface version " TYPE = " text " value = " 1 . 0 . 0 . 0 " >

& lt! -the interface version is currently "1.0.0"->

& ltINPUT NAME = " orderid " TYPE = " text " value = " 00000000 1 " >

& lt! -The order number is generated by the merchant and cannot be repeated within one day. -& gt;

& ltINPUT NAME = " amount " TYPE = " text " value = " 100 " >

& lt! -The amount is divided into units->

& ltINPUT NAME = " curType " TYPE = " text " value = " 00 1 " >

& lt! -at present, the currency only supports RMB, and the code is "001"->

& ltINPUT NAME = " merID " TYPE = " text " value = " XXXXXXXXXX " >

& lt! -The bank provides (max20), a code that uniquely identifies a merchant, and ICBC notifies the merchant when opening an account. -& gt;

& ltINPUT NAME = " merAcct " TYPE = " text " value = " XXXXXXXXXX " >。

& lt! -The bank shall provide (max 19) and the account number for mall charges (which can only be specified when trading). -& gt;

& ltINPUT NAME = " verifyJoinFlag " TYPE = " text " value = " 0 " & gt;

& lt! -"1"determines whether the customer and the merchant are United; The value of "0" does not check whether the customer is a joint name with the merchant. -& gt;

& ltINPUT NAME = " notify TYPE " TYPE = " text " value = " HS " & gt。

& lt! -the way that HS sends notifications in real time; AG mode does not send notification; -& gt;

& ltINPUT NAME = " merURL " TYPE = " text " value = "/servlet " & gt;

& lt! -receiving bank notification address, currently only supporting http protocol port 80->;

& ltINPUT NAME = " result TYPE " TYPE = " text " value = " 0 " >

& lt! -For HS mode "0": send success or failure information; "1", only the transaction success information is sent. -& gt;

& ltINPUT NAME = " orderDate " TYPE = " text " value = " 2005080 1 192556 " >。

& lt! -14-> timestamp->;

& ltINPUT NAME = " merSignMsg " TYPE = " text " value = " sfvds 3 kca 6d/wetlfwynbl 1 q 5 ndiyxxeuxczniia 47 MH xs 1 bm9 mpsnr C2 loqqqrfwbdwbjse 82 js/ibhykolf 2 sppjeyoimvzycv 9632 1 qpd GPA 1 yleo 83k 1xa 1 RMB 3 zxsiu

& lt! -BASE64 coding of merchant signature data->;

& lt! -Sign the data string and test the private key user.key (fixed order; The string signed by the merchant is the value of each entry):

Value of interface name+value of interface version number+value of mall code+value of mall account number+value of notification address+value of result sending type+value of order number+value of order amount+value of payment currency+value of notification type+value of transaction date and time+value of verification joint mark->;

& ltINPUT NAME = " merCert " TYPE = " text " value = " MIICVjCCAb+gawibagiki 9 fkedp 6 aaao 3 danbgkqhkig 9 w0 baqufada 0 rgwfgydvqqdew 9 wymouawniyy 5 JB 20 uy 24 xgdawbgnvbaotd 3 bia i5 py 2 jjlmnvbs 5 jbjaefw 0 ymda 5 mjawooti3n dfafw 0 ymta 5 jawoti3n dfamemxgdawbgnvbamtd 2 jpyw5 sdtiylmuumdiwmdenmasga 6544

& lt! -BASE64 encoding of merchant certificate public key->

& lt! -the test certificate used here is user.crt->;

& ltINPUT NAME = " goodsID " TYPE = " text " value = " ABCD 00 1 " >

& lt! -Product number, obtained from the mall->

& ltinput name = " goods name " type = " text " value = " felt hat " >

& lt! -Product name, obtained from the mall->

& ltINPUT NAME = " goodsNum " TYPE = " text " value = " 1 " >

& lt! -Quantity of goods obtained from the shopping mall->

& ltINPUT NAME = " carriage AMT " TYPE = " text " value = " 100 " >

& lt! -Including the freight amount, which is divided into units and obtained from the mall->

& lt input name = "merhint" type = "text" value = "jump off a building to sell!" size="60 " >

& lt! -The mall prompts that the above five fields are used to display the customer payment page->

& ltINPUT NAME = " remark 1 " TYPE = " text " value = " " & gt;

& lt! -maximum value of comment field (100)- >

& ltINPUT NAME = " remark 2 " TYPE = " text " value = " " & gt;

& lt! -maximum value of comment field (100)- >

& lt enter type = "submit" value = "submit purchase order" >

& lt/form & gt;

& ltbody & gt

end

Matters needing attention

Please note that merchants cannot submit order data to undefined fields in the interface.

The submit button cannot set the name property. If set, the value of the submit button will be submitted as a variable, which may cause data checking errors.

The experience is for reference only, if you need to solve the problem.