Is there an easy way to check if the 3rd party vendor's payment went through?

Hi,
I’m building a mobile web for a coffee shop (which use Square POS) that I’m working with. In the mobile website I’m creating, there will be a Square payment link button (A payment link that does it all | Square Payment Links) that users can click a button and purchase a cup of coffee.

Since I’m working with a 3rd party vendor, I won’t have access to the coffee shop’s Square API credential. In this situation, is there an easy way for me to confirm if the payment went through?

One random idea I had is utilizing Payment Link’s redirect URL feature. If redirect URL allows us to configure the URL with variables like “www.domain.com/success/{payment_id}_{item_name}”, I should be able to parse the data in the URL on our end. But I’m not sure configuring URL using variables is supported on Square UI.

Overall, I’m trying to figure out a way to verify if the payment went through without accessing the vendor’s account!

Thanks

With the links that are created with the Checkout API we won’t redirect the customer till the payment is successful. So if you get a redirect URL with an order_id in it the payment was successful.

Also you can listen for payments webhook events to be notified when a payment is successful. :slightly_smiling_face:

Thanks for the reply. I have follow up questions.

  1. So do you mean that coffee shop owner I work with can set variables like {order_id}, {item_name} in the redirect url configuration section on the payment link page?
  2. In order to listen to the webhook events, do coffer shop owner list me as a receiver on his end?
  3. I’m thinking of embedding the square’s “payment link button” in my website. When the user clicks that button, what does the user flow look like? Are they taken to the square’s payment page?

Thanks!

Ideally you shouldn’t be adding anything to the redirect_url. We recommend that you add all item to the Square order that we will generate when a link is created. Once that link is paid for on redirect we will add the Square generated order_id to the end of the URL. You can use that order_id to call RetrieveOrder to get all the order details. Here is an example of creating a link with an order.

{
    "idempotency_key": "{{$guid}}",
    "checkout_options": {
        "enable_coupon": true,
        "accepted_payment_methods": {
            "afterpay_clearpay": true,
            "apple_pay": true,
            "cash_app_pay": true,
            "google_pay": true
        },
        "allow_tipping": true,
        "ask_for_shipping_address": true,
        "custom_fields": [
            {
                "title": "Auto color"
            }
        ],
        "enable_loyalty": true,
        "merchant_support_email": "{{[email protected]}}",
        "redirect_url": "{{redirect_url}}",
        "shipping_fee": {
            "charge": {
                "amount": 100,
                "currency": "USD"
            },
            "name": "Shipping"
        }
    },
    "order": {
        "location_id": "{{location_id}}",
        "line_items": [
            {
                "name": "60,000 mile maintenance",
                "quantity": "1",
                "base_price_money": {
                    "amount": 25,
                    "currency": "USD"
                },
                "note": "1st line item note"
            },
            {
                "name": "Tire rotation and balancing",
                "quantity": "1",
                "base_price_money": {
                    "amount": 25,
                    "currency": "USD"
                }
            },
            {
                "name": "Wiper fluid replacement",
                "quantity": "1",
                "base_price_money": {
                    "amount": 25,
                    "currency": "USD"
                }
            },
            {
                "name": "Oil change",
                "quantity": "1",
                "base_price_money": {
                    "amount": 25,
                    "currency": "USD"
                }
            }
        ]
    }
}

:slightly_smiling_face:

Hi,
Just to clarify. I won’t have the API access via the coffee shop’s credential. They are asking us to make a website but we don’t necessarily have access to their credential. In this scenario, is it still possible to do what your are suggesting?

You will credentials to call the API to generate the links. :slightly_smiling_face:

Right. I wonder if there’s a workaround to confirm the payment confirmation without having access to the coffee shop owner’s square credential as we won’t :confused:

How is the link being created if you don’t have an access token for the account? Are you using the links that are created in the Dashboard? :slightly_smiling_face:

So the coffee shop owner is willing to create a link that can be embedded in a website I’m building. He will just give me a payment link! But I won’t have access to his credential so I won’t be able to access it.

Okay, with the link that they’re providing there isn’t any way to modify the redirect. It’s configured on the Square Server side and you won’t have access to modify the redirect. :slightly_smiling_face:

Right i get that. I wonder if there’s an easy way for the coffee shop owner to append variables in his Square dashboard for me so that it pings my website with parameters in the URL and I can parse it on my end. He unfortunately doesn’t know how to code so it’s gotta be simple that can be configured in Square Dashboard UI

Unfortunately that isn’t possible with the links that are generated from the Seller Dashboard. :slightly_smiling_face:

Understood! Let me ask a question from a different angle.

Option 1: Then, is there a way to get “read-only” access for certain “payment links”? Let’s say a coffee shop owner makes an one-off payment link for me. Is there a way for me to read the transaction data for that particular link? This way, the coffee shop owner may be more willing to give me access.

Option 2: I was reading about the team permission and found this particular permission. “View Checkout Link Transactions” enables Transactions permission to allow team members to view Online Checkout transactions.

I am just trying to be creative here and wonder either option may work for my needs?

If your not able to get an access token either from the seller providing it to you or the seller authorizing your application through OAuth you won’t be able to get any data from the sellers account programatically. :slightly_smiling_face: