dragonpay pg api · 1. about this document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8...

18
!

Upload: others

Post on 15-Mar-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

��

������������� ���� ����

��������������������������� ������� � � � � � � � � � � � �

� ������������������ �! �������

Page 2: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ��

Table of Contents �

"�!� ��#�$��� ��� ���������������������������������������������������������������������������������������������� ����!�����%�������� ��������������������������������������������������������������������������������������& ������ �' '���'� �� ����������������������������������������������������������������������������������������& &��$%��� �(���������������������������������������������������������������������������������������������������& )�������'�������������������������������������������������������������������������������������������������������) )���*%����������� �!��+�' !������ ��,�����������������������������������������������������������) )���-�.�'� ������� �!��+�' !������ ���.��+,�������������������������������������������������

������������������ ����� ���/�� .���������������������������������������������������������������0 ����1�� ��2 3��� � ��� ������������������������������������������������������������������������������0 ����4 ���� ���������5�1�67��/���'��/67�18 ���������������������������������������������������0 ��������� 6���� ������4�' ������������������������������������������������������������������������0 ��������2 3� �������� � ���������������������������������������������������������������������������9 ��������2 ����� ������ � ������������������������������������������������������������������������� ������1��:;4(�* !�1 � �� �4�' �������������������������������������������������������������� ��������2 3� �������� � ��������������������������������������������������������������������������� ��������2 ����� ������ � ������������������������������������������������������������������������)

��&�4����6� �� �1�������������������������������������������������������������������������������������� ��� �'�<�����$��� ���$�' � ���������������������������������������������������������������������������� ��� �'�<�����=�����$�' ����������������������������������������������������������������������������������> ��� �'�<�&���1������$�' ��������������������������������������������������������������������������������0 �

Page 3: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� &�

1. About this Document �

"%���'���� ���' ����! ���% ���������������������������� �#�� �5���8�! �. ��

��� ���1.���%�5�18���'��% ���������������� �?����� ���/�� .��5�/8���� ����

"% ��1����� ������!� �#�����������������.��%��% � 6���� �� �� ��%���?����� ��#���

��� ���� 3� ������������� ����� �������@���� ���'�������% �� 3� ��A����� '�� �����% �

�'6�� �����%���!��+��#��%��� ���"% ���#���������� ' '�!��% �!��+�������� ����%���

������������������������ '��������% �����' ����! '�����%���'���� ����

"%���'���� ������ �' ������ ����������'�����������% ���� �A������'��������� � ����

���%�� ���� ���'��������� �������% ���� �������' ��������%�.���������������� � ����% �

��� ���

�#����%� ����3� ��������� �� �'������% ����� ��������������������������

2. Intended Audience �

"% ���� �' '���'� �� �#����%���'���� ������� �%������� ����� ������������� ���.��%�

!��+�����'�+��.� '� ��#���������������'� 6���� �� ���"% � <���� ������%���

'���� ����� �.���� �����4������#��$B���="���-�. �A��% ��������� �����#� ����

���� � ����% ���� �#�� ����������% ��������������������� ��������������% �

���#�������* !�����'��'�����%����-""��/="A���� 6���� �����A���'�1��:;4(�* !�

1 � �� ���������

3. Change Log �

� ������ ��� � $%��� ��

����� �� ��>A����9� ���%��� ������

����� C�����A������ $%��� '�� ��������D���� ���/�� .��5�/8����

��� ���1.���%�5�18���'���������������� ��5��8�����/�

� � $%��� '� �����������������'� ���%��5)8�

� � �'' '��=����/��������

����� 4����A����� 2 �� '�����������#����/ �"<�"�+ ��

���&� C����0A������ 4�' � �������� 3��� '������ � ��

���)� ����9A������ $%��� '�@2(?���������'���������%�

� � $%��� '�!��� ��'���� ���%��50�8�

� � �'' '�#��� E��� ��������������� � ��

