-
Notifications
You must be signed in to change notification settings - Fork 48
custom webhook URL/recipient ID when creating a checkout object to ensure good deliveries on payment platforms #58
Description
Hello,
as of right now; it is completely unsafe for payment platforms to trust merchants on payment platforms using just the api key as the authentication method with the current features.
imagine the next situation:
- a merchant setups the coinbase integration using their api key on shopify
- a buyer pays a good on the merchant website hosted on shopify
- the merchant invalidates the api key mid-payment, which makes the payment platform (shopify) unable to check if the payment goes thru or not
- the buyer never gets the goods or a payment confirmation from the merchant/payment platform
this could be easily solved by being able to specify a forced webhook url upon the creation of a checkout, such as:
Checkout.create({
'description': 'Mastering the Transition to the Information Age',
'local_price': {
'amount': '1.00',
'currency': 'USD'
},
'name': 'test item 15 edited',
'pricing_type': 'fixed_price',
'requested_info': ['email'],
'notification_url': 'https://webhook.api.shopify.com/coinbase',
}, function (error, response) {
...
});note the notification_url field: this is the webhook url that will receive all events regarding this checkout object. the platform can then be sure that the webhook will be delivered to their endpoint, without having to use the api key to periodically check on the checkout status, which is translated into an unnecessarily high api usage that could be simplified by using webhooks.
Additionally, trusting the user input for an API key can lead to unexpected results when generating objects, and doesn't make it 'know your customer' eu regulations compilant. A way of creating an oAuth token with a login screen would allow to use standard oAuth endpoints such as /me to get merchant data.
As far as I'm aware this feature isn't planned on coinbase commerce, but it is available on coinbase. Therefore, a platform could use their API key and just specify the coinbase account where the funds should be redirected, such as:
Checkout.create({
'description': 'Mastering the Transition to the Information Age',
'local_price': {
'amount': '1.00',
'currency': 'USD'
},
'name': 'test item 15 edited',
'pricing_type': 'fixed_price',
'requested_info': ['email'],
'recipient': 'coinbase_account_id_of_merchant',
}, function (error, response) {
...
});(note the recipient field)
any of the two mentioned feature requests (which is security critical since this is an actual issue on all platform integrations as of 23-3-2022 that can lead to customers not receiving goods) would greatly improve the coinbase commerce platform. We think the second option (recipient coinbase account) would be best, since it would make it regulation-compilant (the current oAuth implementation on coinbase is already know-your-customer friendly) and would ensure payment notifications are delivered; the only throwback is: the API key usage threshold should be recipient independant or considerably higher.
Since we consider this to be a critial security issue for buyers, we reported this to the team on coinbase a month ago, but we didnt get any reply on the multiple communication channels we used, hence why we are making it public here. We are afraid we will have to drop coinbase support and offer just bitpay if this doesn't get resolved/planned soon.