Re: [w3c/payment-request] Allow custom data for the active payment method to be provided to `PaymentResponse.prototype.complete` (Issue #981)

> Being an application developer I don't think in IDL but in JavaScript. Anyway, would it be possible describing a possible use case a little bit more? I don't understand the flow.

Sure, let me try to explain. 

Let's say http://marcospay.com, lets you complete a payment in the following way (this example is deliberately silly, but stay with me):

```JS
// marcospay supports playing the theme song to party town in the payment sheet, so cool! 🎉🥳
paymentResponse.complete("success", {data: {"theme": "party-town"}});
```

> Is the Merchant supposed to send down additional information to the payment handler? How would the Merchant know that such information is required without first have gotten some piece of information from the payment handler?

By virtue that you've signed up with "marcospay". Marcospay's documentation tells you about passing "party-town" and what it does. 
 
> Personally I would be extremely happy if there was a possibility adding a `MessageChannel` to `PaymentRequest`.

That would fundamentally change the API and we would need a whole new design. The point here is just to pass a one off bit of data when the sheet is closing.  



-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-request/issues/981#issuecomment-1016170773

You are receiving this because you are subscribed to this thread.

Message ID: <w3c/payment-request/issues/981/1016170773@github.com>

Received on Wednesday, 19 January 2022 07:52:36 UTC