Making the Web Pay



Making the Web Pay

1 0


webpay-smashing-jam


On Github adrianba / webpay-smashing-jam

Making the Web Pay

Adrian BatemanMicrosoft Edge

@adrianba

SmashingConf Los Angeles

SmashingConf Whistler

SmashingConf Oxford

Fish & Chips

Although actually I want to talk about shopping in general.

Photo credit: Roderick Eime CC BY 2.0

And in particular online shopping.

Photo credit: Robbert Noordzij CC BY 2.0

e-Commerce is booming!

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

Amazon now has this site: https://www.amazon.com/gp/b2b/reports

My 2015 Amazon spending

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."

https://www.w3.org/Payments/WG/

http://go4a.de/paymentrequest-api

Show me the money code!

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.

Photo credit: 401kcalculator.org CC BY 2.0; Data Source: PFSweb 2015 eCommerce Summary

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.

Thank you!

@MSEdgeDev or @adrianba

Slides: http://aka.ms/webpay-jam

Making the Web Pay Adrian BatemanMicrosoft Edge @adrianba