square / square-nodejs-sdk

Other
89 stars 40 forks source link

Bug with 'Square-Version': '2023-05-17' creating a gift card #131

Closed doron2402 closed 1 year ago

doron2402 commented 1 year ago

Describe the bug I'm trying to create a gift card and I'm getting 5xx the first time, if I'll make the same call again I'll get 200 and the gift card is created.

Expected behavior It should create the gift card on the first time we're making the call via Axios or the Square nodejs SDK.

....
    const {
      result: { giftCard },
    } = await this.client.giftCardsApi.createGiftCard({
      giftCard: {
        type: 'DIGITAL',
        customerIds: [customerId],
      },
      locationId: location.id,
      idempotencyKey: crypto.randomUUID(),
    })

    await this.client.giftCardsApi.linkCustomerToGiftCard(giftCard.id, {
      customerId,
    })

To Reproduce Steps to reproduce the bug:

  1. Create a gift card using Square SDK createGiftCard

Screenshots See screenshot below, same request, first time 5xx second time 2xx

Screenshot 2023-06-01 at 10 38 05 PM

Square SDK version 27.x

Additional context I believe it's Square's API who is having issue since we're getting 5xx and not 4xx.

zenmasterjobo commented 1 year ago

Hi @doron2402

If you suspect there is problem with the API you can check https://www.issquareup.com/ to see.

Looks like there was an incident surrounding Gift Cards starting May 31 - June 1 during maintenance https://www.issquareup.com/incidents/c8qsd3npq5gf

I have gone ahead and tried to repro this issue myself today, but looks like the API and SDK are functioning as expected.

In the future for errors that you find that are not issues with SDK, please consider posting on our developer forums

Thanks, hope you have great weekend 😄

doron2402 commented 1 year ago

Yeah the issue has been fixed Glad you guys figured it out