Vous êtes sur la page 1sur 22

Bank Pasargad Multi Payment

Technical Specification
1.2
1392

#&

0 #1

# "#% "#$
0(#1

# "

. #/ #

!#: 9 #1 # 8

# ) #&

)+ -

!) 6 1 . 7 )

+ ,

/ ' 6 5 4 01 3
.01 '

'

2 8@

G ' ( !)
9.

! 01
HIJ
!

G !) NOF *
.
!) !V%

;
C

$A) ?
( ,;

6"

) (

2
J P1

HIJ
! F

DE F ;

TM)

+A

($.
Q

'

. '6
9 K@

=$< ;

1 7 B1 )

5 4

HIJ
!% 0

G !) 8@

!:

<W

( , ;3

P1 ! 01
X

9 K@ B L 8 M !) . ( "

..

! '

? :

6 1. 7 ) 0

' ( )

:
?

0 1

- Y 2 !) + ,

1' @ ) ! 01
. (

Z[

'

2 !) 7 ) P1
.

Z[

'

! 01

' \ 1 8@ '

2 !) 7 ) P1 ! 01

G
.

'A

2 E $&

)'

+ & *$G

' \ 1 8@

+ & *$G

$O :(Private Key)

T ; $O 8@ ) 7 ) !)

$ 0R% 7 ) ! 01

3(M + & 0R% '


G!

2 ! 01

0R% 7 ) !)

$%&

E1

'

9.

' ( _ 2

% ;X

'

'
(
)

2!

% '

) 0

2' (

' ]1 :

+`M ;'

'A

R @ ^$
.(

2
!

' \ 1 8@

I !) 8@ 0 2
'

H$[I

+&

2C
! A) ;

) 8 ) !J$(
2

Mb ( !

:(Invoice Date) % # -

2' (

) NOF * ). (

:(Invoice Number) % #

01
)

NOF :(Invoice Amount) % # )"

.
)

"#

(
7) )

. " NE F a(% ) ) )
'

' \ 1 8@

6 1 . 7 ) ^V

"#

$O :( Public Key)

. (
02

.
!

5 4

:(TerminalID) !

2 ! 01

B $&

0 1

:(MerchantID)

.
' \ 1 8@ 0

! 01

c !) + -)

01 )

!1

!) 8@ 0 2 !

;'

M
(,

7 ) 0 1 !) '

Timestamp

6 .

B1

) 8@ f/ 0(1

!) ' ) "YYYY/MM/DD HH:MM:SS"

`$ C

\e 7 8

, )

) (, 7 !$ d !W$, ;0M 1 ;
.

:
*.

.
BW

[IJ

G !)

!\Eg * /

1 7

."

!) 8@ 0 2 ! .

) (, 7

'

..

B1 7 )

) '

P1 8@

0( , !

$E
0

." !% "

'

0
) !

."
"

'

HIJ

' %

`$ C

%j

0 2 )

, 8@
!) !

!
)

X e !)

!iW

: !%
V

2 B 1 + A ;' A
.

. $A$

\e 7

G ' ( : Account o

6 1 . 7 ) j $1

E 1 ' ]1 ' ( " + D$. ) 7 ) ' 6 !)

" 01 F V

: Date o

) 8@ f/ 0(1

0R%

G' (

B 1 NOF

B1

.(219.10.44039.1 B L 8 M !)).
FV

$.

." + & C

6 .

(,

)' (

h !) + - .

) invoiceAmount 8 M 0

!) ' ) "YYYY/MM/DD "3


, )

$) 32

. " NOF :Amount o

." NE F Q (& ! 01
.

$E

' ( : SubPayID o

(int)

) '

. " 7 : SubPayment

! 01 0

subpaymentList

B1 7 )

!) ! 2 Z [

HIJ C

:Timestamp

B1 8

!%

." !) k ) X $< : Description o


0

. " 0 $E xml 7 :SubPaymentList


.

3 F base64String

<?xml version="1.0" encoding="utf-8"?>


< SubPaymentList>
<SubPayments>
<SubPayment>
<SubPayID>1</SubPayID>
<Amount>5000000</Amount>
<Date>2010/02/02</Date>
<Account>219.10.44039.1</Account>
<Description></Description>
</SubPayment>
<SubPayment>
<SubPayID>2</SubPayID>
<Amount>30000</Amount>
<Date> 2010/04/08 </Date>
<Account>201.800.981313.1</Account>
<Description></Description>
</SubPayment>
.
.
.
</SubPayments>
</SubPaymentList>

invoiceUpdateList

0 2 )

!) !

X e !) '

!)

." 0 $E

xml 7

3 F base64String
<?xml version="1.0" encoding="utf-8"?>
<invoiceUpdateList>
<invoiceAction invoiceUID="634253256472082172">
<action type="Add" subPayID="4" amount="1" date="2010/02/02"
account="219.10.44039.1"/>
<action type="Delete" subPayID="5" amount="2" date="2010/02/02"
account="219.10.44039.1"/>
<action type="Edit" subPayID="1" amount="1" date="2010/02/02"
account="219.10.44039.1"/>
<action type="Add" subPayID="2" amount="1" date="2010/02/02"
account="219.10.44039.1"/>
</invoiceAction>
</invoiceUpdateList>

+& 0
+ & 3$E

." 7
!)

) Edit
' $1

Delete X $O(M

2 8@ + & 8

7
V

8
) B V2 0E G

! 01
0

h !) + -

. " 8@ !

+& 8

2
.

)'

(0
0

,)

." 7 8

. NOF

J$)

OF, 0E G 8 (

!2 < ) Add X $O(M *$ l( .


1

!)

."

9. 0
' J +&

)' J

." NE F Q (&
1

!) X e

1 0 " ' ./
.
! 7 ) !) 5OV 01
&@

0
'

6 1.7 )

20 1

7 ) 9]1

j $1 *

.01 '

!2 6 ?

1004

9. 7 ) 0 1 ! 01

8 ) "$ @ 0$W2

'

? : ./
3

9.

"

X [IJ

'

20 R

8@

8 J :(Action) 5 #

) 1003

).

4%/
0J6 )

' ( :(TransactionReferenceID) 8 67

2 8@ !O$1 ) !

B1 '

' 6@ 8@ !&$

E X $O(M Q '
0J6 )

7)

(
. 1

"$ @0$W2

1 :(Internet Payment Gateway) ./


& @ !) ;'

+&

2 0 1 !)

8 )

. ) Q`4
8 ) 52 X e

;7 ) P1 '

G !)

'% "
"

:: 9; %9
9.

5#
NOF 0

.' @ ; $

'

20 1

= >/ <;

!) !V%

.
!) POST

) '

PrivateKey )

2
20 1 .

