Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages