Latest 0.4.0
License MIT
Platforms ios 10.0, requires ARC
Dependencies Pring


⚠️ Orderable is currently under development. ⚠️

for japanese:

Orderable is a CocoaPods library that works with Cloud Functions for Firebase and can easily execute payment.

EC requires a lot of processing. For example, check number of stocks, payment process, create history, and so on. Orderable exec these troublesome tasks.

For Server Side (Cloud Functions for Firebase): starhoshi/orderable.ts



pod 'Orderable'


1. Protocol

You need to define the necessary Model in your project.

Required protocol is here, sample model definition is here.

  • User
    • Buyer
  • Shop
    • Seller
  • Product
    • Product concept.
  • SKU
    • Entity of the product. Have inventory and price etc.
  • Order
    • Order have payment amount and payment method etc.
  • OrderShop
    • Order information for each shop.
  • OrderSKU
    • The item ordered. Have quantity etc.

2. Deploy

Deploy orderable.ts to Cloud Functions.

3. Pay an order

Sample code is here. orderable.ts starts when order.paymentStatus = OrderPaymentStatus.paymentRequested and update is done.

let order = Order()
order.amount = 1000
let stripe = Stripe()
stripe.customerID = "new_cus"
stripe.cardID = "new_card"
order.stripe = stripe
order.paymentStatus = OrderPaymentStatus.created


// functions trigger
order.paymentStatus = OrderPaymentStatus.paymentRequested
order.update() // start cloud functions

4. Result

When purchase processing is completed, order.neoTask.status === 1 will be set. That is a sign of success. Observe the order and wait for the process to complete.

import Pring

var disposer: Disposer<Order>?
self?.disposer = Order.listen( { order, error in
  if order.neoTask.status === 1, order.stripeChargeID != nil {
    // stripe charge completed.


Detailed errors are listed here.
You need to handle error by each error type.

On the client side, handle the following two errors.

  • invalid
    • Need to fix properties on the client side.
  • fatal
    • Have to check and correct the data directly.



Latest podspec

    "name": "Orderable",
    "version": "0.4.0",
    "summary": "Orderable",
    "description": "Orderable can be paid using firebase and stripe.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "star__hoshi": "[email protected]"
    "social_media_url": "",
    "platforms": {
        "ios": "10.0"
    "source": {
        "git": "",
        "tag": "0.4.0"
    "source_files": "Orderable/**/*.swift",
    "requires_arc": true,
    "static_framework": true,
    "dependencies": {
        "Pring": []

Pin It on Pinterest

Share This