����� �� ���A������ �'' '�����������* !�1 � �� �� �%�'��

� � 2 �� '�������#��������"<�2 �����

Page 4: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� )�

4. Introduction �

=6���� �� ��������������� ���'���� ���� ����� �!��% �� � ������!���� ��%�'����

����#������� �����A�%�. �A����%��� � '�!��% ����+��#�� ����!� ������ ���� ���

����������*%�� ��� '������'�� ���������! ��% ������������������� ���� ���������A�

����������� ����%��.��#�������#���# ����#�� �������% ������'���#���������

��������� '������� �� ��%������� ������ ��.����#��� '������'��! ���� ��#�%��%�

#���'���� �����'�#����%�� �� ������%��%6���+ ���� ��A��% �� �� ���� 6!�� '�# �

�������� ��#��� '������'������������ ������������% ���� A�������������� �� ���� ��#�

�% ������������%������ �������� '������'��! ���� ��#��� '���%������� 3��� � �����

���� �!��+�' !������ ����� � ������ �� ## ��� ���� ����� �����%���'�� ������

� �������!��+������������� ������������ ���%����� ��������� '������'�����������"%���

�� � ���������� ����� ������������ ��!�� ��������� �� ��%�������"% ������ �!��+����

��� �#�� �����������% � ������� �� ��� ��%����% ��������� '������'���� �#�� ���"%���

�� ���������� �����% ������� ���%����% ������������������# �����'�! ���� ��% � ����

������� ����#��%��� !��+��.��%�' !������ ���A�� ��%������� ����������� '��#�

��� ����#����% ������'��������� � �� ���

4.1 What is online bank debit payment? �

����������������� �!��+����� �����A�!��+������� �������� �#����!�����#������������%�

���!����� ���3���A�!�������� ��A��% �+!��+�� ��' �A���'�#��'�������# ��� ��� ��

#�����% ���%�� ������##�� ����"% �!��+?������� ���� �#�� ������������� �� '���������

. !�!��.� ��� ����� ��� ��%��� ��5%����8��

������������ ������

Balance Inquiry,Bills Payment,Etc.

��

Page 5: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ��

@�' ���%����� �����A��% �!��+?����� ������� ���%���������������������.��%����� �

� ����������� ����'������% �� 3� ����� ���!��% �!��+������� ��� ���% �!��.� ����

"% � �� 3� ������ ���' �!��� ���������%����%��% �. !���� �#�� ?��� ������ ��

��'�!�#������������6��� ��#������

���� �!��+������� ����� �������������' ���� '����.��+�.��%� 6���� �� �

� ��%������������� ����� ��.%��%�� 3��� ����%�� 6��6���%�� �����������������"% �

'������%� ��% �����!����������� ���� 3� ��������������������#����&�'������

. !��� ������������������5 <��1%��������������� ��8�#���' !�������% �!��+����������#�

������������������� ����1�!� 3� ���A������ �!��+������� ��������'������%� ��% �

����!������������������ �.��%���&�'��������� �������#��������#������ ���.���'�� �

���� ��#������������

F ���� ��#��% � ������������A����������� �����������!� �#�������� �� ��%��������!����

������ ����������% ���!��+����������������������� 'A������ 6#��.����� �����

4 ��%�������������� ���������##6��� �� �������%������+�����% ������� �����' ������

����% ���!��+���������� �6�% 6����� ����'�#�<��% ���% �' ������������������#��#�

��� �����"%�����+ ������������!� ����'�� 6���� �� �.%��%�� 3��� �� ��6��� �

� ����� ��5 <�������� ����+ ����A�'�������'�.����'�8�������� ��%�����.��%�%��%6 ���� �

������������A��% �������� ���'�������#�' �������������������������������!� �����������

�1�� +������''� ����% ����!� ��!���� �'������G.���� �H���� �#�� �����% ������ �

!��+������� ����"%���.������� �' �&�'����������� ����� ��������������.��%���

