修改支付相关
This commit is contained in:
@@ -12,12 +12,14 @@ import (
|
||||
|
||||
type paymentRepoStub struct {
|
||||
create *PaymentResult
|
||||
createErr error
|
||||
createdReq *PaymentRequest
|
||||
refund *PaymentResult
|
||||
refundErr error
|
||||
refundedReq *PaymentRefundRequest
|
||||
callback *PaymentResult
|
||||
query *PaymentResult
|
||||
queryErr error
|
||||
queryCalls int
|
||||
callbackErr error
|
||||
}
|
||||
@@ -25,7 +27,7 @@ type paymentRepoStub struct {
|
||||
func (r *paymentRepoStub) Create(_ context.Context, req *PaymentRequest) (*PaymentResult, error) {
|
||||
copyReq := *req
|
||||
r.createdReq = ©Req
|
||||
return r.create, nil
|
||||
return r.create, r.createErr
|
||||
}
|
||||
|
||||
type paymentOrderRepoStub struct {
|
||||
@@ -111,7 +113,7 @@ func (s *paymentSourceStub) PreparePayment(context.Context, string, string, stri
|
||||
}
|
||||
func (r *paymentRepoStub) Query(context.Context, string, string) (*PaymentResult, error) {
|
||||
r.queryCalls++
|
||||
return r.query, nil
|
||||
return r.query, r.queryErr
|
||||
}
|
||||
func (r *paymentRepoStub) Refund(_ context.Context, req *PaymentRefundRequest) (*PaymentResult, error) {
|
||||
if req != nil {
|
||||
|
||||
Reference in New Issue
Block a user