payment gateway for rpn cn
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

37 lignes
846B

  1. package main
  2. import (
  3. "log"
  4. "time"
  5. )
  6. func buildLeanworkOutByIn(in LeanworkIn) (ret LeanworkOut) {
  7. ret.Leanwork = in.Id
  8. ret.SignType = "MD5"
  9. ret.OrderNo = in.OrderNo
  10. ret.OrderAmount = in.OrderAmount
  11. ret.OrderCurrency = in.OrderCurrency
  12. ret.TransactionId = "DEMO" + time.Now().Format("20060102150405")
  13. ret.Status = "success"
  14. ret.UpdateSignature()
  15. return
  16. }
  17. func debugStartLeanworkCallBack(li LeanworkIn) {
  18. lo := buildLeanworkOutByIn(li)
  19. if lo.Status != "success" {
  20. log.Printf("Warning: Leanwork Status is not Success, skip notify leanwork %+v", lo)
  21. return
  22. }
  23. for i := 1; i <= 1; i++ {
  24. retry, err := lo.DoHttp()
  25. if !retry {
  26. break
  27. }
  28. time.Sleep(5 * time.Minute) //sleep 5 minute and try again
  29. log.Printf("Trying(%d) to report leanwork about transaction status %+v, encountered error %s \n", i, lo, err.Error())
  30. }
  31. }