Giter Site home page Giter Site logo

yesbee-connector's Introduction

Yesbee Connector

this.from('yesbee://0.0.0.0:10000/sendEmail') // use http://
.to('smtp://localhost');
$yesbeeConnector = Yesbee::factory('192.168.1.10', '10000');
$yesbeeConnector->post('/sendEmail', array(
'anu'
));

$exchange = $yesbeeConnector
->exchange(array(
// body
))
->header('da', 'da')
->send('/sendEmail');
this.from('http://localhost:3000')
    .to(function() {
        // process billing
    })

this.from('direct:digitalItems')
    .to(function() {
        // process digital items
    })
$yesbeeConnector = Yesbee::factory('192.168.1.10', '10000');
$yesbeeConnector->send('direct:digitalItems', array(
'anu'
));

$exchange = $yesbeeConnector
->exchange(array(
// body
))
->header('da', 'da')
->send('/sendEmail');
$yesbee = Yesbee::factory('192.168.1.10', '10000');
$yesbee->post('sendEmail', array(
    'anu'
));

$yesbee->sendEmail(array(
    'anu'
), $headers);

$exchange = $yesbee
    ->exchange(array(
        // body
    ))
    ->header('da', 'da')
    ->send('/sendEmail');

class Connector {
    public function __call($method, $args)
    {
        return call_user_func_array(array($this, 'post'), array('/'.$method) + $args);
    }
}
$client = Yesbee::facetory('http://localhost', 4000);

$client
->post('/checkout', array(
    'key' => 'value'
))
->header('key', 'value')
->header(array())
->send();

$client
->exchange(array())
->header('key', 'value')
->header(array())
->send('/checkout');

Yesbee\Connector

send(/* string */ $uri)

Yesbee\Exchange

header(/* string / $key, / mixed */ $value)

header(/* array */ $headers)

body(/* mixed */ $body)

send(/* string */ $uri)

use Guzzle Norm use this library


TODO

  • component mongo: (optional)
  • access config from context
this.context.config('anu.gemes');

from manifest.json

{
    "config": {
        "anu": {
            "gemes": "xxx"
        }
    }
}

Store -> Checkout Engine (REDIRECT)

open /initiate?store_id=xyz&api_token=asd420fE&amount=123456

Checkout Engine -> (yesbee) Core Acq

REQ:

GET /checkout.json?store_id=xyz&api_token=asd420fE&amount=123456
Content-Type: application/json

RESP:


Body:
{
    "refnum": "xyz:asd420fE"
    "store_id": "xyz",
    "amount": 123456,
    "fee": 12345,
    "total": 123456 + 12345
}

Checkout Engine display checkout page

  • Generate QRCode based on data
  • Build socketio connection to yesbee

xxx xxx xxx

Store -> yesbee (socketio)

socketio::emit('wait-for-payment', {
    "refnum": "xxx"
})

yesbee akan simpan

QRCode -> scan mobile app (out of scope)

... ...

Issuer -> (yesbee) Core Acq

REQ:

POST /checkout/:refnum.json

{
    "refnum": "xxx"
    "store_id": "xxx",
    "amount": 123456,
    "fee": 12345,
    "total": 123456 + 12345,
    "issuer_data": "xxx"
}

RESP:

Status Code:
200 OK

Core Acq -> yesbee:/checkout/:refnum/paid

Core Acq -> yesbee:/email

socketio-emit:

emit('paid', {})

Not used

REQ:

GET /initiate
# Content-Type: application/json

Body:
{
    "store_id": "xxx",
    "api_token": "xxx",
    "amount": 123456
}

RESP:


Body:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.