Support » Plugin: WooCommerce PayPal Checkout Payment Gateway » Error Parsing order API

  • Resolved nhm_pt

    (@nhm_pt)


    Having a parse error for orders payed with this plugin.

    I try to get all orders that are processing with the woocommerce api v3 and I get this error:
    Unexpected character encountered while parsing value: {. Path ‘[2].meta_data[3].value’, line 1, position 7719.”}

    Checking this issue I notice that the object is built like this:
    [JSON].[2].meta_data.[3]
    [JSON].[2].meta_data.[3].value
    [JSON].[2].meta_data.[3].value.refundable_txns
    [JSON].[2].meta_data.[3].value.refundable_txns.[0]
    [JSON].[2].meta_data.[3].value.refundable_txns.[0].txnID
    (…)
    [JSON].[2].meta_data.[3].value.txn_type

    Is this correct?
    Shouldn’t value.txn_type get initialized or does the [JSON].[2].meta_data.[3].value should receive another array?

    Getting all other orders that was not payed via the paypal Checkout has no problem parsing.

    Can you help??

Viewing 4 replies - 1 through 4 (of 4 total)
  • nhm_pt

    (@nhm_pt)

    Can someone help me??

    James Rodger

    (@jamesrrodger)

    Hi @nhm_pt,

    Thanks for the details on the issue you’re facing. I’ve tried to recreate it, but the JSON the API is producing for me seems to be valid and parsable.

    The structure you have outlined looks correct to me. Where are you seeing the error?

    Unexpected character encountered while parsing value: {. Path ‘[2].meta_data[3].value’, line 1, position 7719.”}

    Is this in your PHP error log, or is it being encountered when you try to parse the JSON produced by the API?

    nhm_pt

    (@nhm_pt)

    Hello @jamesrrodger,

    You are correct. The problem was on my side.

    I apologize for your time spent.
    I then realize, after you confirm that everything was ok, that I had a bug in the structure.

    James Rodger

    (@jamesrrodger)

    No problem! I’m glad another pair of eyes helped.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.