���������������� �#�� ����� 3� ���#������ ����#�����% ������� �?��!��+A���'�#���

�% �!��+������� �' �� ��6��� �# '!��+�������#����������#��% ���� ���.������� ��#���

������������'�������A��1����� ��!� ���� <������������ �!��+��������#���������� �' � 6

���� �� �#������������.��%�������.��%� ������� ��%��� �A��#�����

����������������

Real-timepaymentconfirmation

Onlineshopping

Webpaymentrequest

E-Bankinglogincredentials

E-Commerce Wrapper

��

Page 6: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ��

�1�.���������� �#�����% ���� ��#������##������������.�������� ��% ���� ���� 3� �������% �

���������� �!��+��%�� ��!��% ������� �������.������� ������ ����#�����% �

������ �����! %��#��#��% �� ��%���A���'����.����� ��� �.��%��% �� ��%����������

��% '�� '�!������

E-C

����� ����������������

Switch

Bank #1 Bank #2 Bank #3

Merchant #1 Merchant #2 Merchant #3

Request for bank payment

E-banking login credential

Shop

E-Commerce Wrapper E-Commerce Wrapper E-Commerce Wrapper

4.2 How does online bank debit payment work? �

��������� ��������������� � �����#����.��% ���� ����� ����

�� $����� �����#���������� ����� ��� $����� ������+������� ����%���% �.�����&� �� ��������� '������������ ��%������������)� $����� ���� ���������������� $����� ������� � �� '�.��%�� ������� ������������� $����� ������+������% ���� ����������% ��� # ���>� ��� ������� ���������� �#��� '�0� ���� ��%��������������� � '�

*% � ��% ��%������� <� �� �� �� � ����� ����������� ��B>�����## � ������ ���

��������%� �'�## � ������� ���#��.����$� '������'���� ������ ����������� �

������%�#��.��'������ �� ���������'�' �����I�����+���!������������#���I���'���?��

'�� ���4�����#��% ���� A��% ������� ��'� ������%� ����� � ��% ����� ?�����������

��� ��

*��%��������% ����� �����������5 <�������A�F���� �8A�%�. �A��% ������� �?��

!��.� �����#������ '�� �� '�����% �� ��� �. !��� ��#��% ���� ������� ������������

�% � A�% ������+ '���� �� ��%����� ' �������5 <�����������������'���'�����.��'A�

F���� ���"4����'����! ����'����8���*% ��������#������������ �� � '����� ������'�

Page 7: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� >�

�% �������������������#��� 'A��% ������� �?��!��.� ������ '�� �� '�!��+�����% ������ �

���� �5�� ��B08�.% � ��% ��%��������������� � '��

"% ��1����� ���#��.�#����.��� � ������� �������#��% ���% ����� ������������������

�% ������������� A��% ������� ������ '�� �� '�����1���'������ � �� '�.��%���������#�

!��+������%��� �#�����

��������������������

��

$����� �����+��%���!��+�#�����% ��������'�����+���% �!������������� '����1�.�����% ��

�����# ���% �� 3� �������% �!��+��������% �����' ����! '�����%���'���� ���������%���

���� A��% �!��+�.����� � ������ �#�����% �#����.������ �������D�

�� �������#����% �� � ������� ' �������5����� �!��+�����'���'�����.��'8��� ( ���% ������� ���%��� �#������������#�� ����!� �!��+����������5 <���% �+�����������A��� ������������8�

&� $��#����.��%������� ���#�% �.���������%��� ��% ���������������������%����%�� ����������������%������� A���� �!��+������ �#�����''��������

���% ����������5 <������������#���������������������.��'A�� ��� ����

���#��������� ���141���� ����A����'������! ��� � �����8�

*% ����� ������� �������������� � 'A������� ������ ���!��+�����% ��1��������% �

� ���������' ����! '�����%���'���� ����

�1�+ �������+��#�������� ���������������� 3� ������'��% ��������� ����������+������% �

