fix
This commit is contained in:
@@ -109,7 +109,6 @@ func quoteSnapshotToModel(src *orchestratorv1.PaymentQuote) *model.PaymentQuoteS
|
||||
FeeRules: cloneFeeRules(src.GetFeeRules()),
|
||||
FXQuote: cloneFXQuote(src.GetFxQuote()),
|
||||
NetworkFee: cloneNetworkEstimate(src.GetNetworkFee()),
|
||||
FeeQuoteToken: strings.TrimSpace(src.GetFeeQuoteToken()),
|
||||
QuoteRef: strings.TrimSpace(src.GetQuoteRef()),
|
||||
}
|
||||
}
|
||||
@@ -264,7 +263,6 @@ func modelQuoteToProto(src *model.PaymentQuoteSnapshot) *orchestratorv1.PaymentQ
|
||||
FeeRules: cloneFeeRules(src.FeeRules),
|
||||
FxQuote: cloneFXQuote(src.FXQuote),
|
||||
NetworkFee: cloneNetworkEstimate(src.NetworkFee),
|
||||
FeeQuoteToken: src.FeeQuoteToken,
|
||||
QuoteRef: strings.TrimSpace(src.QuoteRef),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,7 +109,6 @@ func (h *initiatePaymentCommand) Execute(ctx context.Context, req *orchestratorv
|
||||
Meta: req.GetMeta(),
|
||||
Intent: intent,
|
||||
QuoteRef: req.GetQuoteRef(),
|
||||
FeeQuoteToken: req.GetFeeQuoteToken(),
|
||||
IdempotencyKey: req.GetIdempotencyKey(),
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -73,7 +73,6 @@ func (s *Service) buildPaymentQuote(ctx context.Context, orgRef string, req *orc
|
||||
FeeRules: cloneFeeRules(feeQuote.GetApplied()),
|
||||
FxQuote: fxQuote,
|
||||
NetworkFee: networkFee,
|
||||
FeeQuoteToken: feeQuote.GetFeeQuoteToken(),
|
||||
}
|
||||
|
||||
expiresAt := quoteExpiry(s.clock.Now(), feeQuote, fxQuote)
|
||||
|
||||
@@ -93,7 +93,6 @@ type quoteResolutionInput struct {
|
||||
Meta *orchestratorv1.RequestMeta
|
||||
Intent *orchestratorv1.PaymentIntent
|
||||
QuoteRef string
|
||||
FeeQuoteToken string
|
||||
IdempotencyKey string
|
||||
}
|
||||
|
||||
@@ -131,10 +130,6 @@ func (s *Service) resolvePaymentQuote(ctx context.Context, in quoteResolutionInp
|
||||
return quote, nil
|
||||
}
|
||||
|
||||
if token := strings.TrimSpace(in.FeeQuoteToken); token != "" {
|
||||
return &orchestratorv1.PaymentQuote{FeeQuoteToken: token}, nil
|
||||
}
|
||||
|
||||
req := &orchestratorv1.QuotePaymentRequest{
|
||||
Meta: in.Meta,
|
||||
IdempotencyKey: in.IdempotencyKey,
|
||||
|
||||
@@ -106,25 +106,6 @@ func TestResolvePaymentQuote_Expired(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestResolvePaymentQuote_FeeToken(t *testing.T) {
|
||||
org := primitive.NewObjectID()
|
||||
intent := &orchestratorv1.PaymentIntent{Amount: &moneyv1.Money{Currency: "USD", Amount: "1"}}
|
||||
svc := &Service{clock: clockpkg.NewSystem()}
|
||||
quote, err := svc.resolvePaymentQuote(context.Background(), quoteResolutionInput{
|
||||
OrgRef: org.Hex(),
|
||||
OrgID: org,
|
||||
Meta: &orchestratorv1.RequestMeta{OrganizationRef: org.Hex()},
|
||||
Intent: intent,
|
||||
FeeQuoteToken: "token",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
if quote.GetFeeQuoteToken() != "token" {
|
||||
t.Fatalf("expected fee token preserved")
|
||||
}
|
||||
}
|
||||
|
||||
func TestInitiatePaymentIdempotency(t *testing.T) {
|
||||
logger := mloggerfactory.NewLogger(false)
|
||||
org := primitive.NewObjectID()
|
||||
@@ -141,7 +122,6 @@ func TestInitiatePaymentIdempotency(t *testing.T) {
|
||||
Meta: &orchestratorv1.RequestMeta{OrganizationRef: org.Hex()},
|
||||
Intent: intent,
|
||||
IdempotencyKey: "k1",
|
||||
FeeQuoteToken: "fq",
|
||||
}
|
||||
resp, err := svc.h.commands.InitiatePayment().Execute(context.Background(), req)(context.Background())
|
||||
if err != nil {
|
||||
|
||||
@@ -92,14 +92,14 @@ type CardEndpoint struct {
|
||||
|
||||
// CardPayout stores gateway payout tracking info.
|
||||
type CardPayout struct {
|
||||
PayoutRef string `bson:"payoutRef,omitempty" json:"payoutRef,omitempty"`
|
||||
ProviderPaymentID string `bson:"providerPaymentId,omitempty" json:"providerPaymentId,omitempty"`
|
||||
Status string `bson:"status,omitempty" json:"status,omitempty"`
|
||||
FailureReason string `bson:"failureReason,omitempty" json:"failureReason,omitempty"`
|
||||
CardCountry string `bson:"cardCountry,omitempty" json:"cardCountry,omitempty"`
|
||||
MaskedPan string `bson:"maskedPan,omitempty" json:"maskedPan,omitempty"`
|
||||
ProviderCode string `bson:"providerCode,omitempty" json:"providerCode,omitempty"`
|
||||
GatewayReference string `bson:"gatewayReference,omitempty" json:"gatewayReference,omitempty"`
|
||||
PayoutRef string `bson:"payoutRef,omitempty" json:"payoutRef,omitempty"`
|
||||
ProviderPaymentID string `bson:"providerPaymentId,omitempty" json:"providerPaymentId,omitempty"`
|
||||
Status string `bson:"status,omitempty" json:"status,omitempty"`
|
||||
FailureReason string `bson:"failureReason,omitempty" json:"failureReason,omitempty"`
|
||||
CardCountry string `bson:"cardCountry,omitempty" json:"cardCountry,omitempty"`
|
||||
MaskedPan string `bson:"maskedPan,omitempty" json:"maskedPan,omitempty"`
|
||||
ProviderCode string `bson:"providerCode,omitempty" json:"providerCode,omitempty"`
|
||||
GatewayReference string `bson:"gatewayReference,omitempty" json:"gatewayReference,omitempty"`
|
||||
}
|
||||
|
||||
// PaymentEndpoint is a polymorphic payment destination/source.
|
||||
@@ -143,7 +143,6 @@ type PaymentQuoteSnapshot struct {
|
||||
FeeRules []*feesv1.AppliedRule `bson:"feeRules,omitempty" json:"feeRules,omitempty"`
|
||||
FXQuote *oraclev1.Quote `bson:"fxQuote,omitempty" json:"fxQuote,omitempty"`
|
||||
NetworkFee *chainv1.EstimateTransferFeeResponse `bson:"networkFee,omitempty" json:"networkFee,omitempty"`
|
||||
FeeQuoteToken string `bson:"feeQuoteToken,omitempty" json:"feeQuoteToken,omitempty"`
|
||||
QuoteRef string `bson:"quoteRef,omitempty" json:"quoteRef,omitempty"`
|
||||
}
|
||||
|
||||
|
||||
@@ -122,8 +122,7 @@ message PaymentQuote {
|
||||
repeated fees.v1.AppliedRule fee_rules = 5;
|
||||
oracle.v1.Quote fx_quote = 6;
|
||||
chain.gateway.v1.EstimateTransferFeeResponse network_fee = 7;
|
||||
string fee_quote_token = 8;
|
||||
string quote_ref = 9;
|
||||
string quote_ref = 8;
|
||||
}
|
||||
|
||||
message ExecutionRefs {
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:pshared/api/responses/base.dart';
|
||||
import 'package:pshared/api/responses/token.dart';
|
||||
import 'package:pshared/data/dto/payment/method.dart';
|
||||
|
||||
part 'payment_method.g.dart';
|
||||
part 'method.g.dart';
|
||||
|
||||
|
||||
@JsonSerializable(explicitToJson: true)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:pshared/api/responses/payment_method.dart';
|
||||
import 'package:pshared/api/responses/payment/method.dart';
|
||||
import 'package:pshared/data/mapper/payment/method.dart';
|
||||
import 'package:pshared/models/payment/methods/type.dart';
|
||||
import 'package:pshared/service/services.dart';
|
||||
|
||||
Reference in New Issue
Block a user