Skip to content

OrderCallback curl timeout getting customerId from SP API for responseData after place order. #299

@chrismshea

Description

@chrismshea

Issue

OrderCallback response errorMessage is "cURL error 28: Operation timed out after 30001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://api.subscribepro.com/services/v2/customers.json?email=rebekah_e_white%40hotmail.com"

After the order is placed the module is building the response data, and calling the Subscribe Pro API with the customer email address to get the Subscribe Pro customer id. This is an unnecessary call since the customer id is provided in the request data. It introduces another opportunity for something to go wrong. Additionally this request occurs after the order is placed, and if it fails will trigger an additional order to be attempted thus producing multiple charges to the customer.

Request Data

{
  "timestamp": 1767711981,
  "allowSomeFailedItems": false,
  "customerId": "6598278",
  "customerEmail": "emmamfabiano@gmail.com",
  "platformCustomerId": "400703",
  "salesOrderToken": "879d24ac3b3676fafb1148af98cd1cc7",
  "shippingMethodCode": "flatrate_flatrate",
  "currency": "USD",
  "payment": {
    "paymentToken": "QFWMRGGBMZ7LGLD3",
    "paymentProfileId": 8479968,
    "paymentProfileType": "external_vault",
    "paymentMethodType": "credit_card",
    "creditcardType": "master",
    "creditcardLastDigits": "8623",
    "creditcardMonth": "4",
    "creditcardYear": "2030"
  },
  "couponCodes": [
    null
  ],
  "billingAddress": {
    "firstName": "Emma",
    "lastName": "Fabiano",
    "street1": "308 PARKERS DR",
    "street2": "308",
    "street3": "",
    "city": "PORTLAND",
    "region": "MI",
    "postcode": "48875",
    "country": "US",
    "countryName": "US",
    "phone": "(269) 509-2322"
  },
  "shippingAddress": {
    "firstName": "Emma",
    "lastName": "Fabiano",
    "street1": "308 PARKERS DR",
    "street2": "308",
    "street3": "",
    "city": "PORTLAND",
    "region": "MI",
    "postcode": "48875",
    "country": "US",
    "countryName": "US",
    "phone": "(269) 509-2322"
  },
  "shippingMethodCodes": [
    {
      "method_code": "flatrate_flatrate"
    }
  ],
  "items": [
    {
      "productSku": "00043900661452",
      "shortDescription": "BOOST VHC, Strawberry - 24 Cartons",
      "qty": "1",
      "requiresShipping": true,
      "subscription": {
        "id": 5524522,
        "interval": "30 Days",
        "scheduleName": "30 Days",
        "reorderOrdinal": 5,
        "nextOrderDate": "2026-01-06",
        "userDefinedFields": [],
        "platformSpecificFields": {
          "magento2": {
            "product_option": {
              "extension_attributes": {
                "configurable_item_options": [
                  {
                    "option_id": "216",
                    "option_value": 601
                  }
                ]
              }
            }
          }
        },
        "magento2ProductOptions": {
          "configurable_item_options": [
            {
              "option_id": "216",
              "option_value": 601
            }
          ]
        }
      }
    }
  ]
}

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions