stripe-service

command module
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 26 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Build Status Go Report Card

Stripe Micro Service

A Micro Service for Stripe Payments in Go

Building

go build

Usage

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

curl -X POST\
    -d "{\"token\": \"tok_gb\", \"amount\": 1000, \"desc\": \"example\"}" \
    http://0.0.0.0:57493/charge

Customer

List
curl -X GET \
    -d "{\"limit\":\"10\"}" \
    http://0.0.0.0:57493/customer
Get

The customer id will return the customer details

curl http://0.0.0.0:57493/customer/cus_BUoP6KtXPL3ajU
Add
curl -X POST \
    -d "{\"token\": \"tok_gb\", \"account\": \"1\", \"email\": \"example@mailinator.com\", \"desc\": \"Added by go test\"}" \
    http://0.0.0.0:57493/customer
New Default Card
curl -X PUT \
    -d "{\"token\": \"tok_mastercard_debit\"}" \
    http://0.0.0.0:57493/customer/cus_BUoP6KtXPL3ajU/card
Reload
curl http://0.0.0.0:57493/reload
Coupons
curl -X PUT http://0.0.0.0:57493/customer/cus_DOQj7OGOt6mX1n/coupon/free
Subscriptions

Get customer subscriptions

curl http://0.0.0.0:57493/customer/cus_DOQj7OGOt6mX1n/subscription
Sessions
curl -X POST http://0.0.0.0:57493/customer/cus_BUoP6KtXPL3ajU/session/plan_FPSDCc5aQKEEP3

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址