Skip to content
b5510546140 edited this page Dec 6, 2014 · 14 revisions

1. Create new Payment

Request

Method URL
POST /payment

Request Body

<payment>
    <orderID> {orderID} </orderID>
    <merchantID> {merchantID} </merchantID>
    <amount> {amount} </amount>
    <datetime> {date time} </datetime>
</payment>

Response

Status Response Message
400 Can’t creat a new payment
409 Id is already exist.

## 2. Get All Payment Transaction
### Request
|Mehod|URL|
|------|---|
|Admin only|
|GET|/payment|
### Response
* 200 OK
``` xml
<paymentTransaction>
	<payment id="1">
		<orderID>1</orderID>
		<merchantID>1</merchantID>
		<amount>29</amount>
	        <status>Pending</status>
		<datetime>today</datetime>
	</payment>
	<payment id="2">
		<orderID>1</orderID>
		<merchantID>1</merchantID>
		<amount>100</amount>
	        <status>Pending</status>
		<datetime>today</datetime>
	</payment>
</paymentTransaction>

3. Get Payment Transaction by ID

Request

Method URL
GET /kupayment/{id}
Param Name Type
id long

Header

  • (Optional) If-Non-Match

Response

  • 200 OK
<paymentid="505">
	<orderID>353</orderID>
	<merchantID>24</merchantID>
	<amount>100.0</amount>
	<status>Pending</status>
	<datetime>02/12/2014 17:59:42</datetime>
</payment>

4. Get Payment by User

Request

Method URL
GET /payment/user/{email}
Param Name Type
email String

Header

  • (Optional) If-Non-Match

Response

  • 200 OK
<paymentTransaction>
	<payment id="1">
		<orderID>1</orderID>
		<merchantID>1</merchantID>
		<amount>29</amount>
	        <status>Pending</status>
		<datetime>today</datetime>
	</payment>
	<payment id="2">
		<orderID>1</orderID>
		<merchantID>1</merchantID>
		<amount>100</amount>
	        <status>Pending</status>
		<datetime>today</datetime>
	</payment>
</paymentTransaction>

5. Login

Request

Method URL
GET /payment/login
authenticate

Response

  • 200 OK
http://128.199.212.108:25052/payment/{user id}

6. Accept payment

Request

Method URL
PUT /payment/accept/{id}
Param Name Type
id long

Response

  • 200 OK
http://128.199.212.108:25052/payment/{id}

7. Get all wallet

Request

Method URL
GET /wallet/

Response

  • 200 OK
<wallets>
	<walletid="6">
		<ownerID>23</ownerID>
		<balance>1.21253241E8</balance>
		<accountNumber>123123124124</accountNumber>
	</wallet>
	<walletid="7">
		<ownerID>24</ownerID>
		<balance>929.0</balance>
		<accountNumber>123123124145</accountNumber>
	</wallet>
</wallets>

8. Get wallet by user

Request

Method URL
GET /wallet/{id}
Param Name Type
id long

Response

  • 200 OK
<walletid="7">
		<ownerID>24</ownerID>
		<balance>929.0</balance>
		<accountNumber>123123124145</accountNumber>
	</wallet>

9. Create Wallet

Request

Method URL
POST /wallet/
Param Name Type
id long

Response

  • 200 OK

10. Money transfer

Request

Method URL
PUT /wallet/
Param Name Type
id long

Response

  • 200 OK

11. Get all user

Request

Method URL
GET /user/
Admin only

Response

  • 200 OK
<users>
<userid="23">
<email>[email protected]</email>
<password>1q2w3e4r5t</password>
<firstName>Parinthorn</firstName>
<lastName>Panya</lastName>
<address>Eieieieieie</address>
</user>
	<userid="24">
	<email>[email protected]</email>
	<password>1q2w3e4r5t</password>
	<firstName>jf</firstName>
	<lastName>shop</lastName>
	<address>Eieieieieie</address>
	</user>
<users>

12. Get user by username

Request

Method URL
GET /user/{email}
Param Name Type
email String

Response

  • 200 OK
<userid="23">
	<email>[email protected]</email>
	<password>1q2w3e4r5t</password>
	<firstName>Parinthorn</firstName>
	<lastName>Panya</lastName>
	<address>Eieieieieie</address>
</user>

13. crete user

Request

Method URL
POST /user/

Response

  • 200 OK

14. Get user by username

Request

Method URL
PUT /user/{id}
Param Name Type
email String

Request Body

<user id="23">
	<email>[email protected]</email>
	<password>1q2w3e4r5t</password>
	<firstName>Parinthorn</firstName>
	<lastName>Panya</lastName>
	<address>Eieieieieie</address>
</user>

Response

  • 200 OK
http://128.199.212.108:25052/user/23