How to validate if a transaction was previously processed or previously captured?

Hello,

I'm trying to validate in my C# code if one transaction was previously captured in order to apply a logic for that specific use case. How can I determine that situation based on BlackBaud response?

Is it safe to say that code 20 is a response for this case (I mean for a transaction that is being retried, however, it was previously "Processed" )?


I'm able to receive this answer from here POST https://api.sky.blackbaud.com/payments/v1/transactions/3c3ba9f4-xxxx-4f51-a8c2-a2b412345dc/capture

{

   "message":"A transaction must be in an authorized state to be captured.",

   "error_name":"TransactionStateDoesNotSupportCapture",

   "error_code":20,

   "raw_message":"A transaction must be in an authorized state to be captured."

}


Can you confirm this assumption?

Comments

  • Any update on this?
  • Mina Mistry
    Mina Mistry Blackbaud Employee
    Seventh Anniversary Kudos 2 Name Dropper Participant
    Hi Dalmiro


    You could try using the GET Transaction endpoint to return the status on a previously submitted request.  The response will include the state enum shown below:

    "state": {<br/> "enum": [<br/> "Unknown",<br/> "Processed",<br/> "Failed",<br/> "Refunded",<br/> "Pending",<br/> "Authorized",<br/> "Voided"<br/> ],

    Please let me know if you need additional assistance!


    Thanks.

Categories