Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roundpartner/stripe-service
A Microservice for Stripe Payments in Go
https://github.com/roundpartner/stripe-service
go microservice
Last synced: 3 months ago
JSON representation
A Microservice for Stripe Payments in Go
- Host: GitHub
- URL: https://github.com/roundpartner/stripe-service
- Owner: roundpartner
- License: mit
- Created: 2017-09-13T12:20:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T16:00:21.000Z (almost 2 years ago)
- Last Synced: 2024-06-20T14:26:47.094Z (8 months ago)
- Topics: go, microservice
- Language: Go
- Homepage:
- Size: 187 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Report Card](https://goreportcard.com/badge/github.com/roundpartner/stripe-service)](https://goreportcard.com/report/github.com/roundpartner/stripe-service)
# Stripe Micro Service
A Micro Service for Stripe Payments in Go# Building
```bash
go build
```# Usage
```bash
export STRIPE_KEY="your stripe key"
export STRIPE_SUCCESS_URL="https://example/success"
export STRIPE_CANCEL_URL="https://example/cancel"
go run github.com/roundpartner/stripe-service
```
## Charge
To take a single payment the charge end point provides this
```bash
curl -X POST\
-d "{\"token\": \"tok_gb\", \"amount\": 1000, \"desc\": \"example\"}" \
http://0.0.0.0:57493/charge
```
## Customer
### List
```bash
curl -X GET \
-d "{\"limit\":\"10\"}" \
http://0.0.0.0:57493/customer
```
### Get
The customer id will return the customer details
```bash
curl http://0.0.0.0:57493/customer/cus_BUoP6KtXPL3ajU
```
### Add
```bash
curl -X POST \
-d "{\"token\": \"tok_gb\", \"account\": \"1\", \"email\": \"[email protected]\", \"desc\": \"Added by go test\"}" \
http://0.0.0.0:57493/customer
```
### New Default Card
```bash
curl -X PUT \
-d "{\"token\": \"tok_mastercard_debit\"}" \
http://0.0.0.0:57493/customer/cus_BUoP6KtXPL3ajU/card
```
### Reload
```bash
curl http://0.0.0.0:57493/reload
```
### Coupons
```bash
curl -X PUT http://0.0.0.0:57493/customer/cus_DOQj7OGOt6mX1n/coupon/free
```
### Subscriptions
Get customer subscriptions
```bash
curl http://0.0.0.0:57493/customer/cus_DOQj7OGOt6mX1n/subscription
```
### Sessions
```bash
curl -X POST http://0.0.0.0:57493/customer/cus_BUoP6KtXPL3ajU/session/plan_FPSDCc5aQKEEP3
```