Skip to content

Required parameter “braintree” for “payment_method” is missing in PWA

Good day everyone,

Each time a try to do a checkout in magento using credit card it gives this error:

Required parameter “braintree” for “payment_method” is missing.

The weird thing is I checked the Graphql schema in the code and there is nothing missing:

export const SET_CC_DETAILS_ON_CART = gql`
mutation setSelectedPaymentMethod($cartId: String!, $paymentNonce: String!) {
    setPaymentMethodOnCart(
        input: {
            cart_id: $cartId
            payment_method: {
                code: "braintree"
                braintree: { payment_method_nonce: $paymentNonce, is_active_payment_token_enabler: false }
            }
        }
    ) @connection(key: "setPaymentMethodOnCart") {
        cart {
            id
            selected_payment_method {
                code
                title
            }
        }
    }
}

`;

I did it as the documentation of magento says but the error continue to appear:
https://devdocs.magento.com/guides/v2.4/graphql/payment-methods/braintree.html

mutation {
  setPaymentMethodOnCart(input: {
    cart_id: "IeTUiU0oCXjm0uRqGCOuhQ2AuQatogjG"
    payment_method: {
      code: "braintree"
      braintree: {
        payment_method_nonce: "fake-nonce"
        is_active_payment_token_enabler: false
      }
    }
  }) {
  cart {
    selected_payment_method {
      code
    }
  }
}

Can anyone help out with this please?