• Resolved alexis888

    (@alexis888)


    Hello,

    I’m posting here because I noticed in the logs of two WooCommerce websites I have developed, I get some 400 errors of this type :
    POST /v1/payment_intents/pi_1H2CivCscPTDJzV5wzbJPkj8/confirm
    POST /v1/payment_intents/pi_1H0nbbFpQBKq4G592Npa7FQJ/confirm

    But right after they happen (I can see with the timestamp) I get the same log with a 200 success.

    It would show like this.

    200 OK - POST /v1/payment_intents/pi_1H0nbbFpQBKq4G592Npa7FQJ/confirm - 03/07/2020 14:03:00
    400 ERR - POST /v1/payment_intents/pi_1H0nbbFpQBKq4G592Npa7FQJ/confirm - 03/07/2020 14:03:00

    It seems on the first request a “level 3” parameter is unknown, hence the 400 error. Then the request is sent again without this parameter and it works (200 code). I’ll post the full code in a next message.

    I have the latest WordPress / WooCommerce / Stripe versions (and all my plugins) on both websites and have just followed the WooCommerce documentation to set up Stripe.

    Do I need to worry about these 400 ERR messages ? If so, how can I fix them ?

    I have these two websites on test mode only as they have just been handed to my client but will go live soon and these are the first websites I set up with WooCommerce using Stripe so I just want to make sure everything will be ok !

    I’ve also reached out to Stripe support but haven’t got answers to my questions yet.

    thanks

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter alexis888

    (@alexis888)

    Here is the full code related to the 400 error (i’ve removed some info for security reasons):

    Request req_cj8O8is1zpDdqU
    POST /v1/payment_intents/pi_1H0nbbFpQBKq4G592Npa7FQJ/confirm – 400
    Date & Time 03/07/2020 14:03:00
    Adresse IP – hidden in this message
    Version – 2019-09-09
    Source – WooCommerce Stripe Gateway/4.5.0 (https://woocommerce.com/products/stripe/)
    Associé – source — src_1H0nbTFpQBKq4G59tJOJGqXs
    payment_intent — pi_1H0nbbFpQBKq4G592Npa7FQJ
    Origine – https://api.stripe.com/

    POST request body :

    {
      "source": Hidden for security,
      "level3": {
        "merchant_reference": "14730",
        "shipping_amount": "696",
        "line_items": {
          "0": {
            "product_code": "13010",
            "product_description": "PRINT PLAGUE",
            "unit_cost": "1000",
            "quantity": "1",
            "tax_amount": "200",
            "discount_amount": "0"
          }
        },
        "shipping_address_zip": "75000",
        "shipping_from_zip": "44400"
      }
    }

    Answer body :

    {
      "error": {
        "code": "parameter_unknown",
        "doc_url": "https://stripe.com/docs/error-codes/parameter-unknown",
        "message": "Received unknown parameter: level3",
        "param": "level3",
        "payment_intent": {
          "id": "pi_1H0nbbFpQBKq4G592Npa7FQJ",
          "object": "payment_intent",
          "amount": 1896,
          "amount_capturable": 0,
          "amount_received": 0,
          "application": null,
          "application_fee_amount": null,
          "canceled_at": null,
          "cancellation_reason": null,
          "capture_method": "automatic",
          "charges": {
            "object": "list",
            "data": [
            ],
            "has_more": false,
            "total_count": 0,
            "url": "/v1/charges?payment_intent=pi_1H0nbbFpQBKq4G592Npa7FQJ"
          },
          "client_secret": Hidden for security,
          "confirmation_method": "automatic",
          "created": 1593777779,
          "currency": "eur",
          "customer": "cus_HZxW6MFJ997Xao",
          "description": "Motocultor Merch - Commande 14730",
          "invoice": null,
          "last_payment_error": null,
          "livemode": false,
          "metadata": {
            "customer_name": "Commande Test",
            "customer_email": "[email protected]",
            "order_id": "14730"
          },
          "next_action": null,
          "on_behalf_of": null,
          "payment_method": null,
          "payment_method_options": {
            "card": {
              "installments": null,
              "network": null,
              "request_three_d_secure": "automatic"
            }
          },
          "payment_method_types": [
            "card"
          ],
          "receipt_email": null,
          "review": null,
          "setup_future_usage": null,
          "shipping": null,
          "source": Hidden for security,
          "statement_descriptor": "MOTOCULTOR",
          "statement_descriptor_suffix": null,
          "status": "requires_confirmation",
          "transfer_data": null,
          "transfer_group": null
        },
        "type": "invalid_request_error"
      }
    }

    And then the full code of the same request without the level 3 parameter that gives a 200 OK

    Request req_8MXMjkHoHcDjX5
    POST /v1/payment_intents/pi_1H0nbbFpQBKq4G592Npa7FQJ/confirm – 200
    Date & time 03/07/2020 14:03:00
    Adresse IP – hidden
    Version – 2019-09-09
    Source – WooCommerce Stripe Gateway/4.5.0 (https://woocommerce.com/products/stripe/)
    Associé – charge — ch_1H0nbcFpQBKq4G59D7YwbFgU
    source — src_1H0nbTFpQBKq4G59tJOJGqXs
    payment_intent — pi_1H0nbbFpQBKq4G592Npa7FQJ
    customer — Hidden for security
    Origine – https://api.stripe.com/

    POST request body :

    {
      "source": "src_1H0nbTFpQBKq4G59tJOJGqXs"
    }

    Answer body :

    {
      "id": "pi_1H0nbbFpQBKq4G592Npa7FQJ",
      "object": "payment_intent",
      "amount": 1896,
      "amount_capturable": 0,
      "amount_received": 1896,
      "application": null,
      "application_fee_amount": null,
      "canceled_at": null,
      "cancellation_reason": null,
      "capture_method": "automatic",
      "charges": {
        "object": "list",
        "data": [
          {
            "id": "ch_1H0nbcFpQBKq4G59D7YwbFgU",
            "object": "charge",
            "amount": 1896,
            "amount_refunded": 0,
            "application": null,
            "application_fee": null,
            "application_fee_amount": null,
            "balance_transaction": "txn_1H0nbdFpQBKq4G59sLqf1Qdn",
            "billing_details": {
              "address": {
                "city": "Haute Goulaine",
                "country": "FR",
                "line1": "some random street",
                "line2": null,
                "postal_code": "75000",
                "state": null
              },
              "email": "[email protected]",
              "name": "Commande Test",
              "phone": null
            },
            "calculated_statement_descriptor": "MOTOCULTOR",
            "captured": true,
            "created": 1593777780,
            "currency": "eur",
            "customer": "Hidden for security",
            "description": "Motocultor Merch - Commande 14730",
            "destination": null,
            "dispute": null,
            "disputed": false,
            "failure_code": null,
            "failure_message": null,
            "fraud_details": {
            },
            "invoice": null,
            "livemode": false,
            "metadata": {
              "customer_name": "Commande Test",
              "customer_email": "[email protected]",
              "order_id": "14730"
            },
            "on_behalf_of": null,
            "order": null,
            "outcome": {
              "network_status": "approved_by_network",
              "reason": null,
              "risk_level": "normal",
              "risk_score": 35,
              "seller_message": "Payment complete.",
              "type": "authorized"
            },
            "paid": true,
            "payment_intent": "pi_1H0nbbFpQBKq4G592Npa7FQJ",
            "payment_method": "src_1H0nbTFpQBKq4G59tJOJGqXs",
            "payment_method_details": {
              "card": {
                "brand": "visa",
                "checks": {
                  "address_line1_check": "pass",
                  "address_postal_code_check": "pass",
                  "cvc_check": "pass"
                },
                "country": "US",
                "exp_month": 4,
                "exp_year": 2024,
                "fingerprint": "ynZGIzCsgYsyYEXb",
                "funding": "credit",
                "installments": null,
                "last4": "4242",
                "network": "visa",
                "three_d_secure": null,
                "wallet": null
              },
              "type": "card"
            },
            "receipt_email": null,
            "receipt_number": null,
            "receipt_url": "https://pay.stripe.com/receipts/acct_1H0l89FpQBKq4G59/ch_1H0nbcFpQBKq4G59D7YwbFgU/rcpt_HZxWzvpsidYCUVAflTztC3RexPhiZM1",
            "refunded": false,
            "refunds": {
              "object": "list",
              "data": [
              ],
              "has_more": false,
              "total_count": 0,
              "url": "/v1/charges/ch_1H0nbcFpQBKq4G59D7YwbFgU/refunds"
            },
            "review": null,
            "shipping": null,
            "source": {
              "id": "Hidden for security",
              "object": "source",
              "amount": null,
              "card": {
                "exp_month": 4,
                "exp_year": 2024,
                "last4": "4242",
                "country": "US",
                "brand": "Visa",
                "address_line1_check": "pass",
                "address_zip_check": "pass",
                "cvc_check": "pass",
                "funding": "credit",
                "fingerprint": "ynZGIzCsgYsyYEXb",
                "three_d_secure": "optional",
                "name": null,
                "tokenization_method": null,
                "dynamic_last4": null
              },
              "client_secret": "Hidden for security",
              "created": 1593777781,
              "currency": null,
              "flow": "none",
              "livemode": false,
              "metadata": {
              },
              "owner": {
                "address": {
                  "city": "Paris",
                  "country": "FR",
                  "line1": "Some random street",
                  "line2": null,
                  "postal_code": "75000",
                  "state": null
                },
                "email": "[email protected]",
                "name": "Commande Test",
                "phone": null,
                "verified_address": null,
                "verified_email": null,
                "verified_name": null,
                "verified_phone": null
              },
              "statement_descriptor": null,
              "status": "consumed",
              "type": "card",
              "usage": "reusable"
            },
            "source_transfer": null,
            "statement_descriptor": "MOTOCULTOR",
            "statement_descriptor_suffix": null,
            "status": "succeeded",
            "transfer_data": null,
            "transfer_group": null
          }
        ],
        "has_more": false,
        "total_count": 1,
        "url": "/v1/charges?payment_intent=pi_1H0nbbFpQBKq4G592Npa7FQJ"
      },
      "client_secret": Hidden for security,
      "confirmation_method": "automatic",
      "created": 1593777779,
      "currency": "eur",
      "customer": "Hidden for security",
      "description": "Motocultor Merch - Commande 14730",
      "invoice": null,
      "last_payment_error": null,
      "livemode": false,
      "metadata": {
        "customer_name": "Commande Test",
        "customer_email": "[email protected]",
        "order_id": "14730"
      },
      "next_action": null,
      "on_behalf_of": null,
      "payment_method": null,
      "payment_method_options": {
        "card": {
          "installments": null,
          "network": null,
          "request_three_d_secure": "automatic"
        }
      },
      "payment_method_types": [
        "card"
      ],
      "receipt_email": null,
      "review": null,
      "setup_future_usage": null,
      "shipping": null,
      "source": "src_1H0nbTFpQBKq4G59tJOJGqXs",
      "statement_descriptor": "MOTOCULTOR",
      "statement_descriptor_suffix": null,
      "status": "succeeded",
      "transfer_data": null,
      "transfer_group": null
    }
    • This reply was modified 4 years, 4 months ago by alexis888.
    Thread Starter alexis888

    (@alexis888)

    Anyone ?

    Plugin Support AW a11n

    (@slash1andy)

    Automattic Happiness Engineer

    Hey there!

    Sorry about the delay. There’s no need to worry about this issue. It’s the standard feature.

    WooCommerce sends level 3 data to Stripe (order meta data like products, etc.)

    If your account doesn’t accept that, for any number of reasons, it will respond with a 404 as you see, then resend without it. This is seamless to your customers and no need for alarm.

    Thread Starter alexis888

    (@alexis888)

    Hello @slash1andy, thanks for the clear answer !
    Glad I don’t have to worry about it
    cheers

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘payment_intents return 400 errors’ is closed to new replies.