weareseeed / react-square-web-payments-sdk

Easily create PCI-compliant inputs to accept payments online with the Square Payments API. It supports the following payment methods: credit and debit cards, ACH bank transfers, Apple Pay, Google Pay, Gift Cards and Afterpay/Clearpay.
https://react-square-payments.weareseeed.com/
MIT License
38 stars 41 forks source link

Square Up not working in Production #45

Closed priyak-sdei closed 2 years ago

priyak-sdei commented 2 years ago

What version of React are you using?

17.0.2

What version of Node.js are you using?

17.3.0

What browser are you using?

Chrome

What operating system are you using?

macOS

How are you deploying your application?

Other

Describe the Bug

This worked well when using sandbox credentials for square, however upon trying to move over to production credentials I am getting the following error and the form does not render.

Getting 401 error in console GET https://pci-connect.squareup.com/payments/hydrate?applicationId=sq0idp-EresRbLbMTgKRAuhD5ScNEA&hostname=mamalift-web.curiodigitaltx.com&locationId=LR3OMWYVRCMX8 401

InternalHttpError: Request not authorized. Screenshot 2022-04-06 at 6 43 41 PM

Expected Behavior

Production should work fine as applicationId and locationId are correct one.

To Reproduce

User production keys and form not showing

priyak-sdei commented 2 years ago

Also tried adding

in index.html but still not work.

Also using latest plugin version 2.5.0

danestves commented 2 years ago

Square is giving you this error:

{
  "errors": [
    {
      "category": "INVALID_REQUEST_ERROR",
      "code": "INVALID_VALUE",
      "detail": "Provided value for `applicationId` is invalid.",
      "field": "applicationId"
    }
  ]
}

I think you need to check that the applicationId is correct, that is a direct problem of your applicationId and not the wrapper

danestves commented 2 years ago

I'm closing this issue since there is no activity