!) k ) X M`4 '

B 1 (https://epayment.bankpasargad.com/gateway.aspx) 7 ) 0 1

3$E !) .

7 ) 0 1 !) "$
B1 7 )0 1

'

B1

' (

!) POST X e !)

!)

)!

(redirect)' 1 2
:

FM

InvoiceNumber

InvoiceDate

TerminalCode

MerchantCode

RedirectAddress

Amount

TimeStamp

Action

(base64 0 2 )) SubPaymentList
E $&
: 01 X FM B $&
:

X [) '

$E 3G

B[ .

'

#merchantCode#terminalCode#invoiceNumber#invoiceDate#amount#
redirectAddress#action#timeStamp#SubPaymentList#

.- ) !
)

) SHA1

7 8@ !&$ ! ;PrivateKey !O$1 !) +

1j
)

3e G

j
!

T
.

% .

AE

B $&

T !

* ! ;base64String 0 2 )

!)

.
C

(CVV2) +

&1 FM

;(PIN2)

B1 7 )

; 6 1. 7 ) "
G
!

2 !%
)

'

FM !(O ;(PAN) X
+ & 01

'
!%

6Y

V . $6

) 'A

' ( 8

'A

'

c.

Oe

+& X

, RedirectAddress O$2
.

W 8@ Query String

8 .

'

; E1
6

+&
(

e7 )

E X $O(M

1 @ !)

'

G !)

HIJ

TW

!OG

.
'

. 7 ) P1

X e 7 ) P1 !OG *

"

c.

(Expiration Date) X

0 eX e

" 0 $E o 1 ) NOF * .
G !)

)'

+ - X $O(M '

3 F .

"

R
'

.
*$$V
.

9. 7 ) 0 1

redirect)

12

'

(iN O$2 ) InvoiceNumber


(iD O$2 ) InvoiceDate
(tref O$2 ) InvoiceUID 8 (
p '

2 7 ) *$) ($2 ' WV

TransactionReferenceID

8@ X $:"% ! 7 ) P1

G!

3(M + & .
.01 '

3?2
1 B1

8 .

'

."

8@

0
)'

."

L G
'

0J6 )

0 1

PW2

0J6 )

) TimeStamp E

3 8

! 01
)!

B1

( Oe

FM

'
+&

e
* 0

0J6 ) 3) , 01 ' J + &


2C

* ) .

2' (
j $1

InvoiceNumber

InvoiceDate

TerminalCode

MerchantCode

Amount

TimeStamp

E $&

$E 3G

X [) '

'

B[

.1

#merchantCode#terminalCode#invoiceNumber#invoiceDate#amount#
timeStamp#

.- ) !

) SHA1 1j j AE
% .2
) 3e G !
T .3
) ! 7 8@ !&$ ! ;PrivateKey !O$1 !) +
. )
B $&
T ! * ! ;base64String 0 2 ) ! !)
) ! 3 F .4
.
'

6Y

' 1 2 (https://epayment.bankpasargad.com/doRefund.aspx)7 )

: 01 X FM B $&

xml

B V2 $q !4 )

)
?

2!

h !) + - .

!% .

!) post X e !) !
:

0J6 ) !) 3

G !) B . 0E G *

7 r$ !

2;
)

. 7 ) P1

8 0J6 )

0J6 ) 01

;7 ) 0 1 !) s 2
.

)'

B1 '

c.
B1
2

9.
)

<?xml version="1.0" encoding="utf-8"?>


<actionResult>
<result>{true|false}</result>
<resultMessage>{56 789: ;<=>?@ 8A B8<CDE|8FG 78H<I}</resultMessage>
</actionResult>

5#
0 1 !) ;POST X [) 7 ) ^ %

02

TransactionReferenceID B 1

!) 52

3$E

!) '

2 0 1 6 ! 01

MerchantCode ;InvoiceDate ;InvoiceNumber8

! \e 7 ) 0 1 .

F )

@%# -

@5 #

!&$

)'

20 1

(https://epayment.bankpasargad.com/CheckTransactionResult.aspx) 7 )

!&$
02

'

> /3

@%#

Oe

2C

!&$ 0

!&$

' (
)

'

'
9. '

) XML

J TransactionReferenceID

2.

B1 '

XML

h !) + - .

t e !)

F )

h 0 1 !) POST X e !) TerminalCode

4%/ 5$Fi

c. ! 01

TransactionReferenceID 02

12 )

h !) + -.

+&

3e G 8 $(4
.

TW + , '
8 ) 52
WO "$ @ 0$W2

'

7/
7)

<?xml version=\"1.0\" encoding=\"utf-8\"?>


<resultObj>
<result>{true|false}</result>
<action>{1003|1004}</action>
<invoiceNumber>{NO8P O?QR8>}</invoiceNumber>
<invoiceDate>{STO8U O?QR8>}</invoiceDate>
<transactionReferenceID>{NO8P VWR:XU}</transactionReferenceID>
<traceNumber>{NO8P YX<Z<I}</traceNumber>
<referenceNumber>{NO8P [8\O:}</referenceNumber>
<transactionDate>{STO8U VWR:XU}</transactionDate>
<terminalCode>{^8W<@XU NO8P}</terminalCode>
<merchantCode>{N8Z6`X> NO8P}</merchantCode>
<amount>{aCb@}</amount>
</resultObj>

10

3
:
.01 ! 2 A X e 0
) 5) i ;

2 NOF

% 0 $E ^$

. O$E

!)

'
7)

0 1

B1

.
!)

B1

'

!))

%0

HIJ
)7 )

