Skip to content

v0.0.12

jpay-user-proto

jpay/user/v1/base.proto

Error

Invoice

FieldTypeLabelDescription
typeInvoice.Typetype: 發票類型
numberstringoptionalnumber: 發票號碼
codestringoptionalcode: 發票隨機碼
commentstringcomment: 發票其它文字,例如:雲端發票已簡訊發送

Error.Code

NameNumberDescription
None0
AccessTokenInvalid1

Invoice.Type

NameNumberDescription
NotSet0
Text1
PDF2
Ecpay3

PaymentType

NameNumberDescription
Domestic_Type0
Foreign_Type1
Diamond_Type2
ATM_Type3
CSV_Type4
NOT_SET_Type5
Jpoint_Type6
Cash_Type7
Jkopay_Type8
Jkopay_Authpay_Type9

TransactionStatus

NameNumberDescription
TS_NotSet0
Created1訂單創建
Succeed2訂單成功
CallbackCompleted3訂單成功,且已通知產品端
InvoiceCompleted4已開立發票
Failed5訂單交易失敗
FailedCallbackCompleted6訂單交易失敗,且已通知產品端
RefundWithoutWithdrawal7已要求退款,但尚未執行
Refund8已退款
Overdue9訂單逾期
OverdueCallbackCompleted10訂單逾期,且已通知產品端
PaymentNotSetOverdue11訂單未設定支付方式,超過指定時間
PaymentNotSetOverdueCallbackCompleted12訂單未設定支付方式,超過指定時間,且已通知產品端

jpay/user/v1/record_query.proto

GetCompletedOrdersReq

FieldTypeLabelDescription
pan_access_tokenstring要查詢資料的用戶的access token
page_numberint64指定頁數
page_sizeint64指定每頁筆數

GetCompletedOrdersRes

FieldTypeLabelDescription
recordsGetCompletedOrdersRes.Recordrepeated
current_pageint64當前頁數
total_pageint64總頁數
total_countint64總筆數

GetCompletedOrdersRes.Record

FieldTypeLabelDescription
trade_idstring
app_display_namestring產品端顯示名稱
app_icon_urlstring產品端icon的url path
product_namestring產品名稱
amountint64訂單總金額
statusTransactionStatus只會是2或3
payment_typePaymentType支付方式類別
invoiceInvoice如果prefix是http要request,帶trade_id和access token
system_commentstring系統性註解,目前只有使用jpoint折抵時才會有註解
completed_atgoogle.protobuf.Timestamp完成交易時間

GetInvoicePDFReq

FieldTypeLabelDescription
pan_access_tokenstring
trade_idstring要獲取發票pdf的訂單trade_id

GetInvoicePDFRes

FieldTypeLabelDescription
databytespdf的bytes,需要由前端以blob decode

RecordQueryService

Method NameRequest TypeResponse TypeDescription
GetCompletedOrdersGetCompletedOrdersReqGetCompletedOrdersRes查詢該用戶已完成訂單,只會查CallbackCompleted或InvoiceCompleted的,不會包含現金或鑽石支付的訂單,以完成訂單時間倒序排列
GetInvoicePDFGetInvoicePDFReqGetInvoicePDFRes查詢指定trade_id的發票pdf

Scalar Value Types

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)