Re: [browser-payment-api] Should it be possible to vary amounts depending on payment method (#4)

I've thought of a better way to accomplish payment method specific discounts: have two "Buy" buttons on the webpage. This lets us keep the API simple in v1 and still accommodate the use case. What do you think? Example:

````html
<button onClick="discountPrice();">Use Foo to buy for $0.70</button>
<button onClick="fullPrice();">Buy for $1.00</button>
<script>
function discountPrice() {
    new PaymentRequest(
        ["foo"],
        {"items": [{
                "id": "original",
                "label": "Original price",
                "amount": {"currencyCode": "USD", "value": "1.00"}
            }, {
                "id": "foodiscount",
                "label": "Foo payment method discount",
                "amount": {"currencyCode": "USD", "value": "-0.30"}
            }, {
                "id": "total",
                "label": "Total amount",
                "amount": {"currencyCode": "USD", "value": "0.70"}
            }]}).show().then(chargeDiscountPrice).catch(handleError);
}
function fullPrice() {
    new PaymentRequest(
        ["visa", "mastercard", "amex"],
        {"items": [{
                "id": "total",
                "label": "Total amount",
                "amount": {"currencyCode": "USD", "value": "1.00"}
            }]}).show().then(chargeFullPrice).catch(handleError);
}
</script>
````

---
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/4#issuecomment-200893925

Received on Thursday, 24 March 2016 15:44:23 UTC