braintree / graphql-api

Schemas, changelogs and feature requests for Braintree's GraphQL API
https://graphql.braintreepayments.com/
61 stars 46 forks source link

How to get the detail processor response from the Mutation ? #37

Open dcheng857 opened 1 year ago

dcheng857 commented 1 year ago

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!

wysmith-publicgit commented 1 year ago

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.

dcheng857 commented 1 year ago

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 !