X M`4 '
'

%B/

0E G
.

1 !
'

'
EG

2 X e *

1 !

1 *

OF, 0 $E * "6 %

B1 0
.

2
.1

." 0 $E ( OF,
'

20 10

."

C
)'

)0

& B1

1
.'

POST

B1 7 )

('

. 0$W2

1 !) k )

E1

2 8(

X e0

) .01 '
0

!)

;' ( )

* ).
. $6

!)

EG
0

.2

."
)

PrivateKey

(https://epayment.bankpasargad.com/UpdateInvoiceSubpayment.aspx)
:

B 1 POST X e !) 0 1

FM

!) !

TerminalCode
MerchantCode
InvoiceUpdateList
TimeStamp
Digital Signature

: 01 X FM B $&
:

X [) '

T
h

$E 3G

'

B[

.1

#merchantCode#terminalCode# invoiceUpdateList#timeStamp#

.- ) !

)
B $&

) SHA1
)
7 8@ !&$ ! ;PrivateKey !O$1 !) +
T !

* ! ;base64String 0 2 )
.

B1 '

xml '

0
6Y
11

1j j AE
% .2
3e G !
T .3
. )
!)
) !
3 F .4

1 7
. 7 ) P1

!)
1

)'
!) 01

c.
!OG *

<?xml version="1.0" encoding="utf-8"?>


<actionResult>
<result>{true|false}</result>
<resultMessage>{56 789: ;<=>?@ 8A B8<CDE|8FG 78H<I}</resultMessage>
</actionResult>

73
X [) '

C -

Private Key )

8 73

. " +`V 1 !) k )

C =E

X M`4 '

20 1

(https://epayment.bankpasargad.com/GetSubPaymentsResult.aspx) 7 ) 0 1 !) ;POST
:

FM

B 1 POST X e !) 0 1

(0 ". " 02
(0 ". " 02

0R%
0R%

!) !

B1

terminalCode
merchantCode
' )
) ) startDate

' )

R ) endDate

timeStamp
digital Signature

'

2
' )

xml '
8@ + & C

6Y

. 7 ) P1

! ;01

." 0E G *

. " +`V 1 01
@3

!OG

xml * .
.

12

*
B1

E1

<?xml version=\"1.0\" encoding=\"utf-8\"?>


<resultObj>
<result>{true|false}</result>
<resultMessage>{56 789: ;<=>?@ 8A B8<CDE|8FG 78H<I}</resultMessage>
<subPayments>
<subPayment>
<invoiceUID>{YX<ZcO NO8P}</invoiceUID>
<subPayID>{;G:dXI eTO NO8P}</subPayID>
<date>{;G:dXI eTO STO8U}</date>
<amount>{;G:dXI eTO aCb@ }</amount>
<account>{f8gh NO8P}</account>
<description>{iX6}</description>
<status>{Inactive| Active | Done| Canceled}</ status >
</subPayment>
<subPayment>
<invoiceUID>{YX<ZcO NO8P}</invoiceUID>
<subPayID>{;G:dXI eTO NO8P}</subPayID>
<date>{;G:dXI eTO STO8U}</date>
<amount>{;G:dXI eTO aCb@ }</amount>
<account>{f8gh NO8P}</account>
<description>{iX6}</description>
<status>{Inactive| Active | Done| Canceled}</ status >
</subPayment>
</subPayments>
.
.
.
</resultObj>

:
0E G

."

.
.

' J 0

B V2 ?

B V2 ' A

01 ' @ ?
. ?

01 ' J 0
0

2 P1

."
C

."

2 ! 01 V * !) :Inactive
2 NOF 0

9.
0
O$E

."

!)

.u

!) .01 B V2 $q

!OG

:!%

2 ! 01 V * !) :Active

. E1
;
.

13

$ status O$2

0E G 3

. E1
."

01 '

+& '
Y` 8@ 0

HIJ C
.

&

8 F
!

2 B L 8 M !))
A

O$E

Y` 8@ + &

!)

) B V2 0E G

; J + & 0$W2

." !
)('A

.
.01 '
.01 '
;

$ X e

. 0$W2

DE ' A

2 P1 0

' \1

!OG

DE "$ 8@

14

:!%
G

DE 8@ ' A

2!

. " ! 01 V * ) :Done

)0

. " ! 01 V * ) :Canceled
'A
0

."

2!
'

: !%

0J6 )

8 78
' \1

Protocol SSL

0 1
^$

7 ) 0 1 ;7 ) 0 1

