[w3c/browser-payment-api] What about billing address (#216)

Hi all,

I do not find out anywhere to contribute on codebase level for the current draft APIs of W3C but after a little inspection on Payment API, I have found that shippingAddress property is used to be set by the user to define the delivery address point. After thinking of the legal restrictions and the availabilities, it would be nice to have also a **billingAddress** option there. Especially in Turkey (and in addition, I do really not know the legal state of shopping online, etc.), people who often buy something else via internet, can seperate the shipping and the billing address as well. This means the product(s) are delivered to the place that had been mentioned as shippingAddress and the receipt is delivered to the billing address specified just on time like shippingAddress.

So the options object may contain just the following:

```javascript
{
  requestBilling: true
}
```

That's why, in PaymentOptions need the following additional propery:

```javascript
dictionary PaymentDetails {
    PaymentItem                                       total;
    sequence<PaymentItem>                   displayItems;
    sequence<PaymentShippingOption>  shippingOptions;
    **sequence<PaymentBillingOption>    billingOptions;**
    sequence<PaymentDetailsModifier>   modifiers;
};
```

Then, the other container called PaymentOptions can get updated like the following:
```javascript
dictionary PaymentOptions {
    boolean requestPayerEmail = false;
    boolean requestPayerPhone = false;
    boolean requestShipping = false; 
    boolean requestBilling = false; //if this comes as true, the billing address is expected
};
```

The billing information can imitate PaymentShippingOption like the following:

```javascript
dictionary PaymentBillingOption {
    required string                id;
    required string                label;
    required PaymentCurrencyAmount amount;
    boolean               selected = false;
};
```

So the PaymentResponse can contain one additional property:

```javascript
interface PaymentResponse {
    readonly attribute DOMString                        methodName;
    readonly attribute PaymentCurrencyAmount totalAmount;
    readonly attribute object                                details;
    readonly attribute PaymentAddress?            shippingAddress;
    readonly attribute PaymentAddress?            billingAddress;
    readonly attribute DOMString?                      payerEmail;
    readonly attribute DOMString?                      payerPhone;

    Promise<void> complete(optional PaymentComplete result = "");
};
```

After then, we will need the events after billing address changed:

**billingaddresschange** PaymentRequestUpdateEvent => The user provides a new billing address.
**billingoptionchange** PaymentRequestUpdateEvent => The user chooses a new billing option.

I do not know if here is the place to mention just like this idea but only note and attach here.

Thanks..

---
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/browser-payment-api/issues/216

Received on Wednesday, 15 June 2016 12:17:56 UTC