graphql-api icon indicating copy to clipboard operation
graphql-api copied to clipboard

How to get the detail processor response from the Mutation ?

Open dcheng857 opened this issue 2 years ago • 2 comments

Hi here, I'm trying to simulate some error response by the transaction amount which mentions in the Braintree document: https://developer.paypal.com/braintree/docs/reference/general/testing/node#transaction-amounts

When I view the response of the authorizeCreditCard mutation, it only contain a simple status status: "PROCESSOR_DECLINED. Even the statusHistory field is also return the same status: image

May I know is it possible to get the detail processor response from the api?

Many thanks!

dcheng857 avatar Jul 04 '23 16:07 dcheng857

Hi @dcheng857 Yes, it is possible to get the details of the processor response from the API. The statusHistory field contains a list of PaymentStatusEvents. These events can be of multiple implementations including as a ProcessorDeclinedEvent. This event contains the field processorResponse which will contain all of the details the processor returns. This can be implemented by adding the following under the statusHistory.

... on ProcessorDeclinedEvent {
   processorResponse {
      <desired fields>
   }

This can then be done for the other types of PaymentStatusEvents as well.

wysmith-publicgit avatar Jul 05 '23 14:07 wysmith-publicgit

Hi @dcheng857 Yes, it is possible to get the details of the processor response from the API. The statusHistory field contains a list of PaymentStatusEvents. These events can be of multiple implementations including as a ProcessorDeclinedEvent. This event contains the field processorResponse which will contain all of the details the processor returns. This can be implemented by adding the following under the statusHistory.

... on ProcessorDeclinedEvent {
   processorResponse {
      <desired fields>
   }

This can then be done for the other types of PaymentStatusEvents as well.

Thanks @wysmith-publicgit, you just made my day !

dcheng857 avatar Jul 05 '23 16:07 dcheng857