trade.go 966 B

12345678910111213141516171819202122232425262728293031323334
  1. package service
  2. import (
  3. "context"
  4. "go-common/app/interface/main/ugcpay/model"
  5. )
  6. // TradeCreate 订单创建
  7. func (s *Service) TradeCreate(ctx context.Context, mid int64, platform string, oid int64, otype string, currency string) (orderID string, payData string, err error) {
  8. if platform == "" {
  9. platform = "web"
  10. }
  11. orderID, payData, err = s.dao.TradeCreate(ctx, platform, mid, oid, otype, currency)
  12. return
  13. }
  14. // TradeQuery 订单查询
  15. func (s *Service) TradeQuery(ctx context.Context, orderID string) (order *model.TradeOrder, err error) {
  16. order, err = s.dao.TradeQuery(ctx, orderID)
  17. return
  18. }
  19. // TradeConfirm 订单二次确认
  20. func (s *Service) TradeConfirm(ctx context.Context, orderID string) (order *model.TradeOrder, err error) {
  21. order, err = s.dao.TradeConfirm(ctx, orderID)
  22. return
  23. }
  24. // TradeCancel 订单取消
  25. func (s *Service) TradeCancel(ctx context.Context, orderID string) (err error) {
  26. err = s.dao.TradeCancel(ctx, orderID)
  27. return
  28. }