diff --git a/api/payments/orchestrator/internal/service/orchestrator/convert.go b/api/payments/orchestrator/internal/service/orchestrator/convert.go index 218eada..95d97ca 100644 --- a/api/payments/orchestrator/internal/service/orchestrator/convert.go +++ b/api/payments/orchestrator/internal/service/orchestrator/convert.go @@ -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), } } diff --git a/api/payments/orchestrator/internal/service/orchestrator/handlers_commands.go b/api/payments/orchestrator/internal/service/orchestrator/handlers_commands.go index 2a9806f..68330e5 100644 --- a/api/payments/orchestrator/internal/service/orchestrator/handlers_commands.go +++ b/api/payments/orchestrator/internal/service/orchestrator/handlers_commands.go @@ -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 { diff --git a/api/payments/orchestrator/internal/service/orchestrator/quote_engine.go b/api/payments/orchestrator/internal/service/orchestrator/quote_engine.go index b9de283..c647ca9 100644 --- a/api/payments/orchestrator/internal/service/orchestrator/quote_engine.go +++ b/api/payments/orchestrator/internal/service/orchestrator/quote_engine.go @@ -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) diff --git a/api/payments/orchestrator/internal/service/orchestrator/service_helpers.go b/api/payments/orchestrator/internal/service/orchestrator/service_helpers.go index 0246a16..3b8ba32 100644 --- a/api/payments/orchestrator/internal/service/orchestrator/service_helpers.go +++ b/api/payments/orchestrator/internal/service/orchestrator/service_helpers.go @@ -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, diff --git a/api/payments/orchestrator/internal/service/orchestrator/service_helpers_test.go b/api/payments/orchestrator/internal/service/orchestrator/service_helpers_test.go index 3384c86..ea777d4 100644 --- a/api/payments/orchestrator/internal/service/orchestrator/service_helpers_test.go +++ b/api/payments/orchestrator/internal/service/orchestrator/service_helpers_test.go @@ -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 { diff --git a/api/payments/orchestrator/storage/model/payment.go b/api/payments/orchestrator/storage/model/payment.go index 9b9d8ca..72a62f2 100644 --- a/api/payments/orchestrator/storage/model/payment.go +++ b/api/payments/orchestrator/storage/model/payment.go @@ -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"` } diff --git a/api/proto/payments/orchestrator/v1/orchestrator.proto b/api/proto/payments/orchestrator/v1/orchestrator.proto index b02d39d..ed1adeb 100644 --- a/api/proto/payments/orchestrator/v1/orchestrator.proto +++ b/api/proto/payments/orchestrator/v1/orchestrator.proto @@ -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 { diff --git a/frontend/pshared/lib/api/responses/payment/method.dart b/frontend/pshared/lib/api/responses/payment/method.dart index c0f5834..cf76b17 100644 --- a/frontend/pshared/lib/api/responses/payment/method.dart +++ b/frontend/pshared/lib/api/responses/payment/method.dart @@ -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) diff --git a/frontend/pshared/lib/service/recipient/pmethods.dart b/frontend/pshared/lib/service/recipient/pmethods.dart index 3d629cd..cb8a662 100644 --- a/frontend/pshared/lib/service/recipient/pmethods.dart +++ b/frontend/pshared/lib/service/recipient/pmethods.dart @@ -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';