1

I am try to implement Paypal Express with PWA, I am refer https://devdocs.magento.com/guides/v2.3/graphql/payment-methods/payflow-express.html link to implement Graphql API. I have completed 1 to 6 steps. In 7 step i am try to implement setPaymentMethodOnCart mutation. In 7 step As per magento link suggestion we need to pass PayPal token, Payer ID and Cart ID in setPaymentMethodOnCart mutation, but when i pass PayPal token, Payer ID to mutation i got the error Field \"token\" is not defined by type PaymentMethodInput, In 7 step description magento has mention we need to pass PayPal token, Payer ID in mutation but when i am try to do this i am getting error.

Request :

mutation {
  setPaymentMethodOnCart(input: {
      cart_id: "xxxxY2GZeLjGKdC4bea6R8dGFvXfxxxx"
      payment_method: {
          code: "payflow_express"
          token: "xxxx"
          payerid: "xxxx"
      }
  }) {
    cart {
      selected_payment_method {
        code
        title
      }
    }
  }
}

Anyone have idea how can we pass Token and Payer Id.

1 Answer 1

0

payflow_express: { payer_id: "" token: "" }

this is correct format:

> mutation {   setPaymentMethodOnCart(input: {
>     cart_id: "rMQdWEecBZr4SVWZwj2AF6y0dNCKQ8uH"
>     payment_method: {
>         code: "payflow_express"
>         payflow_express: {
>           payer_id: "<PayPal_PayerID>"
>           token: "<PayPal_Token>"
>         }
>       }   }) {
>     cart {
>       selected_payment_method {
>         code
>       }
>     }   } }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.