Pass a unique ID to Square and get that ID back on response - square-connect

I am working in iOS / Objective C. I am building a JSON string and just using that to open square-commerce-v1://payment/create?data=JSON which opens the app. I can process payment and sent back to my app.
But I have a disconnect. How does my app know what transaction goes with whatever item?
For example: I rent cars. I have several cars in my inventory. I select "Car 4" and bring up the payment screen. Let the use pay and go back.
How can I send an id to square and then back to the app saying, that the payment was for "Car 4"?

You should look into notes if you want the itemization to be visible in your Square Dashboard. From Squares API documentation:
This note is included in the itemizations field of Payment objects
returned by the List Payments and Retrieve Payment endpoints.
If you are looking to do item and inventory management, or pull prices from an item, you'll need to use the Square Item APIs.

Related

Power Automate: How to get the message ID to forward an email using 'Forward an email(V2)'?

I have been trying to automate the process of forwarding an email(with teams meeting link) using Power automate.
I have attached how my flow looks currently.
User submits the form with an email address
The flow retrieves the email address
Gets the events from the calendar
Filters to get a specific series
Forwards the email
I am struggling with steps 4 and 5 to get the specific message ID for the teams meeting.
I would really appreciate it if someone could let me know of a way.
The overall flow
The expanded 4th and 5th steps:
(https://i.stack.imgur.com/DzQ6k.png)
I tried to just copy the meeting id you will get from the Microsoft teams calendar but it didn't work.
This is how my forward section looks like:
The Second Filter Array under Apply to each 3 appears from this view to be filtering to the point there are no matches. Because that appears to be the email ID and not the meeting ID. Have you considered using a Condition instead? Then you can add the Meeting ID into the body of the email in your last step.

Is it possible to link transaction line items to sale transaction in Square pos API

I understand that the Square POS API does not currently support the ability for an external app to pass itemized line items when calling Square to process the payment. Is there a way for the external app to associate the itemized details with the completed sale transaction in Square via an API after the payment is completed and square returns control to the external app?
Are there specific plans to provide support for itemized transactions within the POS API?
There's no way to formally do this currently, and there's no current timeline or guarantee that it will be released for the POS API.
It's possible to link it via the Orders API in a workaround. Basically, prior to initializing the transaction, you would call CreateOrder with the items in the order. The response would give you an Order object, which you can retrieve the order_id from. Then, you can pass in the order_id into the notes field when creating the POS API request. This would allow you to at least look up the itemization later on (by utilizing BatchRetrieveOrders) for each of the POS API transactions.
Furthermore, if you are going further and utilizing your own database, then you wouldn't even need to pass in the order_id to the note field, as you could just link the order_id and transaction_id in your own database for easy lookup later.
References:
https://docs.connect.squareup.com/more-apis/orders/overview
https://docs.connect.squareup.com/api/connect/v2#navsection-orders

Save user states between menu interactions in Telegram bot

I'm creating a trade Telegram bot and I suppose to have about 5 different menus (keyboards) to communicate with the user. On the first step I provide to user an ability to choose the exnchange to trade, after that she should choose the currency, then choose the price, then she could see another user orders etc.
From the backend view the user messages is just a text and I choose where to route the request by just analyzing that text (old school switch statement). For the first step is okay, I have only couple of exchanges so I know the user is on the first step, but when she chose the currency how could I know which exchange he had been chosen on the previous step? Of course I could use the database to save all user menus interactions, but I'm interested is there another choise exist?
Try to use InlineQuery. You can store some key parameters through the dialog with user. For example, you can store them in callback_data field, if you are using InlineKeyboard.

Retrieving Card details from Square Customer

I'm trying to create a recurring payment on Square, ala Stripe subscriptions. However, I am having trouble retrieving a customer's card information (specifically customer_card_id) to pass into Charge.
Our flow is such:
A customer visits to our store and subscribes to a membership, which we process via the point of sale app.
We continuously poll Square to retrieve payment information, and create membership records appropriately.
When the user's membership period expires, charge them for the next month's membership.
When researching RetrieveCustomer, I find that there is a cards property under Customer, but iterating through all the Customers under our account, they all have cards = None despite us having taken card payments via the point of sale app.
Also, looking at ListTransactions, there doesn't seem to be anything that might be customer_card_id. The IDs I see there are tender ID, location ID, and transaction ID. The card_fingerprint also looks promising but that doesn't seem right either, since a card can have both an ID and a fingerprint.
Am I missing something? Where might I find customer_card_id?
EDIT
Looks like I was dumb and my local instance of our application was just out of date with transactions from Square. After updating my data with customers we've processed since the last time I updated, customers with a non-None card property now show up. tristansokol's answer below is still valid however.
How do you process the first charge? You need to explicitly add the card on file, it won't be added by default from processing a transaction from a customer. See: https://squareup.com/help/us/en/article/5770-use-card-on-file-with-the-square-point-of-sale-app

Square Connect API List Payments Endpoint not showing 'Description'

In the example response for the List Payments endpoint in the Square Connect API Documentation, it shows 'Description' as a returned key, but the data I am receiving from Square does not show that key.
I have verified that the payments do have a Description attached to them (by downloading the transaction report from the Square Dashboard).
Thanks for identifying this inconsistency between the documentation and the API. The Payment object does not in fact have a description field.
However, the following fields included in a Payment object do contain merchant-specified notes about a payment (assuming the merchant provided them at the time of sale):
The payment_note field of a Payment’s tender contains a merchant-specified note about the form of tender used for the payment. This is generally present only for Tender objects with a type of OTHER.
The notes field of a PaymentItemization in a Payment contains a merchant-specified note about that particular item in the payment. Note that PaymentItemizations are only available from the Retrieve Payment endpoint (not List Payments).
The Description column of the transaction report provided by the merchant dashboard is simply a comma-separated list of the names of the items included in the payment, along with any notes for each item. The Connect API does not provide this list directly, but you can recreate it for a payment with the fields of the payment’s itemizations.

Resources