feat: update prepay id
This commit is contained in:
52
backend/providers/wepay/pay_test.go
Normal file
52
backend/providers/wepay/pay_test.go
Normal file
@@ -0,0 +1,52 @@
|
||||
package wepay
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"quyun/app/service/testx"
|
||||
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
"github.com/stretchr/testify/suite"
|
||||
"go.ipao.vip/atom/contracts"
|
||||
"go.uber.org/dig"
|
||||
)
|
||||
|
||||
type WePayInjectParams struct {
|
||||
dig.In
|
||||
Initials []contracts.Initial `group:"initials"`
|
||||
|
||||
Client *Client
|
||||
}
|
||||
|
||||
type WePayTestSuite struct {
|
||||
suite.Suite
|
||||
|
||||
WePayInjectParams
|
||||
}
|
||||
|
||||
func Test_WePay(t *testing.T) {
|
||||
providers := testx.Default().With(Provide)
|
||||
testx.Serve(providers, t, func(params WePayInjectParams) {
|
||||
suite.Run(t, &WePayTestSuite{WePayInjectParams: params})
|
||||
})
|
||||
}
|
||||
|
||||
func (s *WePayTestSuite) Test_PrePay() {
|
||||
Convey("get prepay", s.T(), func() {
|
||||
Convey("prepay", func() {
|
||||
resp, err := s.Client.V3TransactionJsapi(context.Background(), func(bm *BodyMap) {
|
||||
bm.
|
||||
OutTradeNo(fmt.Sprintf("test_trade_no_%d", time.Now().Unix())).
|
||||
Description("Test transaction").
|
||||
Payer("o5Bzk644x3LOMJsKSZRlqWin74IU")
|
||||
})
|
||||
So(err, ShouldBeNil)
|
||||
So(resp, ShouldNotBeNil)
|
||||
|
||||
s.T().Logf("prepay response: %+v", resp)
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user