• Resolved Shaharyar Ansari

    (@shaharyaransari2783912)


    I am testing the plugin in sandbox mode. I used test cards. The plugin is throwing this error again and again:
    An error occurred, please try again or try an alternate form of payment.
    Any Solution?

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

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Support Abhi G. a11n

    (@theabhig)

    Hi @shaharyaransari2783912

    I was able to replicate the error on the site https://multigonflables.com/

    To help troubleshoot this further, please enable ‘Log debug messages’ in your Square settings from WooCommerce > Settings > Square:


    Link to image: https://d.pr/i/W3VR5M

    When enabled, only events that happen after the point of being enabled are logged.

    Please proceed to attempt another test order.

    Logs will then appear under _WooCommerce > Status > Logs_. Use the dropdown menu to select, and view.

    The log will be titled in the same format as other WooCommerce plugin log files with square in the title.

    Once done, please paste the logs in your reply here, removing any private or sensitive information.

    Once we have reviewed the logs, we’ll be able to advise further on next steps to resolve this.

    Thanks!

    Thread Starter Shaharyar Ansari

    (@shaharyaransari2783912)

    Thanks For response Just give me a minute… I will paste logs here…

    Thread Starter Shaharyar Ansari

    (@shaharyaransari2783912)

    06-06-2021 @ 20:36:13 – Getting Google API Access Token…
    06-06-2021 @ 20:36:13 – Failed to retrieve and generate the Access Token
    06-06-2021 @ 20:36:13 – Error while synchronizing the booking #4381: Array
    (
    [headers] => Requests_Utility_CaseInsensitiveDictionary Object
    (
    [data:protected] => Array
    (
    [www-authenticate] => Bearer realm=”https://accounts.google.com/”
    [vary] => Array
    (
    [0] => Origin
    [1] => X-Origin
    [2] => Referer
    )

    [content-type] => application/json; charset=UTF-8
    [date] => Sun, 06 Jun 2021 20:36:13 GMT
    [server] => ESF
    [content-length] => 509
    [x-xss-protection] => 0
    [x-frame-options] => SAMEORIGIN
    [x-content-type-options] => nosniff
    [alt-svc] => h3-29=”:443″; ma=2592000,h3-T051=”:443″; ma=2592000,h3-Q050=”:443″; ma=2592000,h3-Q046=”:443″; ma=2592000,h3-Q043=”:443″; ma=2592000,quic=”:443″; ma=2592000; v=”46,43″
    )

    )

    [body] => {
    “error”: {
    “code”: 401,
    “message”: “Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.”,
    “errors”: [
    {
    “message”: “Login Required.”,
    “domain”: “global”,
    “reason”: “required”,
    “location”: “Authorization”,
    “locationType”: “header”
    }
    ],
    “status”: “UNAUTHENTICATED”
    }
    }

    [response] => Array
    (
    [code] => 401
    [message] => Unauthorized
    )

    [cookies] => Array
    (
    )

    [filename] =>
    [http_response] => WP_HTTP_Requests_Response Object
    (
    [response:protected] => Requests_Response Object
    (
    [body] => {
    "error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "errors": [
    {
    "message": "Login Required.",
    "domain": "global",
    "reason": "required",
    "location": "Authorization",
    "locationType": "header"
    }
    ],
    "status": "UNAUTHENTICATED"
    }
    }

    [raw] => HTTP/1.1 401 Unauthorized
    WWW-Authenticate: Bearer realm="https://accounts.google.com/"
    Vary: Origin
    Vary: X-Origin
    Vary: Referer
    Content-Type: application/json; charset=UTF-8
    Date: Sun, 06 Jun 2021 20:36:13 GMT
    Server: ESF
    Content-Length: 509
    X-XSS-Protection: 0
    X-Frame-Options: SAMEORIGIN
    X-Content-Type-Options: nosniff
    Alt-Svc: h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
    Connection: close

    {
    "error": {
    "code": 401,
    "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.",
    "errors": [
    {
    "message": "Login Required.",
    "domain": "global",
    "reason": "required",
    "location": "Authorization",
    "locationType": "header"
    }
    ],
    "status": "UNAUTHENTICATED"
    }
    }

    [headers] => Requests_Response_Headers Object
    (
    [data:protected] => Array
    (
    [www-authenticate] => Array
    (
    [0] => Bearer realm="https://accounts.google.com/"
    )

    [vary] => Array
    (
    [0] => Origin
    [1] => X-Origin
    [2] => Referer
    )

    [content-type] => Array
    (
    [0] => application/json; charset=UTF-8
    )

    [date] => Array
    (
    [0] => Sun, 06 Jun 2021 20:36:13 GMT
    )

    [server] => Array
    (
    [0] => ESF
    )

    [content-length] => Array
    (
    [0] => 509
    )

    [x-xss-protection] => Array
    (
    [0] => 0
    )

    [x-frame-options] => Array
    (
    [0] => SAMEORIGIN
    )

    [x-content-type-options] => Array
    (
    [0] => nosniff
    )

    [alt-svc] => Array
    (
    [0] => h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"
    )

    )

    )

    [status_code] => 401
    [protocol_version] => 1.1
    [success] =>
    [redirects] => 0
    [url] => https://www.googleapis.com/calendar/v3/calendars//events
    [history] => Array
    (
    )

    [cookies] => Requests_Cookie_Jar Object
    (
    [cookies:protected] => Array
    (
    )

    )

    )

    [filename:protected] =>
    [data] =>
    [headers] =>
    [status] =>
    )

    )

    corsonr

    (@corsonr)

    Automattic Happiness Engineer

    Hi @shaharyaransari2783912,

    Thanks for the log, however it doesn’t look like a Square logs, but rather a Google related log. Can you please try to find the Square log from **WP Admin → WooCommerce → Status → Logs** and choose the right one from the dropdown select to the top right? Thanks

    Thread Starter Shaharyar Ansari

    (@shaharyaransari2783912)

    Here you go:

    06-07-2021 @ 08:02:53 - Request
    Request
    method:
    uri: listLocationsWithHttpInfo
    user-agent: WooCommerce-Square/2.5.1 (WooCommerce/5.3.0; WordPress/5.7.2)
    headers: Array
    (
    )
    body:
    duration: 1.33027s
    
    06-07-2021 @ 08:02:53 - Response
    Response
    code: 200
    message:
    headers: Array
    (
        [0] => HTTP/2 200
        [content-type] => application/json
        [square-version] => 2019-08-14
        [vary] => Origin, Accept-Encoding
        [x-content-type-options] => nosniff
        [x-download-options] => noopen
        [x-frame-options] => SAMEORIGIN
        [x-permitted-cross-domain-policies] => none
        [x-xss-protection] => 1; mode=block
        [date] => Mon, 07 Jun 2021 08:02:53 GMT
        [content-length] => 503
        [strict-transport-security] => max-age=631152000; includeSubDomains; preload
    )
    body: {
        "locations": [
            {
                "id": "L5THBEN22CHC6",
                "name": "Default Test Account",
                "address": {
                    "address_line_1": "80 Wellington St",
                    "locality": "Ottawa",
                    "administrative_district_level_1": "ON",
                    "postal_code": "K1A 0A2",
                    "country": "CA"
                },
                "timezone": "UTC",
                "capabilities": [
                    "CREDIT_CARD_PROCESSING"
                ],
                "status": "ACTIVE",
                "created_at": "2021-06-01T20:41:55Z",
                "merchant_id": "ML2RQRXJGJH7M",
                "country": "CA",
                "language_code": "en-CA",
                "currency": "CAD",
                "business_name": "Default Test Account",
                "type": "PHYSICAL",
                "business_hours": {}
            }
        ]
    }
    mother.of.code

    (@imazed)

    The Mother of Code

    Hi again,

    Thanks for sending that over! It shows that the request to Square is actually successful, so that makes me wonder whether this is actually a conflict test. We’ve seen some cases where custom checkout fields were the underlying problem, I’d like to rule that out.
    ?
    The best way to determine this is to:

    • Temporarily switch your theme to Storefront
    • Disable all plugins except for WooCommerce
    • Repeat the action that is causing the problem

    If you’re not seeing the same problem after completing the conflict test, then you know the problem was with the plugins and/or theme you deactivated. To figure out which plugin is causing the problem, reactivate your other plugins one by one, testing after each, until you find the one causing conflict. You can find a more detailed explanation on how to do a conflict test here.

    Hello Support

    I am using:

    Square payment gateway with Woocommerce & partial payment plugin.

    Order placed well but when I try to pay remaining partial payment i got same error message. I want let you know that it was working before.
    Here is log:

    06-08-2021 @ 18:13:23 - Manually disconnected
    06-08-2021 @ 18:14:34 - Access token successfully received.
    06-08-2021 @ 18:14:34 - Refresh token successfully received.
    06-08-2021 @ 18:14:35 - Request
    Request
    method:
    uri: listCustomersWithHttpInfo
    user-agent: WooCommerce-Square/2.5.1 (WooCommerce/5.2.2; WordPress/5.7.2)
    headers: Array
    (
    )
    body:
    duration: 0.55412s
    
    06-08-2021 @ 18:14:35 - Response
    Response
    code: 200
    message:
    headers: Array
    (
        [0] => HTTP/2 200
        [date] => Tue, 08 Jun 2021 18:14:35 GMT
        [frame-options] => DENY
        [x-frame-options] => DENY
        [x-content-type-options] => nosniff
        [x-xss-protection] => 1; mode=block
        [content-type] => application/json
        [square-version] => 2019-08-14
        [squareup--connect--v2--common--versionmetadata-bin] => CgoyMDE5LTA4LTE0
        [vary] => Accept-Encoding, User-Agent
        [content-length] => 1124
        [strict-transport-security] => max-age=631152000; includeSubDomains; preload
    )
    body: {
        "customers": [
            {
                "id": "Y3ZT5Q0Q40Z6ZFFAF96X93PP9M",
                "created_at": "2021-03-20T18:11:11.964Z",
                "updated_at": "2021-03-20T18:11:11Z",
                "cards": [
                    {
                        "id": "ccof:cKIT8ATrQZ9jxzOy4GB",
                        "card_brand": "*****",
                        "last_4": "****",
                        "exp_month": 9,
                        "exp_year": ****,
                        "cardholder_name": "**********",
                        "billing_address": {
                            "address_line_1": "********",
                            "address_line_2": "********",
                            "locality": "Oak Park",
                            "administrative_district_level_1": "NY",
                            "postal_code": "60301",
                            "country": "US"
                        }
                    }
                ],
                "given_name": "********",
                "family_name": "**********",
                "company_name": "**********",
                "email_address": "*************",
                "address": {
                    "address_line_1": "*********",
                    "address_line_2": "Suite *****",
                    "locality": "****",
                    "administrative_district_level_1": "NY",
                    "postal_code": "60301",
                    "country": "US"
                },
                "phone_number": "**********",
                "reference_id": "1",
                "preferences": {
                    "email_unsubscribed": false
                },
                "groups": [
                    {
                        "id": "ML638M57GGBFX.CARDS_ON_FILE",
                        "name": "Cards on File"
                    },
                    {
                        "id": "gv2:4902QXXTN50KS1464B4Q9C5AD4",
                        "name": "Email Subscribers"
                    }
                ],
                "creation_source": "THIRD_PARTY"
            }
        ]
    }
    Plugin Support Aashik P – a11n

    (@aashik)

    Order placed well but when I try to pay remaining partial payment i got same error message.

    Thank you for getting back to us with the logs. From what I see, the initial payment itself, and any other orders that are not a payment for the remaining amount set up via partial payments plugin is working without any issue. Is that correct?

    Basically, we’d like to know if this can be replicated with just WooCommerce and Square as the active plugins on the site, and when you attempt to pay for a new order.

    If the problem is only linked to a different plugin you use for partial payments, the best way forward here would be to reach out to the plugin developers directly.

    Alternatively, you can make use of WooCommerce Deposits that doesn’t depend on a payment gateway to test if that works for you.

    For any pre-sales questions on that, please open a support request at https://woocommerce.com/contact-us/#sales-form

    HI @aashik thank you for your response.

    Let me explain here again in detailed.

    We are using latest version of WooCOmmerce, WordPress and payment gateway SQUATE with Woocommerce deposite-partial payment plugin.

    All new orders & payments are working fine, worth to mention we are using all orders with partial payments.

    When when customer try to pay remaining payment we got error “An error occurred, please try again or try an alternate form of payment”

    https://staging6.ganjavacations.net/

    Here is recent logs:

    06-14-2021 @ 06:50:41 - Request
    Request
    method:
    uri: listLocationsWithHttpInfo
    user-agent: WooCommerce-Square/2.5.1 (WooCommerce/5.4.1; WordPress/5.7.2)
    headers: Array
    (
    )
    body:
    duration: 0.3297s
    
    06-14-2021 @ 06:50:41 - Response
    Response
    code: 200
    message:
    headers: Array
    (
        [0] => HTTP/2 200
        [content-type] => application/json
        [square-version] => 2019-08-14
        [vary] => Origin, Accept-Encoding
        [x-content-type-options] => nosniff
        [x-download-options] => noopen
        [x-frame-options] => SAMEORIGIN
        [x-permitted-cross-domain-policies] => none
        [x-xss-protection] => 1; mode=block
        [date] => Mon, 14 Jun 2021 06:50:41 GMT
        [content-length] => 513
        [strict-transport-security] => max-age=631152000; includeSubDomains; preload
    )
    body: {
        "locations": [
            {
                "id": "LQ236JHNTWZS9",
                "name": "Default Test Account",
                "address": {
                    "address_line_1": "1600 Pennsylvania Ave NW",
                    "locality": "Washington",
                    "administrative_district_level_1": "DC",
                    "postal_code": "20500",
                    "country": "US"
                },
                "timezone": "UTC",
                "capabilities": [
                    "CREDIT_CARD_PROCESSING"
                ],
                "status": "ACTIVE",
                "created_at": "2021-03-16T05:04:11Z",
                "merchant_id": "ML7XXMDB8FD31",
                "country": "US",
                "language_code": "en-US",
                "currency": "USD",
                "business_name": "Default Test Account",
                "type": "PHYSICAL",
                "business_hours": {}
            }
        ]
    }
    
    06-14-2021 @ 06:50:47 - Request
    Request
    method:
    uri: listLocationsWithHttpInfo
    user-agent: WooCommerce-Square/2.5.1 (WooCommerce/5.4.1; WordPress/5.7.2)
    headers: Array
    (
    )
    body:
    duration: 0.32911s
    
    06-14-2021 @ 06:50:47 - Response
    Response
    code: 200
    message:
    headers: Array
    (
        [0] => HTTP/2 200
        [content-type] => application/json
        [square-version] => 2019-08-14
        [vary] => Origin, Accept-Encoding
        [x-content-type-options] => nosniff
        [x-download-options] => noopen
        [x-frame-options] => SAMEORIGIN
        [x-permitted-cross-domain-policies] => none
        [x-xss-protection] => 1; mode=block
        [date] => Mon, 14 Jun 2021 06:50:47 GMT
        [content-length] => 513
        [strict-transport-security] => max-age=631152000; includeSubDomains; preload
    )
    body: {
        "locations": [
            {
                "id": "LQ236JHNTWZS9",
                "name": "Default Test Account",
                "address": {
                    "address_line_1": "1600 Pennsylvania Ave NW",
                    "locality": "Washington",
                    "administrative_district_level_1": "DC",
                    "postal_code": "20500",
                    "country": "US"
                },
                "timezone": "UTC",
                "capabilities": [
                    "CREDIT_CARD_PROCESSING"
                ],
                "status": "ACTIVE",
                "created_at": "2021-03-16T05:04:11Z",
                "merchant_id": "ML7XXMDB8FD31",
                "country": "US",
                "language_code": "en-US",
                "currency": "USD",
                "business_name": "Default Test Account",
                "type": "PHYSICAL",
                "business_hours": {}
            }
        ]
    }
    Plugin Support Aashik P – a11n

    (@aashik)

    Hi there!

    `We are using latest version of WooCOmmerce, WordPress and payment gateway SQUATE with Woocommerce deposite-partial payment plugin.

    All new orders & payments are working fine, worth to mention we are using all orders with partial payments.

    When when customer try to pay remaining payment we got error “An error occurred, please try again or try an alternate form of payment”`

    Thank you for clarifying this for us. I understand you’re only selling products with partial payments, but we want to know what happens if you set up an environment with just WooCommerce and WooCommerce Square without the partial payment plugin.

    We’re asking because the Square extension does not promise compatibility with the plugin, and if the issue is only with partial payments, the best way forward would be to reach out to the plugin developers for that partial payments plugin directly.

    If they can’t help with that, then the best alternative would be to use a plugin that works with Square.

    Thank you for your understanding.

    Hi @aashik Thanks again for your help.

    I it is resolved now and error due to older version of WC Deposit plugin. Now we upgrade this plugin to latest one and everything working fine.

    Thank again.

    Plugin Support Aashik P – a11n

    (@aashik)

    Hi there!

    I it is resolved now and error due to older version of WC Deposit plugin. Now we upgrade this plugin to latest one and everything working fine.

    That’s great to hear! Thanks for letting us know.

    I’ll mark this topic as solved for now. Please feel free to open a new topic if you have any other questions.

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Error: An error occurred, please try again or try an alternate form of payment.’ is closed to new replies.