Skip to content

timxor/payment-api

Repository files navigation

payment-api

payment api for sending crypto to friends using their phone number or email

download and install dependencies

`` git clone https://github.com/timxor/payment-api.git cd payment-api cd parity git submodule init git submodule update

rustup toolchain install nightly-2018-12-27 cargo +nightly-2018-12-27 build

cargo build


## install depencies


start Postgres app, version 10.
use pgadmin4.

## configure .env local db
payment-api/payment-api/.env should have something like this:

DATABASE_URL=postgres://infomarket:password@localhost/infomarket


## test database connectivity

psql postgres://infomarket:password@localhost:5432


# start the api server

export DATABASE_URL=postgres://macdev:timistheshit@localhost/paymentapi cargo run --bin payment_api


# cli
## create a transfer

cargo run --bin create_transfer



## show transfers

cargo run --bin show_transfers



# repo url

https://github.com/tcsiwula/payment-api



# updating the db
First drop the table:

psql postgres://macdev:timistheshit@localhost/paymentapi select * from users; drop table users; select * from users;


Then create a new up.sql:

diesel migration generate newSqlThingy


Then edit the schema in up.sql and run it:

diesel migration run diesel print-schema > src/schema.rs


The new table should be here now:

select * from users;



# API endpoints & Documentation

Please see [docs/README.md](./docs/README.md) for detailed documentation.

## post localhost:8000/user
example payload:

{ "firstName": "Test-api-003", "lastName": "Ethers", "userName": "@cultofcrypto", "number": 18472490853, "email": "frank@aol.com" }


## dependencies

Parity
https://wiki.parity.io/Setup

About

A cli tool for transfering ethereum & creating new wallets

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published