!��+���� ������� ��6��� A����. �����A�.��%��% �� ��%�����%���������� ��������

� �#������% ���� ��#��% ����##���������'� ���� ������� ���� ���� ����� '�����% �

���������� �������

Page 8: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� 0�

5. Financial Partner Payment Gateway API �

"%���� �������#��% �'���� ���' ����! ���% �!��+������������������� ����� ���

/�� .��5�/8��������' ����A��� ������% � �������#����������� 'A����. �����A���' ��

�%�������! ��� '������� ���� ��% ���

5.1 System Requirements �����' �������� ���� �.��%��% ��1A��/������#��#�����% �#����.������ � 3����� �D�

�� �/���� �������� ���%����� 3� ���'����#�����1���� ��.% ���������� ��.��% ���������������� ����� �.��%�%���!��+����������

�� �/���� ������ ������������������ ��#���%���!��+�����������'�� �#�����% �� � �����' !������ ������#��'�������# ��

&� �/���� ������ �������� �' �� ��6��� ����#����������#���� ���)� �/���� ������ ������ '�� ���!� ��!��+�����1?������!��+�@2(����#��#������� ������� '�� ��

=��%��/���������� '��% �#����.���D�

• ������'������3� ���' ��' ���#�����% ��/�

• � �� ��+ ��������3� �����.��'������� '�����/�#����% �+���� ���'������ ������������ ����������

�https://api.dragonpay.ph/Postback.aspx

�������� ����������

�http://test.dragonpay.ph/Postback.aspx

���%���%��%���'���� ����� ��4������#����="���� ������A�����%���'�! ����� � ���!� �

��' ����% ���� ������� � ����� ����5 <��(���<A��-�A�� ��A�C� �8���5��� ��%������� �

�%������������%��'���� �������A��% �����!��+�@2(?������%��� �����% �#���� �8�

5.2 Message Passing (PS -> PG and PG->PS) "%���� ������' ����! ��%�.��% ��1�.������������ 3� �������% ��/���� ��#������ ���

���� ��������'� �� � ������"% � ��� ����� �����.����� ����������' ���� ����!� ���

�% ���� 6���� ������4�' ����'��% �* !�1 � �� ��4�' ���

5.2.1 Name-Value Pair Model �

@�' ���% ���� 6���� ������4�' �A��1�� �'���% �� 3� �������� � ���������-""��/="�

.��%���!��.� ��� '�� �����"% ��/���� ������� '������ �'���'����� ��% �/="�J� ��

1��������� <�����������% �� � �������#����������

Page 9: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� 9�

"% ��/���� �������% �+��% ����% ��������#��% �� 3� ���!��.��� ���D�

�� ��������% �+��% �@2(��������''� ����#��% �-""��2 # � ����'���+ ���� ����! ����������% ��1��

�� ��������� ������ �� ��+ ���������� �#����% �� ���� �'�� ���!�� '�����% ������ � ������� '���'������� �������������% ����� '�'�� ������#��% �

������ '�'�� ���'� ����������%A��% ������%���'�� K ����% �����������������% �

����� � ���%� ��������+ ��! ����������� '��

5.2.1.1 Request Parameters �These are the parameters passed by the PS to the PG via name-value pairs to request for a payment. ����� � �� �����"� � � ����������

� #��� ����%��5��8� ���������� # � �� ����! ���' ���#�����%���

�� ��#���������������

������� ��� ���5��A�8� "% ������������ ��#�����% � �'6�� ��5;;;;�;;8�

��� $%��5&8� "% ����� ����#��% ��������5� ���� �'�<��8�

' ���������� ����%��5��08� ��!�� #�' �����������#�.%����% ���� ������#���

!��� ��'� ����%��50�8� "% ���������' ������5������:��� :�� 8�������3� �

!��� ���'������ '���#����%���������������

����� ����%��5)�8� =������''� ����#������� ��

'�� ��� $%��5)�8� ���%����% �+����'�� ����#������% ������ � ���

������.��%��% �� �� ��+ ��

#��� � ����%��5��8� �#��%����������������� � ������ �������A�'��������

����������� ��! ���� ��% �� ��%��������������% �

�#��� �������� �! '��% ���� ������ �

���-""��/="�#�����1�������+���� �%������+ ��%��D�

�https://www.mybank.com.ph/Pay.aspx?refno=12345678&amount=1000.00&ccy=PHP&description=Box+of+Chocolates&digest=a4b3d08462......

"% �'�� ������������ '��������% �1-����������%����F ��.����������� ���' ��%�.����

%�.����� � ��� �1-���������$B���="D�

� public static string GetSHA1Digest(string message) { byte[] data = System.Text.Encoding.ASCII.GetBytes(message);

System.Security.Cryptography.SHA1 sha1 = new System.Security.Cryptography.SHA1CryptoServiceProvider();

byte[] result = sha1.ComputeHash(data); System.Text.StringBuilder sb = new System.Text.StringBuilder(); for(int i=0; i<result.Length; i++) sb.Append(result[i].ToString("X2")); return sb.ToString().ToLower(); }

Page 10: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ���

"�������� ��% ���� ������#��% �� ���� A�'���% �#����.������ ��D�

�� F���'��% �� ���� ��������!�� '�����% ������ � ����� / � ��� ��% �1-���'�� ���#����%���� ���� ��������&� $����� ��% �� � ��� '�'�� ���.��%��% �'�� ����%���.������� '���'�� ��#��% �����%�

"% �� ���� �����������!�����!�K���������� ������������% ������ � ���.��%��% �

������ '�� �� ��+ ���'��������% ���������!���#���' ����� ���

�string message = String.Format("{0}:{1}:{2}:{3}:{4}:{5}:{6}",

Request[“refno”].ToString(), Request[“amount”].ToString(), Request[“ccy”].ToString(), Request[“description”].ToString(), Request[“billerid”].ToString(), Request[“email”].ToString(), Application[“secretkey”].ToString());

"% �������� ����������% ����� '�'�� ��D�

� if (GetSHA1Digest(message) != Request[“digest”].ToString()) { // display some error message and abort processing } else { // 1. prompt for bank id and password // 2. prompt for bank account to use // 3. perform funds transfer to billerid account }

5.2.1.2 Response Parameters �

*% ����� ������� ������%�������� � 'A��% ��/��%���'�� '�� ���!��+��% �

������ �?��!��.� ������1���'�������������% ������ � ���! ��.��

����� � �� � ����������

� #��� ���������� # � �� ����! ���' ���#�����%����� ��#���������������

�����'� @��3� ���������� '�����%����/�

������� "% �� ������#��% ���� �����2 # �������� �'�<�&�#�����' ���

� ���� � �#���������1@$$=11A��%����%���'�! ��% ��/�������������

� # � �� ����! �����#������������(@2=A�� ������� ��#��% � �����

��' ��' ����! '������� �'�<������#����������=����/A��% �

� ���� �.���'�! ���� # � �� ����! ���������� � ��% �#��'�����

'�� ��� ���%����% �+����'�� ����#��% ������ � ���������.��%��% �� �� ��

+ ��

Page 11: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ���

���-""��/="�#�����/�������+���� �%������+ ��%��D� https://api.dragonpay.ph/Postback.aspx?refno=12345678&procid=PSB&status=S&message=72843747212&digest=a4b3d08462......

"% �'�� ������������ '��������% �1-����������%����F ��.����������� ���' ��%�.����

%�.����� � ��� ��% �1-���'�� ���������$B���="D�

�String digest = GetSHA1Digest(new String.Format("{0}:{1}:{2}:{3}:{4}",

refno, procid, status, message, Application[“secretkey”].ToString()));

String redirectString = String.Format("{0}?refno={1}&procid={2}&status={3}&message={4}&digest={5}", postbackUrl, refno, procid, status, Server.UrlEncode(message), digest); // send browser back to PS Response.Redirect(redirectString, true);

��� D����� ��% ���� ����������� � ��.��������������������.%�� ���� �������% ��

��!���A���+ ���� ����������% ����� ��@2(� ���'���:' ��'����! #�� ������������

����� � ���������������'�� �����

������ ��.% � ����% ����������������������=����/A��% ��/��������%��������

� �'����-""��/="�����% �#���� ���� ��% ���� ����������� � '���"% �#���������

������������% �����������������% �����!��+�@2(����' ����! '��!� ��

5.2.2 SOAP/XML Web Service Model �

������ �� ��� �����A��% ��/�����%��� �������� � ����% ������������% �;4(�* !�

1 � �� ����' ����@�' ���%�����' �A��% ������ � ����� ��������� '��%����%�!��.� ��

� '�� ����.%��%��� � ���!� ���� �'6�� ��������� �'A������ � ����� � <�%��� '�'�� ����

! �. ���% ��/���'��1�� � ����%����%�1����������

"���� ��%�����' �A��% �#��.�.����! ����#����.�D�

�� �1�� �'�����-""��/="������������/�������������� ������'������������ �/� ��#� ���% ������ �����#�� 3� �����'� ���'�� ���������&� �/�� �'����* !�1 � �� �� 3� �������1�.��%��% �� �%�'�������������������������� �������'��% � �������1�� ����'��.��%�������������! ��� '�#���

�% �� ������.��%��%����������������

)� �/�������� �%�'����������������������% ������� '����������� <�������% �' ���� '������ � ����

Page 12: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ���

�� �/�� �' ����% �. !��� ���'�� �#�������� ������� �������� *% ������ �������������� � 'A��/�������� �%�'��������������.��%��% ��� ������������ '���������

>� �/�� '�� ����!��.� ��!��+�����1�.��%����-""��/="����������% ����������

"% ��' ����� ���#��������%�����' ���� D�

�� ����� � ����� ����� ���!� �����% �!��.� ���� �/�� � ������% ��� �� ��� �����% ������ � ���'�� ����#�����1���"%��A������� ����!���&�'���������#�+ ���� 3� ���.����K����� ����������� �����.% ���/�

��� ��������#�������.��%��1��

&� �/�� � �����������% ��� ����������% �� ������'�� ����!��+�����1��

L�������� ��% �#����.����@2(?������% �* !�1 � �� � ������������5��� ��%������� �

�%������������%��'���� �������A��% ��������@2(?������%��� �����% �#���� �8�

�� � ��!�������������������

�https://api.dragonpay.ph/DragonPayWebService/PaymentGatewayService.asmx

�� � ��!���������������

�http://test.dragonpay.ph/DragonPayWebService/PaymentGatewayService.asmx

5.2.2.1 Request Parameters �

"% �#����.����������� '� ���-""��/="�'�������% �!��.� ��� '�� ���������� ����

����� � �� � ����������

� #��� ���������� # � �� ����! ���' ���#�����%����� ��#���������������

'�� ��� ��1-����% �+����'�� ����#��% �� #�������� � ��������.��%��% �

� �� ��+ ��

#��� � �#��%����������������� � ������ �������A�'������������������� ��

! ���� ��% �� ��%��������������% ��#��� �������� �! '��% �

��� ������ ����%��������. !��� �

���-""��/="�#�����1�������+���� �%������+ ��%��D�

�https://www.mybank.com.ph/Pay.aspx?refno=12345678&digest=a4b3d08462......

"% ��/�.������� ����% �� 3� �����'��% �+��% �'�� �����+ ���D��

�string message = String.Format("{0}:{1}",

Request["refno"].ToString(), ConfigurationManager.AppSettings["secretkey"].ToString());

�if (GetSHA1Digest(message) != Request["digest"].ToString()) { // display some error message and abort processing }

Page 13: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� �&�

"% ��!� � <���� ������ ���%����% ��� ����������� � �����' #�� '�����% ��1���="�

"� ���#������#����������#�� ���@�������#����������#� ���'����#�-""��/="�� 3� ��A�

�/��%���'�������% �#����.����* !�1 � �� ���� <������' ������#����% ��������������

�� �$������%���&������

����� � �� �����"� � � ����������

�����'� ����%��5)8� @��3� ���������� '�����%����/�

� #��� ����%��5��8� ���������� # � �� ����! ���' ���#�����%���

�� ��#���������������

'�� ��� ����%��5)�8� 1-���'�� ����#�� ����� ������ ������

"% �������������� �%�'�.����� ���������������������.%��%�.����! ��� '����� # �����

�%������������������#���� �* !�4 �%�'������������ ��%��� ���'����#��%�������������

����� '�����������������%����5&�8������ �����#��% � ��� ��#�����������&6�%����� ������

� ��A���������! ���� �������' ���2 # �������� �'�<���#����% �������#� �������' ����

�����!� � �������� ��� ���'� ���A������� ���� ����A� ����

�� �$������%���&�'����(�

����� � �� �����"� � � ����������

��+ ��'� ����%��5)�8� "% ��'�� ���� '�!�����������

'�� ��� ����%��5)�8� 1-���'�� ����#���������� ������

"% ���������������� �%�'�.����� ��������;4(��������� �.��%��% �#����.����#� �'�D�

����� � �� �����"� � � ����������

� #��� ����%��5��8� ���������� # � �� ����! ���' ���#�����%���

�� ��#���������������

������� ��� ���5��A�8� "% ������������ ��#�����% � �'6�� ��5;;;;�;;8�

��� $%��5&8� "% ����� ����#��% ��������5� ���� �'�<���#���

$�' �8�

' ���������� ����%��5��08� ��!�� #�' �����������#�.%����% ���� ������#���

!��� ��'� ����%��50�8� "% ���������' ������5������:��� :�� 8����

���3� �!��� ���'������ '���#����%���������������

����� ����%��5)�8� =������''� ����#������� ��

�����'� ����%��5)8� �����3� ���' ������� '�����/�5 <��F�A�F��A�

4F"$A��1F8�

�������� ���'����� ���� '���% �.�� ��

�<?xml version="1.0" encoding="UTF-8"?> <TxnDetail>

<refno>12345678</refno > <amount >1000.00</amount > <ccy>PHP</ccy> <description>Box of Chocolates</description> <billerid>7442001894</billerid> <email>[email protected]</email > <procid>PSB</procid>

</TxnDetail>

Page 14: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� �)�

5.2.2.2 Response Parameters �

*% ���/����� �������������� � 'A�����%���'�� �#����������������������� �'��% �

� ������'�� ��������1��

�� �$����������&�����(��

����� � �� �����"� � � ����������

��+ ��'� ����%��5)�8� "% ��'�� ���� '�!�����������

������� $%��5�8� "% �� ������#��% ���� �����2 # �������� �'�<�&�#���

��' ���

� ���� � ����%��5��08� �#���������1@$$=11A��%�������! ��% ��/?����� ���

������������� # � �� ����! �����#������������(@2=A�

� ������� ��#��% � �������' ��' ����! '������� �'�<�

�����#����������=����/A��%�������! ��% ��/?��

� # � �� ����! ���������� � ��% �#��'�����

'�� ��� ����%��5)�8� 1-���'�� ����#��������������������� ������

�������������� �������� ��#��% ���' �� ��� ��� '������� �'�<����

�"=D�*% ����������������������A��/��������+ ���� �����% �+���������� 3� ���

��� �������'�� �#�����% �� � ������ 6��� �������������.% ���% ����� ���������

� ���� '����#����� ��� �� 6��� �����������#���A��/��%���'�� � ��� ���� ���������% �

�'�������������' ������%����#��% �#����� ���4��������� � ���������! �� � ��������

�%������� ������'�� ��% ������������������������1?����' ��

�#� �����������% �������������� ����� ���* !�1 � �� A��/�� �#��������-""��/="�

� '�� ���.��%��% �#����.��������� � ��D�

����� � �� �����"� � � ����������

��+ ��'� ����%��5)�8� "% ��'�� ���� '�!�����������

'�� ��� ����%��5)�8� 1-���'�� ����#���������� ������

"% ���' �������+���+ ��%��D�

�String redirectString =

String.Format("{0}?tokenid={1}&digest={2}", postbackUrl, tokenid, GetSHA1Digest(tokenid + ":" + secretKey)); // send browser back to PS Response.Redirect(redirectString, true);

Page 15: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ���

5.3 Multi-Device Support �

� ��#��% ��������#��%�������� �!��+������� ������ .�����K �����������+ ���� �#�

��� ���!� �����������' �� ����������!� ���- �� A�������� ���� �' '��%����% ��/�

���� � ���������%���'������' ���% ��� ��#� � ����� ������!��.� ��������.��+����

.��%�������%���'���������� ��%�������������! �������� '�!���' �+����. !�!��.� �������

���%���������!� A�����%���'�' � ���� ��% ���� ����M �������.��+����.��%���'�� �' ��

������� �#�� ����� ��� ���������� ����� ���5 <�����?�A���%�� A�4�!�� ��%�� �8��

���� � �������%���'�� ��'��% ��� ��#�-"4(�������%����� ������������ '�!���K�����

�#�!��.� �����"% � ������' �#��� ����'�� �� '���!� ����*% ������������ �A������' ��

+ �����'�## � �����M ����'�� �����������#��% ���� ����� ���'�'�������% �

���������� � ������' � �'��������% ���� ����M ����������� ��������+� ������� �

���� �������6�����%�� 6!�� '�!��.� ���������������������+� ������ � ������ ��'�

�� ������#���� .�#���6��� ��������6���.��'�.�����% � ���������'������.��+�. ���

.��%����6' �+���6!�� '�!��.� ����

"% ��� ��#�$����'����1�� �% ���5���8����� ���� �' '�������������+ �-"4(:;-"4(�

��� ����� ������!� ���'� ��� ������ �' �����'�## � ���' �� ��.��%�����% �� '����

��'�#��% ���' � ���� ���@�������� ��6��' �C� ��������A���+����% � ��� ��#��C�;A�

�! ''�������� ;���������A�C� ������ ����������%����������A��� �'�������� '����

�% � ���������'������.��+�. ���.��%����%�. ��%��!��.� ������

���� � ���������%���'�����+����!�����-"4(�)������;-"4(�4�!�� ����#�� �������%����

�����!� �#���%��%������!������

Page 16: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� ���

Appendix 1 – Currency Codes �

$�' � � ����������

�-�� �%������� �� ���

@1�� @1��������

Page 17: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� �>�

Appendix 2 – Error Codes �

$�' � � ����������

���� 1��� ���

���� �� ���'��/��'�

���� ������ ���� �� ��+ �

��&� �� ���'�� # � �� ����! ��

��)� @����%���M '���� ���

���� �� ���'���+ ��

���� $��� �������������� '�

��>� "��������������� �� '�

��0� ����##��� ���#��'��

��9� "����������������� <� ' '�

���� � �������=�����

� �

Page 18: Dragonpay PG API · 1. About this Document "% ’ ’ ! % # 5 8! . 1. %5 18’ % ? / . 5 /8 ˇ"% 1 ! # . % % 6 % ? # 3

� �0�

Appendix 3 – Status Codes �

$�' � � ����������

1� 1��� ���

�� ������ �

�� � �'����

@� @�+��.��

2� 2 #��'�

N� $%��� !��+�

� �