Bảo Kim Jsc
Template 02November2004Transaction API
Cổng thanh toán trực tuyến BaoKim.vn – Transaction API
All future revisions to this document shall be approved by the content owner prior to release.
Template 02November2004Transaction API
CONTENT OWNERS: HuyNQ
All future revisions to this document shall be approved by the content owner prior to release.
Template 02November2004Transaction API
DOCUMENT NUMBER: RELEASE/REVISION: RELEASE/REVISION DATE:
• 01 • 1.0 • 2011/10/12
All future revisions to this document shall be approved by the content owner prior to release.
Contents
Tổ chức nội dung tài liệu
Nội dung tàiliệuđượctổchứcthànhcácphầnnhưsau:
• Phần 1: Mụcđích, phạmviápdụngtàiliệudựng.
• Phần2: GiảiphápxâydựngAPI, sơđồkiếntrúchệthống
• Phần3:Phụlục
1 Mục đích, phạm vi áp dụng tài liệu
Tàiliệuđặctảsơđồkiếntrúckỹthuậtcủaapi service nhằmđápứngcácyêucầuđặtrađốivớiviệcthựchiệngiaodịch thong qua API
Tàiliệunàydùngcho:
- BộphậnphụtráchkỹthuậtBảo Kim
- BộphậnquảnlýsảnphẩmBảo Kim, giớithiệucácthông tin đếnkháchhàng (mộtsốthông tin cầnthiếttrongtrườnghợpkếtnốikỹthuật)
- Merchant tíchhợpthanhtoánBảo Kim
2 Giải pháp xây dựng api service, sơ đồ luồng trang thanh toán
2.1 Sơđồhệthống
2.2 Môtả chi tiếtdữliệugiaotiếp
2.2.1 TopupToMerchantRequest
Saukhiphía merchant xácthựcđượctàikhoảnthànhcông! Merchant gọi method DoTopupToMerchantđếnBảo Kim
việcthựchiệnnạptiềnchotàikhoản
• Api_username: username đăngnhập web service củaBảo Kim, do Bảo Kim cấpcho website merchant
• Api_password: mậtkhẩuđăngnhập web service củaBảo Kim, do Bảo Kim cấpcho website merchant
• Merchant_id: mã merchant của website merchant khiđăngkýtrênBảo Kim
• Transaction_id: Merchant sinhramộtmãgiaodịchkhôngtrùngnhau request sang Bảo Kim đểnạptiềncho TK.
Baokimkhôngnhậnviệctrùngmãgiaodịch.
• Card_id: ID thẻcào (Mobile, Vina, Viettel…)
• Pin_field: Mã pin thẻcào
• Seri_field: Mã Seri thẻcào
• Data_sign: Trường thong tin đảmbảotínhtoànvẹndữliệu(Đượcmôtảmục 2.2.3)
2.2.2 TopupToMerchantResponse
Bảo Kim sẽtiếnhànhxác minh thông tin thanhtoánvàtrảkếtquảvềcho website merchant object
• error_code: mãlỗitrảvề
• error_message: thôngbáolỗitrảvề
• Transaction_id: MãgiaodịchtrênhệthốngBảo Kim
• Info_card: Thông tin thẻcàovừanạp (Giátrịthẻvừacào)
• Data_sign: Trường thong tin đảmbảotínhtoànvẹndữliệu (Trường thong tin nàyđược Verify theoquytắctrên)
Bảngmãlỗitrảvềbướcnày:
0 - Suscess
1 – data request error
2 - wrong account api
3 - merchant site not found
4 - api account and merchant site account are not the same
5 - Transaction id existed
6 - merchant account found but not available to make transaction
7 - receiver account not found
8 - receiver account found but not available to make transaction
9 - Transaction amount is out of limited range
10 - escrow transaction mode is not allowed for guarantee account
11 - Transaction create error
12 - Info data changed - data_sign
13 - Payment amount is out of limited range
14 - Info card used BaoKim
15 - Error from gateway
16 – Card ID invalid
98 – IP invalid
99 - other error
2.2.3 TạoData_sign
***TrườngdữliệuData_signđượcthựchiệntheoquytắc:NốiliềntheothứtựAlphabetcácthamsốRequestvới Key tươngứng.
Gắnliềntrước string trênvàoliềnsausecure_passrồi MD5.
Vd: Code mẫu PHP nhưsau:
ksort($data_request);
$data_sign = md5($secure_code . implode('', $data_request));
$data_signlàtrườngthông tin sẽđưalênBảo Kim
Không có nhận xét nào:
Đăng nhận xét