• Resolved petewjbox

    (@petewjbox)


    Hi there,

    I’m attempting to complete a transaction using your plugin via the WooCommerce Order API endpoint and it’s not attempting to take payment when it’s creating the order – returning that the Credit Card is not accepted.

    The error in the WooCommerce order log is “Error processing payment. Reason: Credit card type is not accepted by this merchant account.”

    If I then pay for the order manually using the same card details from the Order Admin screen in WooCommerce, it completes successfully.

    I have the payment token generated from Braintree for the credit card payment, but I’m not sure how to pass that into the order request. The Stripe implementation uses the metadata fields to pass in the token, so I’m assuming that something similar could be completed for creating an order using the Braintree plugin instead?

    Are there specific meta data key/values, or other Order API fields (other than the payment method etc), that need to be set in order to complete the purchase?

    Thanks,

    Pete

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Clayton R

    (@mrclayton)

    Hi @petewjbox

    I don’t see in those API docs where you’re actually taking payment. Those docs are for creating and order, retrieving an order, etc. Are you using custom code to process the actual payment?

    Your request must be include the payment method nonce in as follows:

    {$gateway_id}_nonce_key: $nonce where $nonce is the payment method nonce from Braintree and $gateway_id is the ID of the payment gateway.

    Thanks

    Thread Starter petewjbox

    (@petewjbox)

    Hi,

    Thanks for the information. I realise that I’d left out the fact that we are using the GraphQL implementation (https://github.com/wp-graphql/wp-graphql-woocommerce) which utilises the same data model as the Woo API.

    But, your response helped me understand that you’re referring to a POST variable which needs to be sent along with the request. It’s a bit awkward to implement, as ideally it could be done via the GraphQL mutation directly, but it’s possible to also send the expected POST var as well – which seems to be working.

    Thanks for your help

    Pete

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Headless payment using WooCommerce Order object’ is closed to new replies.