Skip to content

Latest commit

 

History

History
38 lines (24 loc) · 1.13 KB

README.md

File metadata and controls

38 lines (24 loc) · 1.13 KB

Payments-API Spawn Example

This is a Spawn example app

Running in dev mode

Make sure the proxy is running with:

spawn dev run -p ./protos -s spawn-system -W

Run your application with:

yarn start

Invoking your Actor

You can now invoke actors with:

# to capture
curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' -X POST -d '{"id":"spawn.txn_01","amount":1000,"currency":"usd","orderRefid":"order_01"}' http://localhost:9980/payments/capture

# to refund
curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' -X POST -d '{"id":"spawn.txn_02","amount":500,"currency":"usd","captureTransactionId":"spawn.txn_01"}' http://localhost:9980/payments/refund

# to get the breakdown
curl -i -H 'Accept: application/json' -H 'Content-Type: application/json' http://localhost:9980/payments/breakdown

NOTE: This uses the HTTP transcoding from the protobuf definition, you can also invoke this actor from other Spawn hosts.

Documentation

See SDK Documentation