*$) X M`4

* )

* 8

7 !)

(...
)

"

X [)

F%

+ r$
'
7 )0 1

!E F

0?2

7 !) $

' \1

SSL

SSL

'

X M`4 8 $(4 )

SSL B

[ 7

. "$ '

,)

2 3$E *$( !) .

aOi (... X

P1 X M`4 *

15

'

).

j 2

B1 !

8
i) 0 1

R J$. *$ l(

$
" !(O ;X
(

M`4 .01
!E F X M`4

)!

20 1!

2 ! 01 *

..

B [ 7 P1 !

, ) 0R%

SSL (Secure Socket Layer)3

a(1 s 1

F '

b2 e

2 0 1 *$) ($2 * k F
1 7

' (

SSL Certificate

E X M`4
X M`4 Q r$

SSL

FM X

.0 $

B1 '

A"

'

A / :1 3 %

A
X [IJ

( 02

()
)

C# H A A /

5#

% 8 7 # /% / :2 3 %
7

# /% /

<script language="C#" runat="server">


private setSendingData() {
merchantCode = 115; // N5nXToI 5R
terminalCode = 12; // ^8W<@XU 5R
amount = 2000000; // O?QR8> aCb@
redirectAddress = http://merchantsite.com/redirectAddress.aspx;
//d?6 Nd8QsX> tu vA 5T8A VWR:XU 789: w: xI Yyz@ vR {QT8s |Odu
timeStamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
invoiceNumber = 1949945; // O?QR8> NO8P
invoiceDate = 1387/10/12 12:45:32; // O?QR8> STO8U
action = "1003";
string subPaymentsXml = "<?xml version="1.0" encoding="utf-8"?>
< SubPaymentList><SubPayments><SubPayment><SubPayID>1</SubPayID>
<Amount>5000000</Amount><Date>2010/02/02</Date><Account>219.10.44039.1</A
ccount><Description></Description></SubPayment><SubPayment><SubPayID>2</S
ubPayID><Amount>30000</Amount><Date> 2010/04/08
</Date><Account>201.800.981313.1</Account><Description></Description></Su
bPayment></SubPayments></< SubPaymentList>";
String subPaymentList =
Convert.ToBase64String(Encoding.UTF8.GetBytes(subPaymentsXml));
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
//N5W6`X> ?G 5<C
rsa.FromXmlString(<RSAKeyValue><Modulus>oQRshGhLf2Fh...);
string data = "#" + merchantCode + "#" + terminalCode + "#" +
invoiceNumber + "#" + invoiceDate + "#" + amount + "#" + redirectAddress
+ "#" + action + "#" + timeStamp + "#"+ subPaymentList + "#";
byte[] signMain = rsa.SignData(Encoding.UTF8.GetBytes(data), new
SHA1CryptoServiceProvider());
sign = Convert.ToBase64String(signMain);
}
</script>

#'

# ' \ #1 0 . j $1 !) ' B 1
;B 1 $O 8 )
J
,

