Making the Web Pay
Adrian BatemanMicrosoft Edge
@adrianba
Although actually I want to talk about shopping in general.
And in particular online shopping.
In 2014, U.S. retail digital commercegrew to $268.5 billion.
Source: comScore Digital Future in Focus 2015
In 2015, U.K. e-commerce revenue was $99 billion, the strongest in Europe and the third strongest in the world.
Source: PFSweb 2015 eCommerce Summary
Source: comScore Digital Future in Focus 2015 - U.S. Retail Digital Commerce - Q4 2014
"As friction gets removed from the mobile purchase process, gains in sales can be expected to accelerate."
Simple payment request code sample
var request = new PaymentRequest(
['visa','mc','amex'],
{
items: [
{
id: "total", label: "Fish and Chips",
amount: { currencyCode: "GBP", value: "12.50" }, // £12.50
}
]
}
);
var promise = request.show();
Demo
User experience is implementation dependent
Approximately 75% of online sales are paid forby debit and credit cards.
Photo credit:
Sean MacEntee CC BY 2.0;
Data Source: PFSweb 2015 eCommerce Summary
Online wallets such as PayPal are also popular andaccount for just over 20% of purchases.
Supported payment methods
['visa','mc','amex']
['visa','mc','amex','paypal.com', ...]
Processing the response
request.show()
.then(function(response) {
// process transaction response here
// response.methodName == selected payment method
// response.details == payment details e.g. card number
return response.complete(true);
})
.then(function() {
// redirect to confirmation page
})
.catch(function(e) {
//uh oh! something went wrong
});
Please mail me my fish and chips
var request = new PaymentRequest(
['visa','mc','amex'],
{
items: [
{
id: "shipping", label: "FREE shipping",
amount: { currencyCode: "GBP", value: "0.00"}
},
{
id: "total", label: "Fish and Chips - TOTAL",
amount: { currencyCode: "GBP", value: "12.50" }, // £12.50
}
],
shippingOptions: [
{ id: "free", label: "FREE shipping", amount: { currencyCode: "GBP", value: "0.00" } }
]
},
{ requestShipping: true }
);
var promise = request.show();
Demo Demo
We desperately need your feedback!
In the meantime, I need some fish & chips.
Making the Web Pay
Adrian BatemanMicrosoft Edge
@adrianba