Skip to content

Update how outgoing payments are created in card service #3630

@mkurapov

Description

@mkurapov

Currently, when we are initiating a transaction from cardService, we are calling the createOutgoingPaymentFromIncomingPayment mutation incorrectly, as we are passing in the incoming payment's incomingAmount as the debitAmount for the outgoing payment:

  variables: {
    walletAddressId,
    incomingPayment: payment.incomingPaymentUrl,
    debitAmount: {
      ...payment.incomingAmount,
      value: BigInt(payment.incomingAmount.value)
    },
    cardDetails: {
      signature: payment.signature,
      expiry: payment.card.expiry
    }
  }

This is incorrect because these amounts correspond to different wallet addresses, and could therefore be delineated in different assets.

Instead, we should update the createOutgoingPaymentFromIncomingPayment mutation to have debitAmount as optional. This will allow creating an outgoing payment (and under the hood, a quote) directly from the incomingAmount on the incoming payment.

Todo

  • Update the createOutgoingPaymentFromIncomingPayment mutation to have debitAmount as optional
  • Update how createOutgoingPaymentFromIncomingPayment mutation is called in cardService

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions