Building Ecommerce Projects with Moltin

A presentation at PHPSW eCommerce in July 2015 in Bristol, UK by Drew McLellan

Slide 1

Slide 1

Building Ecommerce Projects with Moltin

  • DREW MCLELLAN -
  • PHPSW JULY 2015 -

Slide 2

Slide 2

Hello! I’m Drew McLellan. Lead dev on Perch CMS. Publisher of 24ways.org @drewm
github.com/drewm

Slide 3

Slide 3

Ecommerce sucks. Open Source and crappy! Hosted and restrictive! Enterprisey and useless! Bespoke and full of sadness :(

Slide 4

Slide 4

Time spent on wrangling ecommerce is time stolen from fi nessing the UX.

Slide 5

Slide 5

Payment gateways are all di ff erent. (AND MOST ARE TERRIBLE)

Slide 6

Slide 6

Compromise all the way down To gain: O ff -the-shelf functionality Ease of hosted SaaS Choice of gateway Web, app, PoS integration You lose: UX fl exibility Seamless integration Your hair Entire contents of your bank account

Slide 7

Slide 7

What could the answer possibly be?

Slide 8

Slide 8

Moltin is an ecommerce web service API.

Slide 9

Slide 9

Moltin is an ecommerce web service API. Products Inventory Carts Checkout Customers Promotions Shipping Orders & Receipts Currencies Taxes

Slide 10

Slide 10

It works like this

  1. Sign up at moltin.com

  2. Create a store

  3. Get an API key & secret

  4. Install PHP SDK with Composer

  5. Start building your store

Slide 11

Slide 11

Install the SDK composer require moltin/php-sdk:dev-version1

Slide 12

Slide 12

Instantiate all the things use

Moltin\SDK\Request\CURL

as

Request ; use

Moltin\SDK\Storage\Session

as

Storage ; $moltin

new

\Moltin\SDK\SDK ( new

Storage (), new

Request ());

Slide 13

Slide 13

Authenticate $result

\Moltin :: Authenticate( 'ClientCredentials' , [

'client_id'

=>

'<YOUR CLIENT ID>' ,

'client_secret'

=>

'<YOUR CLIENT SECRET>' , ]);

Slide 14

Slide 14

Get stu ff done // Create a product

$result

\Product :: Create([…]) ; // Update a product

$result

\Product :: Update( '<ID>' , [ 'title'

=>

'Updated!' )] ; // Get a product

$result

Product :: Get( '<ID>' ); // Delete a product

$result

Product :: Delete( '<ID>' );

Slide 15

Slide 15

Forge Dashboard

Slide 16

Slide 16

Checkout

Slide 17

Slide 17

50+ Payment Providers authorize.Net

DataCash GoCardless Mollie NetBanx PayPal SagePay SecPay / PayPoint.net

Stripe WorldPay

Slide 18

Slide 18

Checkout Calculates shipping, taxes, discounts. Adjusts stock levels. Generates orders and invoices. Handles gateway API interactions* 
 


  • sort of.

Slide 19

Slide 19

Gateways You don’t get total isolation from gateway weirdness. You can’t just swap one gateway for another. Still needs planning for payment fl ows to call the right Moltin API methods at the right times.

Slide 20

Slide 20

Moltin bills on API requests.

Slide 21

Slide 21

Billed on API requests Free up to 30,000 per month. 300,000 reqs is $49 600,000 reqs is $99 … 5,000,000 reqs $499

Slide 22

Slide 22

So.

Slide 23

Slide 23

Advantages You get almost complete control over the UX. You don’t need to build all the boring stu ff . Multiple apps (website, mobile, PoS, etc) can all use the same backend with no extra work. Swap out your front end easily. Start adding inventory via Forge before site is built.

Slide 24

Slide 24

Disadvantages Creates a very large dependancy compared to something self-hosted. That comes with risk of downtime or service discontinuation. Introduces network latency into many operations. Not as fl exible as something completely bespoke.

Slide 25

Slide 25

Questions?