pay_data.go 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. package fawry
  2. type ret struct {
  3. Code string `json:"code"` // 响应 ‘SUCCESS’
  4. Msg string `json:"msg"` // 响应 ‘Success’
  5. }
  6. type pay_req struct {
  7. MerchantCode string `json:"merchantCode" form:"merchantCode"`
  8. MerchantRefNum string `json:"merchantRefNum" form:"merchantRefNum"`
  9. PaymentMethod string `json:"paymentMethod" form:"paymentMethod"`
  10. CardNumber string `json:"cardNumber,omitempty" form:"cardNumber,omitempty"`
  11. CardExpiryYear string `json:"cardExpiryYear,omitempty" form:"cardExpiryYear,omitempty"`
  12. CardExpiryMonth string `json:"cardExpiryMonth,omitempty" form:"cardExpiryMonth,omitempty"`
  13. Cvv string `json:"cvv,omitempty" form:"cvv,omitempty"`
  14. CustomerMobile string `json:"customerMobile" form:"customerMobile"`
  15. CustomerEmail string `json:"customerEmail" form:"customerEmail"`
  16. Amount string `json:"amount" form:"amount"`
  17. CurrencyCode string `json:"currencyCode" form:"currencyCode"`
  18. Description string `json:"description" form:"description"`
  19. Language string `json:"language" form:"language"`
  20. ChargeItems []chargeItems `json:"chargeItems" form:"chargeItems"`
  21. Enable3DS bool `json:"enable3DS,omitempty" form:"enable3DS,omitempty"`
  22. AuthCaptureModePayment bool `json:"authCaptureModePayment,omitempty" form:"authCaptureModePayment,omitempty"`
  23. ReturnUrl string `json:"returnUrl,omitempty" form:"returnUrl,omitempty"`
  24. Signature string `json:"signature" form:"signature"`
  25. }
  26. type pay_resp struct {
  27. Type string `json:"type" form:"type"`
  28. ReferenceNumber string `json:"referenceNumber" form:"referenceNumber"`
  29. MerchantRefNumber string `json:"merchantRefNumber" form:"merchantRefNumber"`
  30. WalletQr string `json:"walletQr" form:"walletQr"`
  31. StatusCode int `json:"statusCode" form:"statusCode"`
  32. StatusDescription string `json:"statusDescription" form:"statusDescription"`
  33. }
  34. type chargeItems struct {
  35. ItemId string `json:"itemId" form:"itemId"`
  36. Description string `json:"description" form:"description"`
  37. Price string `json:"price" form:"price"`
  38. Quantity float64 `json:"quantity" form:"quantity"`
  39. }
  40. type payNotify struct {
  41. RequestId string `json:"requestId" form:"requestId"`
  42. FawryRefNumber string `json:"fawryRefNumber" form:"fawryRefNumber"`
  43. MerchantRefNumber string `json:"merchantRefNumber" form:"merchantRefNumber"`
  44. CustomerName string `json:"customerName" form:"customerName"`
  45. CustomerMobile string `json:"customerMobile" form:"customerMobile"`
  46. CustomerMail string `json:"customerMail" form:"customerMail"`
  47. CustomerMerchantId string `json:"customerMerchantId" form:"customerMerchantId"`
  48. PaymentAmount float64 `json:"paymentAmount" form:"paymentAmount"`
  49. OrderAmount float64 `json:"orderAmount" form:"orderAmount"`
  50. FawryFees float64 `json:"fawryFees" form:"fawryFees"`
  51. ShippingFees float64 `json:"shippingFees" form:"shippingFees"`
  52. OrderStatus string `json:"orderStatus" form:"orderStatus"`
  53. PaymentMethod string `json:"paymentMethod" form:"paymentMethod"`
  54. PaymentTime int `json:"paymentTime" form:"paymentTime"`
  55. AuthNumber int `json:"authNumber" form:"authNumber"`
  56. PaymentRefrenceNumber string `json:"paymentRefrenceNumber" form:"paymentRefrenceNumber"`
  57. OrderExpiryDate int `json:"orderExpiryDate" form:"orderExpiryDate"`
  58. OrderItems []orderItem `json:"orderItems" form:"orderItems"`
  59. FailureErrorCode string `json:"failureErrorCode" form:"failureErrorCode"`
  60. FailureReason string `json:"failureReason" form:"failureReason"`
  61. MessageSignature string `json:"messageSignature" form:"messageSignature"`
  62. }
  63. type orderItem struct {
  64. ItemCode string `json:"itemCode" form:"itemCode"`
  65. Price float64 `json:"price" form:"price"`
  66. Quantity int `json:"quantity" form:"quantity"`
  67. }