Dear Team,
The background of this topic is related to below topic:
When we did troubleshooting for the topic mentioned in above post, we noticed for the success payment (around UTC 2023-12-03 02:42, payment id: RaBQUtmSBdniWwGICMN17U3Rr2XZY), the response com.squareup.square.models.Payment gave different customer id between toString() and json serialization
The payment flow in our application is as below for the success payment :
- create a customer in square
- add a card to the customer in square
- make a card on file payment with customer id and card id through java sdk
- log out the success payment from square (com.squareup.square.models.Payment, toString())
- serialize the same success payment from square (com.squareup.square.models.Payment, as json string through jackson) and save into DB
- delete card and customer in square (for information security purpose)
above 3. ~ 6. are done in the same API call to our application, which means they are in the same java thread in our application
at Step 4. , we got customer id Z156PTX2XWGEX0ARY6567JET4G from toString() method, which is the same one created at Step 1, it’s logged out to our log file, but can’t be found in square now, as it’s deleted already at Step6.
at Step 5. , we got a different customer id DPC8WF163FJVC026M8NYZBCKNG from jackson serialization; as confirmed in our log file, i believe it’s not created by our application, but it can be found in square, square API shows this customer as “INSTANT_PROFILE”.
we are confused why jackson serialization gave a different customer id, any advice is appreciated.
Thanks.