支付模块
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pay_test.go 4.8 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package pay
  2. import (
  3. "code.fnuoos.com/go_rely_warehouse/zyos_go_pay.git/lib/icbc"
  4. "fmt"
  5. "testing"
  6. "time"
  7. )
  8. func TestPay(t *testing.T) {
  9. err := Init("119.23.182.117:3306", "zyos_website", "root", "Fnuo123com@")
  10. if err != nil {
  11. t.Errorf("Reverse == %s", err)
  12. }
  13. channel, err := JudgePayChannel("35618318", "mall")
  14. if err != nil {
  15. t.Errorf("Reverse == %s", err)
  16. }
  17. fmt.Println(channel.AppId)
  18. t.Log(channel.MasterNickname)
  19. }
  20. func TestIcbc(t1 *testing.T) {
  21. t:=time.Now()
  22. stime := time.Date(t.Year(), t.Month(), t.Day(), t.Hour(), 0, 0, 0, t.Location()).Format("2006-1-02 15:04:05")
  23. fmt.Println(stime)
  24. }
  25. func TestIcbcShow(t *testing.T) {
  26. param := map[string]string{
  27. "name": "象揪巒", //客户姓名
  28. "mobile": "66732397", //手机号码
  29. "mobileArea": "853", //手机国际代码 853、852、86 *-
  30. "optFlag": "1", //
  31. "otp": "921507",
  32. "cardNo": "5305068200048153",
  33. "cardType": "C",
  34. }
  35. integral, err := icbc.ShowIntegral("10000000000000203505", "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCZBYj5SOjewCZ+\nGx2dAj/Lvp/TlDeVseoUl7V1X4K0jzAyo8kwYzMip5SPKj64zbkydyxqUOdEI5vk\nhfUtnZcb8PI7+lhgoBc6nv7Po+pZuP+0OkxhRvgbL+b0O/e2I3dQJOmfafQNLU1x\n3Nf3uqHtLbFuzrGKmG7zrP6to+tqY7+a+mq/o59ZSkDTWFH094jsrLtngu85hKSf\n0N7moxak+LWJF0Cz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HyR2QDmg3qSN7qHBDEsg5frTtwZlcva/BIRCZ\nItaBJibeJ336NRYGf0ZaKeyI6KUBr0NQ9YSgnkSW/saa+TfXfhiQnO2XcqxxXd2J\nsASo+t6VOoLwraZwO/ki7p9DDb+iAfjo1UboyqW5iQKBgQCzXyhRfacrW0kgmEp6\nCWR0oQgD54aXj1JjUkEe+gE6E7LY9Cl+yAdHBYmyCzS014jNX93+Bpg1XhoR1knO\n78A8Q7sPCrP908ycKul668daDXHp55CGpScxsx3z9jJs5ori+ZncSDAnHf0T0OjX\n+nDJPGN/gp9/WqApT1L4SLlDxg==\n-----END PRIVATE KEY-----", param)
  36. fmt.Println(integral)
  37. fmt.Println(err)
  38. }
  39. func TestIcbcDeduct(t *testing.T) {
  40. param := map[string]string{
  41. "name": "象揪巒", //客户姓名
  42. "mobile": "66732397", //手机号码
  43. "mobileArea": "853", //手机国际代码 853、852、86 *-
  44. "optFlag": "1", //
  45. "otp": "179305",
  46. "cardNo": "5305068200048153",
  47. "cardType": "C",
  48. "cusCredit": "1",
  49. }
  50. icbc.DeductIntegral("10000000000000203505", "-----BEGIN PRIVATE KEY-----\nMIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQCZBYj5SOjewCZ+\nGx2dAj/Lvp/TlDeVseoUl7V1X4K0jzAyo8kwYzMip5SPKj64zbkydyxqUOdEI5vk\nhfUtnZcb8PI7+lhgoBc6nv7Po+pZuP+0OkxhRvgbL+b0O/e2I3dQJOmfafQNLU1x\n3Nf3uqHtLbFuzrGKmG7zrP6to+tqY7+a+mq/o59ZSkDTWFH094jsrLtngu85hKSf\n0N7moxak+LWJF0Czqd4xI8kXfIW5O3t/jaWJPomm1fZSjlbf4VvPXVahkLOV4+Tk\naTlbMrc7ouGPVTGQo0UtWX4CVy30/QvDMfUuhTSw7S/xMO+u7r4wWrNxkEjxIu/m\nzwDFC3Q1AgMBAAECggEBAI2M4Tg4ibIEbZcZ3jrvabQ/kflWklSXT8Hc1K7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