Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition from Travis -> GH Actions and use Ameba #11

Merged
merged 7 commits into from
Jan 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2

updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 5
target-branch: main
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Shard CI

on:
push:
branches:
- main
pull_request:
branches:
- "*"
schedule:
- cron: "0 3 * * MON"

jobs:
LintAndTest:
strategy:
fail-fast: false
matrix:
crystal_version:
- latest
experimental: [false]
include:
- crystal_version: nightly
experimental: true

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
container: crystallang/crystal:${{ matrix.crystal_version }}-alpine

steps:
- uses: actions/checkout@v2

- name: Check format
run: crystal tool format --check

- name: Set up Crystal cache
uses: actions/cache@v2
id: crystal-cache
with:
path: |
~/.cache/crystal
bin/ameba
lib
key: ${{ runner.os }}-crystal-${{ matrix.crystal_version }}-${{ hashFiles('**/shard.lock') }}
restore-keys: |
${{ runner.os }}-crystal-${{ matrix.crystal_version }}

- name: Install shards
if: steps.crystal-cache.outputs.cache-hit != 'true'
run: shards check || shards install

- name: Crystal Ameba Linter
run: ./bin/ameba

- name: Run tests
run: crystal spec
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Stripe

![Shard CI](https://github.com/confact/stripe.cr/workflows/Shard%20CI/badge.svg)
[![GitHub release](https://img.shields.io/github/release/confact/stripe.cr.svg?label=Release)](https://github.com/confact/stripe.cr/releases)

Stripe API wrapper for Crystal.

This version (>1.0) is changed to follow Ruby's method and class structure. We will follow `Stripe::Class.method` but follow crystal parameters to take care of the types automatically.
Expand Down Expand Up @@ -57,17 +60,19 @@ Follow the instruction for setting up an subscription at stripe: [https://stripe
When the step is at server code, check the code below that is corresponding towards the ruby code for same step.

Setting up an customer:

```crystal
token = params['StripeToken'] # or what the param for the token is called for you.
customer = Stripe::Customer.create(email: email,
description: name, # just example
payment_method: token, # or token.payment_method.id
payment_method: token, # or token.payment_method.id
# depends what you do in the frontend to handle the token.
invoice_settings: { default_payment_method: token })

```

create a subscription with that customer:

```crystal
Stripe::Subscription.create(customer: customer,
plan: STRIPE_PLAN_ID,
Expand Down Expand Up @@ -117,6 +122,7 @@ But follow [https://stripe.com/docs/billing/subscriptions/set-up-subscription](h
- [ ] Update a source

##### Subscriptions

- [x] Create a Subscription

- [x] Retrieve a Subscription
Expand Down Expand Up @@ -223,7 +229,6 @@ But follow [https://stripe.com/docs/billing/subscriptions/set-up-subscription](h

- [x] List all invoices


### Objects

#### Core
Expand Down Expand Up @@ -280,7 +285,6 @@ But follow [https://stripe.com/docs/billing/subscriptions/set-up-subscription](h

#### Connect


- [ ] Account

- [ ] Login link
Expand Down
Loading