Custom Data in Payment Button

Hi,

We did try submitting a support ticket but your system would not accept the correct verification code.

We have set up a checkout page on our website where we have embedded the Payment button using HTML code. We have included data-custom=“MY_CUSTOM_DATA” as metadata within the code as shown in the example on this page - Payment Button Callbacks | Coinbase Cloud under ‘Metadata’.

The code, payment button and checkout process works fine. However, the webhook payload we have received from the test payment we made does not show the custom data we included in the HTML code. Our code is formatted exactly as per the example shown on the webpage above:

This is a button.

Why isn’t the custom metadata feature working and what do we need to do to get it to work? This is essential in getting our customer’s data so we can tie the payment to them.

Regards.

Seeing as we haven’t had the courtesy of a reply from Coinbase support, I’ll take it that this claimed “feature” does not work and is essentially useless.

Hey @silisols! Apologies for the delayed response. We understand that you are having issues with the custom metadata feature. May we ask what is the error that you are getting? Are there any console log messages that you can share? or a short video showing what exactly is happening?

We are experiencing the same problem. The documentation: Commerce Payment Button Callbacks | Coinbase Cloud

states that by adding the “data-custom” attribute to the payment button, it will append metadata to the checkout. However when we receive the webhook notification, it includes an empty metadata field. Does this feature work? Or is the documentation incorrect?

This is the webhook payload we receive, notice that the metadata field has an empty object.

{
“attempt_number”: 1,
“event”: {
“api_version”: “2018-03-22”,
“created_at”: “2023-10-06T02:05:11Z”,
“data”: {
“id”: “401e41ea-4fef-4f59-b150-1817f4bc67c2”,
“code”: “32NJ7JNZ”,
“name”: “Test”,
“utxo”: false,
“pricing”: {
“usdc”: {
“amount”: “9.990000”,
“currency”: “USDC”
},
“local”: {
“amount”: “9.99”,
“currency”: “USD”
},
“pusdc”: {
“amount”: “9.990000”,
“currency”: “PUSDC”
},
“pweth”: {
“amount”: “0.006153656621032693”,
“currency”: “PWETH”
},
“ethereum”: {
“amount”: “0.006156000”,
“currency”: “ETH”
}
},
“checkout”: {
“id”: “6c7f673c-317c-474b-b10c-c6f32470b1a5”
},
“fee_rate”: 0.01,
“logo_url”: “”,
“metadata”: {},
“payments”: ,
“resource”: “charge”,
“timeline”: [
{
“time”: “2023-10-06T02:05:11Z”,
“status”: “NEW”
}
],
“addresses”: {
“usdc”: “0x69a7818275f5791f1081bc09567d0c5d01bf2372”,
“pusdc”: “0x69a7818275f5791f1081bc09567d0c5d01bf2372”,
“pweth”: “0x69a7818275f5791f1081bc09567d0c5d01bf2372”,
“ethereum”: “0x69a7818275f5791f1081bc09567d0c5d01bf2372”
},
“pwcb_only”: false,
“created_at”: “2023-10-06T02:05:11Z”,
“expires_at”: “2023-10-06T03:05:11Z”,
“hosted_url”: “Coinbase Commerce”,
“brand_color”: “#122332”,
“description”: “Test”,
“fees_settled”: true,
“pricing_type”: “fixed_price”,
“support_email”: “”,
“brand_logo_url”: “https://res.cloudinary.com/commerce/image/upload/v1695787705/nl6nbpifdkbsnkmcxyhd.png”,
“exchange_rates”: {
“ETH-USD”: “1622.85”,
“USDC-USD”: “1.0”,
“PUSDC-USD”: “1.0”,
“PWETH-USD”: “1623.425”
},
“offchain_eligible”: false,
“organization_name”: “”,
“payment_threshold”: {
“overpayment_absolute_threshold”: {
“amount”: “0.01”,
“currency”: “USD”
},
“underpayment_absolute_threshold”: {
“amount”: “0.01”,
“currency”: “USD”
}
},
“local_exchange_rates”: {
“ETH-USD”: “1622.85”,
“USDC-USD”: “1.0”,
“PUSDC-USD”: “1.0”,
“PWETH-USD”: “1623.425”
},
“coinbase_managed_merchant”: false
},
“id”: “1c2dc660-17d7-4eda-aac7-ed06a93428e8”,
“resource”: “event”,
“type”: “charge:created”
},
“id”: “087df585-098a-4a21-8544-99573858eb4d”,
“scheduled_for”: “2023-10-06T02:05:11Z”
}