- 
                Notifications
    You must be signed in to change notification settings 
- Fork 102
Closed
Description
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 createOutgoingPaymentFromIncomingPaymentmutation to havedebitAmountas optional
-  Update how createOutgoingPaymentFromIncomingPaymentmutation is called in cardService