$6
, ' c. 0 1 !
JI)
X M`4 8@ ' c. ! 01 ) ! \e a,
.
' 1 20 .0 1 )

<form id="Form2" method="post"


Action="https://epayment.bankpasargad.com/gateway.aspx">
<input type="hidden" name="invoiceNumber" value="<%= invoiceNumber %>" />
<input type="hidden" name="invoiceDate" value="<%= invoiceDate %>" />
<input type="hidden" name="amount" value="<%= amount %>" />
<input type="hidden" name="terminalCode" value="<%= terminalCode %>" />
<input type="hidden" name="merchantCode" value="<%= merchantCode %>" />
<input type="hidden" name="redirectAddress" value="<%= redirectAddress %>" />
<input type="hidden" name="timeStamp" value="<%= timeStamp %>" />
<input type="hidden" name="action" value="<%= action %>" />
<input type="hidden" name="sign" value="<%= sign %>" />
<input type="hidden" name="subPaymentList" value="<%= subPaymentList %>" />
<input type="submit" name="submit" value="^8sO:" />
</form>

16

5#

> /3

# /% /

<script language="C#" runat="server">


private ReadPaymentResult() {
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("https://epayment.bankpasargad.c
om/CheckTransactionResult.aspx");
string text = "invoiceUID=" + Request.QueryString["tref"];
byte[] textArray = Encoding.UTF8.GetBytes(text);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = textArray.Length;
request.GetRequestStream().Write(textArray, 0, textArray.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string result = reader.ReadToEnd();
//568b<@ XML BO? vA VW:XU v<Qn @86 Result vChX@ T: Od
}
</script>

3?2

# /% /

<script language="C#" runat="server">


private DoRefund() {
merchantCode = 115; // N5nXToI 5R
terminalCode = 12; // ^8W<@XU 5R
amount = 2000000; // O?QR8> aCb@
invoiceNumber = 1949945; // O?QR8> NO8P
invoiceDate = 1387/10/12 12:45:32; // O?QR8> STO8U
action = "1004"; // 1004: 5TXG ;zXA ;s:?GOd :XA
timeStamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.FromXmlString(<RSAKeyValue><Modulus>oQRshGhLf2Fh...);
string data = "#" + merchantCode + "#" + terminalCode + "#" +
invoiceNumber + "#" + invoiceDate + "#" + amount + "#" + action+ "#" +
timeStamp + "#";
byte[] signMain = rsa.SignData(Encoding.UTF8.GetBytes(data), new
SHA1CryptoServiceProvider());
sign = Convert.ToBase64String(signMain);
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("https://epayment.bankpasargad.c
om/DoRefund.aspx");
string text = " InvoiceNumber =" + invoiceNumber +"& InvoiceDate=" +
invoiceDate +"&MerchantCode=" + merchantCode +"&TerminalCode=" +
terminalCode +"& Amount=" + amount +"& action=" + action
+"&TimeStamp=" + timeStamp + "&Sign=" + sign;
byte[] textArray = Encoding.UTF8.GetBytes(text);
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = textArray.Length;
request.GetRequestStream().Write(textArray, 0, textArray.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string result = reader.ReadToEnd();
//568b<@ XML BO? vA 5TXG ;zXA v<Qn @86 Result vChX@ T: Od
}
</script>

17

# /% /

<script language="C#" runat="server">


private UpdateInvoiceSubPayment() {
merchantCode = 115; // N5nXToI 5R
terminalCode = 12; // ^8W<@XU 5R
timeStamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");

string updateXml = "";


updateXml += "<?xml version='1.0' encoding='utf-8'?>";
updateXml += "<invoiceUpdateList>";
updateXml += "<invoiceAction invoiceUID=\"634253256472082172\">";
updateXml += "<action type=\"Add\" subPayID=\"1\" amount=\"1\"
date=\"2010/12/13\" account=\"219.10.44039.1\"/>";
updateXml += "<action type=\"Delete\" subPayID=\"2\" amount=\"1\"
date=\"2010/12/13\" account=\"219.10.44039.1\"/>";
updateXml += "<action type=\"Edit\" subPayID=\"3\" amount=\"1\"
date=\"2010/12/13\" account=\"219.10.44039.1\"/>";
updateXml += "</invoiceAction>";
updateXml += "</invoiceUpdateList >";
string inoviceUpdateList =
Convert.ToBase64String(Encoding.UTF8.GetBytes(updateXml));
string data = "#+ merchantCode + #+ terminalCode + #" +
inoviceUpdateList + "#" + timeStamp + "#";
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.FromXmlString("<RSAKeyValue><Modulus>");
byte[] signMain = rsa.SignData(Encoding.UTF8.GetBytes(data), new
SHA1CryptoServiceProvider());
string sign = Convert.ToBase64String(signMain);
HttpWebRequest request
=(HttpWebRequest)WebRequest.Create("https://epayment.bankpasargad
.com/UpdateInvoiceSubpayment.aspx");

string text = "inoviceUpdateList=" + inoviceUpdateList


+"&timeStamp=" + timeStamp +"&MerchantCode=" + merchantCode
+"&TerminalCode=" + terminalCode + "&Sign=" + sign;

byte[] textArray = Encoding.UTF8.GetBytes(text);


request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = textArray.Length;
request.GetRequestStream().Write(textArray, 0, textArray.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string result = reader.ReadToEnd();
//568b<@ XML BO? vA ;G:dXIO?Qsd n8sOw`O vA v<Qn @86 Result vChX@ T: Od
}
</script>

18

73

C -

8 73

C =E

# /% /

<script language="C#" runat="server">


private GetSubPaymentResult() {
merchantCode = 115; // N5nXToI 5R
terminalCode = 12; // ^8W<@XU 5R
fromDate = "1392/01/01";
toDate = "1392/01/03";
timeStamp = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss");
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.FromXmlString("<RSAKeyValue><Modulus>");
string data = "#"+merchantCode +"#"+terminalCode +"#"+ fromDate +"#"+ toDate +
"#" + timeStamp +"#";
byte[] signMain = rsa.SignData(Encoding.UTF8.GetBytes(data), new
SHA1CryptoServiceProvider());
string sign = Convert.ToBase64String(signMain);
string text = "MerchantCode=" + merchantCode + "&TerminalCode=" + terminalCode
+"&startDate=" + fromDate + "&endDate=" + toDate +"&TimeStamp=" + timeStamp +
"&sign="+ sign;
byte[] textArray = Encoding.UTF8.GetBytes(text);
HttpWebRequest request =
(HttpWebRequest)WebRequest.Create("https://epayment.bankpasargad.com/
GetSubPaymentsResult.aspx");
request.Method = "POST";
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = textArray.Length;
request.GetRequestStream().Write(textArray, 0, textArray.Length);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream());
string xml = reader.ReadToEnd();
STO8U |8s: XA {8sO: Y8c ;G:dXIeTO 7Qs: v<Qn
@86 Result vChX@ T: Od
//568b<@ XML BO? vA 8c ;G:dXIeTO
}
</script>

19

/ 8 6/ C J %61 :3 3 %

H
)

vO I

V$1 '

$O

$O

$O

!
j

A "

AE * .

AE

M 8 W

' \1

J6 " 0R%

(Public Key)

(M $O

AE *

A "

AE jR

R@ ' \ 1 8 W

$O

c6 "

AE

A " 0R%
.

!)

(Private Key) e [

.
.

B $&

$E

: ! > 8 K =%LM
8 $(4 8
8

8 7( !) !
j

AE *

8 W

! ( .01 '

A"

B1

AE )

[IJ HI ^ %

E1

'

.
j

AE

* ! (
01

V * !) j
@ 01 !)

8 W

AE *

j
!

I.)

'

*2

(M $O ^G e

'

( 8 M r$ !) X M`4 8

9. !

$E

!) ;X M`4

$O

6 .01 ^Oi *$(

68 $) "$ "

AE

1 j

' \1 ) ;

' \1

. ( T

1j

"#

a$< !( *$) ! 01 $O

20

1j

... MD5, SHA1 !) 8

AE 8@ (Private Key) e [

A r$
)

DSA RSA !)

* !) B $&

: $%&
8@ 8

3e G

'

) ;B $&
;j

'

7 !) (Hash Algorithms) !2 47

AE

$E

$. ! 01 3

8 ) !2 47 .

Oe X M`4 ;

A "
AE P1 '

B1

3 F (Hash) j

9. .

' \ 1 ) X M`4 ; '

B $&

% '

"# =% LM

JI)

(M" w\E a, !)

(M $O
%

AE jR !

" 3) , e [
$O *

B1

'

A "

$O ) PW2 PW2

3$E *$( !)

$O *

(M $O ) '

"

R@ 8

J6"

' \1 )
'

8 M r$ !)
e[

+&
$O

T ;+ D$. 3e *
!

$O *

0?2

) + D$. '

3V%

L G

) e[

,Y

$q

$6 0E G *

3e G 8 $(4 T 0 e
(

'

( 8 M r$ !)

21

8 W
J6

J6" !)
JI) a,

$O ^G e .
01

(M

e[

$O

J6 " 8

$O * !

Email ; Document

R D$.

(M $O '

! 01 ^Oi *

8@ !O$1 !) ! 01 $O

) ' `M . $6
T

*y(i
.

'

' \1 )*

!26X e

'

"

)(

(M $O 8 ( ) ' )
.

(M $O !O$1 !) '

"

' %
1 8

Email ;Document

, + D$.
(

(M $O )

(M $O

8@

B $&

.01 '

B1 ( ^ %

Vous aimerez peut-être aussi