2019-06-01 net

(Brent) #1

Stripe API
https://stripe.com/docs/api
An old adage says
that open-source
developers need to
eat too – in lieu of
revenue, you’ll find
that your landlord
does not accept download figures.
Fortunately, collecting money from
customers is not as difficult as it used to be.
Stripe is a one size fits all company – its
SDK provides you with a set of widgets for
credit card information input. The API is
not limited to one-time transactions either:
if you monetise your service via recurring
purchases, a useful extension can collect
your money.
While Stripe – obviously – cannot take
money from PayPal, the company has an
impressive range of partners. You can use
both Apple and Google Pay along with the
Chinese WeChat and AliExpress payment
services. Furthermore, the fee structure
of Stripe is simpler than that of its blue
competitor – especially if you are worried
about chargebacks or refunds. Stripe’s way
of handling the problem leads to fewer
surprises when the actual bill arrives.


Ambient Light Events
https://developer.mozilla.org/en-US/docs/
Web/API/Ambient_Light_Events
PDAs with colour
displays introduced
developers to
problems related to
screen brightness –
crank it up and the
battery will run out; too low and users get
eyestrain trying to make out details drowned
out by ambient light sources. Fortunately,
advancing sensor technology made ambient
light sensors affordable and today even
cheap feature phones come with fully
featured sensors, allowing developers to
harness them to drive changes in their apps.
Mozilla’s Ambient Light API lets your
website collect information from these
sensors. Content can then adapt itself to
the situation at hand – for example, an
eye- and sleep-friendly night mode could
auto-activate in the dark. The API is flexible
enough to cover both polling and event-
driven scenarios.
However, providing users with a manual
override capability is well advised.
Some users rising before dawn will help
themselves to wake up by reading – forcing
them to endure a sleep-inducing colour
scheme against their will is a sure-fire way
to reduce customer satisfaction.

On the life
cycle of APIs
When looking at the APIs
covered in this feature, two
types can be seen. The first
one, such as the various
APIs courtesy of Google, are
the products provided by a
dedicated vendor.
Such APIs are developed
however the company feels
like – if it feels the API is
no longer needed or should
be changed, this is what
takes place. Others, such as
the Ambient Light API, are
developed in an open fashion.
This means that development
is pushed forward either by a
browser vendor or the W3C


  • in many cases, successful
    proposals by vendors are
    promoted to be managed by
    the W3C.
    Keep in mind that
    unfinished APIs can die even
    during W3C standardisation.
    One especially sad example
    of this is the NFC Web API,
    which once was part of
    Firefox OS. After Mozilla
    gave up, the W3C dropped
    it like a hot potato. The API
    now languishes along as a
    barely maintained community
    proposal, which – usually –
    means that the standard will
    go nowhere. Keep this in mind
    when selecting new APIs:
    an API you rely upon being
    discontinued is painful.


As with all things web, anything
being done by a for-profit company
leads to the arrival of at least five
open-source alternatives. Here is a
guide to a few APIs ‘from the street’ –
if you are lucky, your browser already
has support for them out of the box

19 groundbreaking APIs

Free download pdf