Re: [w3c/payment-handler] Share user data with Payment App (#123)

#### Proposal

A payment app can request user data *after* being invoked, by calling a new method `requestUserData()` on `PaymentManager`:

```webidl
interface PaymentManager {
    [SameObject]
    readonly attribute PaymentInstruments instruments;
    [SameObject]
    readonly attribute PaymentWallets     wallets;
    Promise<boolean> requestPermission();
    Promise<PaymentUserData> requestUserData(sequence<PaymentUserDataField> fields);
};

enum PaymentUserDataField {
    "name",
    "email",
    "phone",
    "shippingAddress"
};

dictionary PaymentUserData {
    DOMString name;
    DOMString email;
    DOMString phone;
    DOMString shippingAddress;
};
```

It is only possible for the payment app to receive user data that was required by the original PaymentRequest.

The browser may present a permission request dialog to the user. If the user chooses to not give permission to the app, the returned promise will be rejected.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/payment-handler/issues/123#issuecomment-308713513

Received on Thursday, 15 June 2017 12:18:46 UTC