Payment Created Webhook Multiple Triggers

This is what is the payloads passed from the webhook

----------------------------------------
Debug 12-27-21 10:30:48: response
Debug 12-27-21 10:30:48: WP_REST_Response Object
(
    [links:protected] => Array
        (
        )

    [matched_route:protected] => 
    [matched_handler:protected] => 
    [data] => Array
        (
            [status] => 200
            [response] => success
        )

    [headers] => Array
        (
        )

    [status] => 200
)

Debug 12-27-21 10:30:50: Array
(
    [type] => payment
    [id] => rRkZvGxT8qSrNi7WHn7BINfNhsKZY
    [object] => Array
        (
            [payment] => Array
                (
                    [amount_money] => Array
                        (
                            [amount] => 10001
                            [currency] => USD
                        )

                    [application_details] => Array
                        (
                            [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                            [square_product] => VIRTUAL_TERMINAL
                        )

                    [capabilities] => Array
                        (
                            [0] => EDIT_AMOUNT_UP
                            [1] => EDIT_AMOUNT_DOWN
                            [2] => EDIT_TIP_AMOUNT_UP
                            [3] => EDIT_TIP_AMOUNT_DOWN
                        )

                    [cash_details] => Array
                        (
                            [buyer_supplied_money] => Array
                                (
                                    [amount] => 10001
                                    [currency] => USD
                                )

                            [change_back_money] => Array
                                (
                                    [amount] => 0
                                    [currency] => USD
                                )

                        )

                    [created_at] => 2021-12-27T22:30:47.868Z
                    [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                    [employee_id] => TM-eYN4faAVNnf_D
                    [id] => rRkZvGxT8qSrNi7WHn7BINfNhsKZY
                    [location_id] => L2KEJWT3XZW30
                    [note] => 
                    [order_id] => eOijp0SHEupB9Isez6J6hEgnARPZY
                    [receipt_number] => rRkZ
                    [receipt_url] => https://squareupsandbox.com/receipt/preview/rRkZvGxT8qSrNi7WHn7BINfNhsKZY
                    [source_type] => CASH
                    [status] => COMPLETED
                    [team_member_id] => TM-eYN4faAVNnf_D
                    [total_money] => Array
                        (
                            [amount] => 10001
                            [currency] => USD
                        )

                    [version] => 1
                )

        )

)

Debug 12-27-21 10:30:50: response
Debug 12-27-21 10:30:50: WP_REST_Response Object
(
    [links:protected] => Array
        (
        )

    [matched_route:protected] => 
    [matched_handler:protected] => 
    [data] => Array
        (
            [status] => 200
            [response] => success
        )

    [headers] => Array
        (
        )

    [status] => 200
)

Debug 12-27-21 10:32:50: Array
(
    [type] => payment
    [id] => rRkZvGxT8qSrNi7WHn7BINfNhsKZY
    [object] => Array
        (
            [payment] => Array
                (
                    [amount_money] => Array
                        (
                            [amount] => 10001
                            [currency] => USD
                        )

                    [application_details] => Array
                        (
                            [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                            [square_product] => VIRTUAL_TERMINAL
                        )

                    [capabilities] => Array
                        (
                            [0] => EDIT_AMOUNT_UP
                            [1] => EDIT_AMOUNT_DOWN
                            [2] => EDIT_TIP_AMOUNT_UP
                            [3] => EDIT_TIP_AMOUNT_DOWN
                        )

                    [cash_details] => Array
                        (
                            [buyer_supplied_money] => Array
                                (
                                    [amount] => 10001
                                    [currency] => USD
                                )

                            [change_back_money] => Array
                                (
                                    [amount] => 0
                                    [currency] => USD
                                )

                        )

                    [created_at] => 2021-12-27T22:30:47.868Z
                    [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                    [employee_id] => TM-eYN4faAVNnf_D
                    [id] => rRkZvGxT8qSrNi7WHn7BINfNhsKZY
                    [location_id] => L2KEJWT3XZW30
                    [note] => 
                    [order_id] => eOijp0SHEupB9Isez6J6hEgnARPZY
                    [receipt_number] => rRkZ
                    [receipt_url] => https://squareupsandbox.com/receipt/preview/rRkZvGxT8qSrNi7WHn7BINfNhsKZY
                    [source_type] => CASH
                    [status] => COMPLETED
                    [team_member_id] => TM-eYN4faAVNnf_D
                    [total_money] => Array
                        (
                            [amount] => 10001
                            [currency] => USD
                        )

                    [version] => 1
                )

        )

)

Debug 12-27-21 10:32:50: response
Debug 12-27-21 10:32:50: WP_REST_Response Object
(
    [links:protected] => Array
        (
        )

    [matched_route:protected] => 
    [matched_handler:protected] => 
    [data] => Array
        (
            [status] => 200
            [response] => success
        )

    [headers] => Array
        (
        )

    [status] => 200
)


Looking at the logs there were only 3 payment webhooks sent for this particular payment. One payment.created and two payment.updated events. Also looking at your application I see your no longer subscribed to payment events in sandbox. Are you going to use different webhook events?

I’m looking at the account, it shows I am subscribed to payments.updated. I filtered out any payloads that aren’t status of completed, so if it shows you 3, do you also see 2 payment completed minutes apart?

I’m not seeing a subscription to payments.updated for the application sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg. Is that the Application Id you’re using?

Not sure where that one came from, this is the sandbox application I’m using.
sandbox-sq0idb-lr49S40nJMMsTyTzkOj3sg

Okay, I see the subscription now. Got that applicationId from the example code you provided above.

I see the first payment.created then two seconds later the first payment.updated and then two minutes later the final payment.updated. Total of three events with is expected. :slightly_smiling_face:

Ok, but why is the one 2 minutes later expected? It’s exactly the same payload, except for the event id. I’m using this hook to trigger inventory updates, so if completed is passed twice it’ll remove double the inventory. The only way I see to filter this out it to store a flag to detect if it’s already fired in the database, but that just seems unnecessary.

Is this only for that payment? I can’t seem to replicate the 3rd webhook being triggered.

I’m confused, you said you saw the payment.created (which I filter out in my code) and two payment.updated (which are the two I posted).

Right, I see the logs for them however when I test I get the payment.created and only one payment.updated. I don’t receive a 2nd payment.updated. That’s what’s puzzling. I expect a 2nd payment.updated event if its a card payment but these are cash. Wondering if you’re getting two payment.updated events for every Virtual Terminal payment? :confused:

How would that happen, is that something on your side you need to fix?

Actually card looks like it’s doing the same thing.

Debug 12-29-21 01:23:24: Array
(
    [merchant_id] => MLSDRFTT73W7B
    [type] => payment.updated
    [event_id] => 402c60f9-ffa8-4930-9d3f-bd9b3249c300
    [created_at] => 2021-12-29T01:23:22.966Z
    [data] => Array
        (
            [type] => payment
            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
            [object] => Array
                (
                    [payment] => Array
                        (
                            [amount_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [application_details] => Array
                                (
                                    [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                                    [square_product] => VIRTUAL_TERMINAL
                                )

                            [approved_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [card_details] => Array
                                (
                                    [avs_status] => AVS_ACCEPTED
                                    [card] => Array
                                        (
                                            [bin] => 411111
                                            [card_brand] => VISA
                                            [card_type] => CREDIT
                                            [exp_month] => 10
                                            [exp_year] => 2025
                                            [fingerprint] => sq-1-EV3l_IPimnt__iiXkfAPq6bnqXCUtzJhGb8_Pd-XWMu06dqMRiX-tkOouQlhOibnzQ
                                            [last_4] => 1111
                                            [prepaid_type] => NOT_PREPAID
                                        )

                                    [card_payment_timeline] => Array
                                        (
                                            [authorized_at] => 2021-12-29T01:23:21.993Z
                                            [captured_at] => 2021-12-29T01:23:22.068Z
                                        )

                                    [cvv_status] => CVV_REJECTED
                                    [entry_method] => KEYED
                                    [statement_description] => SQ *DEFAULT TEST ACCOUNT
                                    [status] => CAPTURED
                                )

                            [created_at] => 2021-12-29T01:23:21.879Z
                            [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                            [delay_action] => CANCEL
                            [delay_duration] => PT168H
                            [delayed_until] => 2022-01-05T01:23:21.879Z
                            [employee_id] => TM-eYN4faAVNnf_D
                            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [location_id] => L2KEJWT3XZW30
                            [order_id] => mMV8ip6oRBcD0cdOOyoUwd2XwFJZY
                            [receipt_number] => DtsL
                            [receipt_url] => https://squareupsandbox.com/receipt/preview/DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [source_type] => CARD
                            [status] => COMPLETED
                            [team_member_id] => TM-eYN4faAVNnf_D
                            [total_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [updated_at] => 2021-12-29T01:23:22.963Z
                            [version] => 2
                        )

                )

        )

)

Debug 12-29-21 01:23:25: Array
(
    [merchant_id] => MLSDRFTT73W7B
    [type] => payment.updated
    [event_id] => 7fb2bc19-cb31-4442-b60a-db164219c4ff
    [created_at] => 2021-12-29T01:23:22.966Z
    [data] => Array
        (
            [type] => payment
            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
            [object] => Array
                (
                    [payment] => Array
                        (
                            [amount_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [application_details] => Array
                                (
                                    [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                                    [square_product] => VIRTUAL_TERMINAL
                                )

                            [approved_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [card_details] => Array
                                (
                                    [avs_status] => AVS_ACCEPTED
                                    [card] => Array
                                        (
                                            [bin] => 411111
                                            [card_brand] => VISA
                                            [card_type] => CREDIT
                                            [exp_month] => 10
                                            [exp_year] => 2025
                                            [fingerprint] => sq-1-EV3l_IPimnt__iiXkfAPq6bnqXCUtzJhGb8_Pd-XWMu06dqMRiX-tkOouQlhOibnzQ
                                            [last_4] => 1111
                                            [prepaid_type] => NOT_PREPAID
                                        )

                                    [card_payment_timeline] => Array
                                        (
                                            [authorized_at] => 2021-12-29T01:23:21.993Z
                                            [captured_at] => 2021-12-29T01:23:22.068Z
                                        )

                                    [cvv_status] => CVV_REJECTED
                                    [entry_method] => KEYED
                                    [statement_description] => SQ *DEFAULT TEST ACCOUNT
                                    [status] => CAPTURED
                                )

                            [created_at] => 2021-12-29T01:23:21.879Z
                            [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                            [delay_action] => CANCEL
                            [delay_duration] => PT168H
                            [delayed_until] => 2022-01-05T01:23:21.879Z
                            [employee_id] => TM-eYN4faAVNnf_D
                            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [location_id] => L2KEJWT3XZW30
                            [order_id] => mMV8ip6oRBcD0cdOOyoUwd2XwFJZY
                            [receipt_number] => DtsL
                            [receipt_url] => https://squareupsandbox.com/receipt/preview/DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [source_type] => CARD
                            [status] => COMPLETED
                            [team_member_id] => TM-eYN4faAVNnf_D
                            [total_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [updated_at] => 2021-12-29T01:23:22.963Z
                            [version] => 2
                        )

                )

        )

)

Debug 12-29-21 01:23:28: Array
(
    [merchant_id] => MLSDRFTT73W7B
    [type] => payment.updated
    [event_id] => 7194ffd5-aa3e-4d37-a3ac-4140d95c94f8
    [created_at] => 2021-12-29T01:23:27.684Z
    [data] => Array
        (
            [type] => payment
            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
            [object] => Array
                (
                    [payment] => Array
                        (
                            [amount_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [application_details] => Array
                                (
                                    [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                                    [square_product] => VIRTUAL_TERMINAL
                                )

                            [approved_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [card_details] => Array
                                (
                                    [avs_status] => AVS_ACCEPTED
                                    [card] => Array
                                        (
                                            [bin] => 411111
                                            [card_brand] => VISA
                                            [card_type] => CREDIT
                                            [exp_month] => 10
                                            [exp_year] => 2025
                                            [fingerprint] => sq-1-EV3l_IPimnt__iiXkfAPq6bnqXCUtzJhGb8_Pd-XWMu06dqMRiX-tkOouQlhOibnzQ
                                            [last_4] => 1111
                                            [prepaid_type] => NOT_PREPAID
                                        )

                                    [card_payment_timeline] => Array
                                        (
                                            [authorized_at] => 2021-12-29T01:23:21.993Z
                                            [captured_at] => 2021-12-29T01:23:22.068Z
                                        )

                                    [cvv_status] => CVV_REJECTED
                                    [entry_method] => KEYED
                                    [statement_description] => SQ *DEFAULT TEST ACCOUNT
                                    [status] => CAPTURED
                                )

                            [created_at] => 2021-12-29T01:23:21.879Z
                            [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                            [delay_action] => CANCEL
                            [delay_duration] => PT168H
                            [delayed_until] => 2022-01-05T01:23:21.879Z
                            [employee_id] => TM-eYN4faAVNnf_D
                            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [location_id] => L2KEJWT3XZW30
                            [order_id] => mMV8ip6oRBcD0cdOOyoUwd2XwFJZY
                            [processing_fee] => Array
                                (
                                    [0] => Array
                                        (
                                            [amount_money] => Array
                                                (
                                                    [amount] => 722
                                                    [currency] => USD
                                                )

                                            [effective_at] => 2021-12-29T03:23:22.000Z
                                            [type] => INITIAL
                                        )

                                )

                            [receipt_number] => DtsL
                            [receipt_url] => https://squareupsandbox.com/receipt/preview/DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [source_type] => CARD
                            [status] => COMPLETED
                            [team_member_id] => TM-eYN4faAVNnf_D
                            [total_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [updated_at] => 2021-12-29T01:23:22.963Z
                            [version] => 3
                        )

                )

        )

)

Debug 12-29-21 01:23:29: Array
(
    [merchant_id] => MLSDRFTT73W7B
    [type] => payment.updated
    [event_id] => 2f777b50-0847-4ae4-80f3-bc2ac857fea7
    [created_at] => 2021-12-29T01:23:27.684Z
    [data] => Array
        (
            [type] => payment
            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
            [object] => Array
                (
                    [payment] => Array
                        (
                            [amount_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [application_details] => Array
                                (
                                    [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                                    [square_product] => VIRTUAL_TERMINAL
                                )

                            [approved_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [card_details] => Array
                                (
                                    [avs_status] => AVS_ACCEPTED
                                    [card] => Array
                                        (
                                            [bin] => 411111
                                            [card_brand] => VISA
                                            [card_type] => CREDIT
                                            [exp_month] => 10
                                            [exp_year] => 2025
                                            [fingerprint] => sq-1-EV3l_IPimnt__iiXkfAPq6bnqXCUtzJhGb8_Pd-XWMu06dqMRiX-tkOouQlhOibnzQ
                                            [last_4] => 1111
                                            [prepaid_type] => NOT_PREPAID
                                        )

                                    [card_payment_timeline] => Array
                                        (
                                            [authorized_at] => 2021-12-29T01:23:21.993Z
                                            [captured_at] => 2021-12-29T01:23:22.068Z
                                        )

                                    [cvv_status] => CVV_REJECTED
                                    [entry_method] => KEYED
                                    [statement_description] => SQ *DEFAULT TEST ACCOUNT
                                    [status] => CAPTURED
                                )

                            [created_at] => 2021-12-29T01:23:21.879Z
                            [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                            [delay_action] => CANCEL
                            [delay_duration] => PT168H
                            [delayed_until] => 2022-01-05T01:23:21.879Z
                            [employee_id] => TM-eYN4faAVNnf_D
                            [id] => DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [location_id] => L2KEJWT3XZW30
                            [order_id] => mMV8ip6oRBcD0cdOOyoUwd2XwFJZY
                            [processing_fee] => Array
                                (
                                    [0] => Array
                                        (
                                            [amount_money] => Array
                                                (
                                                    [amount] => 722
                                                    [currency] => USD
                                                )

                                            [effective_at] => 2021-12-29T03:23:22.000Z
                                            [type] => INITIAL
                                        )

                                )

                            [receipt_number] => DtsL
                            [receipt_url] => https://squareupsandbox.com/receipt/preview/DtsLOZuXyYdM7mXOSJf6g3wLUodZY
                            [source_type] => CARD
                            [status] => COMPLETED
                            [team_member_id] => TM-eYN4faAVNnf_D
                            [total_money] => Array
                                (
                                    [amount] => 20199
                                    [currency] => USD
                                )

                            [updated_at] => 2021-12-29T01:23:22.963Z
                            [version] => 3
                        )

                )

        )

)

Here’s with CVV passing and I turned off the completed checker for logging.

Debug 12-29-21 01:33:08: Array
(
    [merchant_id] => MLSDRFTT73W7B
    [type] => payment.created
    [event_id] => f0e041e0-73ac-40cb-8685-077f9610e6bb
    [created_at] => 2021-12-29T01:33:07.825Z
    [data] => Array
        (
            [type] => payment
            [id] => xqxEAKjVdSjlyIqkXoq3rJSbosaZY
            [object] => Array
                (
                    [payment] => Array
                        (
                            [amount_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [application_details] => Array
                                (
                                    [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                                    [square_product] => VIRTUAL_TERMINAL
                                )

                            [approved_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [capabilities] => Array
                                (
                                    [0] => EDIT_AMOUNT_UP
                                    [1] => EDIT_AMOUNT_DOWN
                                    [2] => EDIT_TIP_AMOUNT_UP
                                    [3] => EDIT_TIP_AMOUNT_DOWN
                                )

                            [card_details] => Array
                                (
                                    [avs_status] => AVS_ACCEPTED
                                    [card] => Array
                                        (
                                            [bin] => 411111
                                            [card_brand] => VISA
                                            [card_type] => CREDIT
                                            [exp_month] => 10
                                            [exp_year] => 2026
                                            [fingerprint] => sq-1-EV3l_IPimnt__iiXkfAPq6bnqXCUtzJhGb8_Pd-XWMu06dqMRiX-tkOouQlhOibnzQ
                                            [last_4] => 1111
                                            [prepaid_type] => NOT_PREPAID
                                        )

                                    [card_payment_timeline] => Array
                                        (
                                            [authorized_at] => 2021-12-29T01:33:07.819Z
                                        )

                                    [cvv_status] => CVV_ACCEPTED
                                    [entry_method] => KEYED
                                    [statement_description] => SQ *DEFAULT TEST ACCOUNT
                                    [status] => AUTHORIZED
                                )

                            [created_at] => 2021-12-29T01:33:07.709Z
                            [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                            [delay_action] => CANCEL
                            [delay_duration] => PT168H
                            [delayed_until] => 2022-01-05T01:33:07.709Z
                            [employee_id] => TM-eYN4faAVNnf_D
                            [id] => xqxEAKjVdSjlyIqkXoq3rJSbosaZY
                            [location_id] => L2KEJWT3XZW30
                            [order_id] => UJCpow0jJUybgg9ZADhf8Cu5mcbZY
                            [receipt_number] => xqxE
                            [source_type] => CARD
                            [status] => APPROVED
                            [team_member_id] => TM-eYN4faAVNnf_D
                            [total_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [updated_at] => 2021-12-29T01:33:07.819Z
                            [version] => 1
                        )

                )

        )

)

Debug 12-29-21 01:33:09: Array
(
    [merchant_id] => MLSDRFTT73W7B
    [type] => payment.updated
    [event_id] => 7d9d3fdf-c0a3-4d8f-8399-8daa441400a8
    [created_at] => 2021-12-29T01:33:09.313Z
    [data] => Array
        (
            [type] => payment
            [id] => xqxEAKjVdSjlyIqkXoq3rJSbosaZY
            [object] => Array
                (
                    [payment] => Array
                        (
                            [amount_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [application_details] => Array
                                (
                                    [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                                    [square_product] => VIRTUAL_TERMINAL
                                )

                            [approved_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [card_details] => Array
                                (
                                    [avs_status] => AVS_ACCEPTED
                                    [card] => Array
                                        (
                                            [bin] => 411111
                                            [card_brand] => VISA
                                            [card_type] => CREDIT
                                            [exp_month] => 10
                                            [exp_year] => 2026
                                            [fingerprint] => sq-1-EV3l_IPimnt__iiXkfAPq6bnqXCUtzJhGb8_Pd-XWMu06dqMRiX-tkOouQlhOibnzQ
                                            [last_4] => 1111
                                            [prepaid_type] => NOT_PREPAID
                                        )

                                    [card_payment_timeline] => Array
                                        (
                                            [authorized_at] => 2021-12-29T01:33:07.819Z
                                            [captured_at] => 2021-12-29T01:33:07.893Z
                                        )

                                    [cvv_status] => CVV_ACCEPTED
                                    [entry_method] => KEYED
                                    [statement_description] => SQ *DEFAULT TEST ACCOUNT
                                    [status] => CAPTURED
                                )

                            [created_at] => 2021-12-29T01:33:07.709Z
                            [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                            [delay_action] => CANCEL
                            [delay_duration] => PT168H
                            [delayed_until] => 2022-01-05T01:33:07.709Z
                            [employee_id] => TM-eYN4faAVNnf_D
                            [id] => xqxEAKjVdSjlyIqkXoq3rJSbosaZY
                            [location_id] => L2KEJWT3XZW30
                            [order_id] => UJCpow0jJUybgg9ZADhf8Cu5mcbZY
                            [receipt_number] => xqxE
                            [receipt_url] => https://squareupsandbox.com/receipt/preview/xqxEAKjVdSjlyIqkXoq3rJSbosaZY
                            [source_type] => CARD
                            [status] => COMPLETED
                            [team_member_id] => TM-eYN4faAVNnf_D
                            [total_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [updated_at] => 2021-12-29T01:33:09.310Z
                            [version] => 2
                        )

                )

        )

)

Debug 12-29-21 01:33:10: Array
(
    [merchant_id] => MLSDRFTT73W7B
    [type] => payment.updated
    [event_id] => 4273f1f3-6483-4f97-aea0-08decfff61a2
    [created_at] => 2021-12-29T01:33:09.313Z
    [data] => Array
        (
            [type] => payment
            [id] => xqxEAKjVdSjlyIqkXoq3rJSbosaZY
            [object] => Array
                (
                    [payment] => Array
                        (
                            [amount_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [application_details] => Array
                                (
                                    [application_id] => sandbox-sq0idb-BbZvlaIkgSYnVUI4rpSedg
                                    [square_product] => VIRTUAL_TERMINAL
                                )

                            [approved_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [card_details] => Array
                                (
                                    [avs_status] => AVS_ACCEPTED
                                    [card] => Array
                                        (
                                            [bin] => 411111
                                            [card_brand] => VISA
                                            [card_type] => CREDIT
                                            [exp_month] => 10
                                            [exp_year] => 2026
                                            [fingerprint] => sq-1-EV3l_IPimnt__iiXkfAPq6bnqXCUtzJhGb8_Pd-XWMu06dqMRiX-tkOouQlhOibnzQ
                                            [last_4] => 1111
                                            [prepaid_type] => NOT_PREPAID
                                        )

                                    [card_payment_timeline] => Array
                                        (
                                            [authorized_at] => 2021-12-29T01:33:07.819Z
                                            [captured_at] => 2021-12-29T01:33:07.893Z
                                        )

                                    [cvv_status] => CVV_ACCEPTED
                                    [entry_method] => KEYED
                                    [statement_description] => SQ *DEFAULT TEST ACCOUNT
                                    [status] => CAPTURED
                                )

                            [created_at] => 2021-12-29T01:33:07.709Z
                            [customer_id] => EBJJ46345S08H7FYDHN47Q9S8C
                            [delay_action] => CANCEL
                            [delay_duration] => PT168H
                            [delayed_until] => 2022-01-05T01:33:07.709Z
                            [employee_id] => TM-eYN4faAVNnf_D
                            [id] => xqxEAKjVdSjlyIqkXoq3rJSbosaZY
                            [location_id] => L2KEJWT3XZW30
                            [order_id] => UJCpow0jJUybgg9ZADhf8Cu5mcbZY
                            [receipt_number] => xqxE
                            [receipt_url] => https://squareupsandbox.com/receipt/preview/xqxEAKjVdSjlyIqkXoq3rJSbosaZY
                            [source_type] => CARD
                            [status] => COMPLETED
                            [team_member_id] => TM-eYN4faAVNnf_D
                            [total_money] => Array
                                (
                                    [amount] => 8485
                                    [currency] => USD
                                )

                            [updated_at] => 2021-12-29T01:33:09.310Z
                            [version] => 2
                        )

                )

        )

)

Okay, I think I figured it out. You have two applications for this account and they are both subscribed to webhooks using the same URL. That’s why your getting double the events. :slightly_smiling_face:

Hmm, that’s odd because the other one should have been tied to our loyalty program, but I’m glad you figured it out, thank you!