iagobruno / laravel-paid-api-demo

Uma simples API no modelo pay-as-you-go onde os clientes pagam pelo volume de chamadas realizadas.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

laravel-paid-api-demo

Uma simples API no modelo pay-as-you-go onde os clientes pagam pelo volume de chamadas realizadas.

tour.gif

Built with

Run Locally

Clone this repo and run commands in the order below:

composer install
cp .env.example .env # And edit the values
php artisan key:generate

Then start Docker containers using Sail:

sail up -d

And run the migrations:

sail artisan migrate
sail artisan db:seed # Optional

Front-end assets

Open another terminal tab and run the command below to compile front-end assets:

sail yarn install
sail yarn run watch

Now you can access the project at http://localhost in the browser.

Running tests

To run tests, first create a database named "testing-laravel"

CREATE DATABASE "testing-laravel";

And run the following command:

sail artisan test
# sail artisan test --filter GetUserTest
# sail artisan test --filter "Deve retornar um erro ..."
# sail artisan test --stop-on-failure

NOTE: Make sure you started the docker containers first.

Stripe Webhooks

Use the Stripe CLI to simulate Stripe events in your local environment. Learn more about Webhooks.

stripe listen --forward-to localhost/stripe/webhook
stripe trigger payment_intent.succeeded

About

Uma simples API no modelo pay-as-you-go onde os clientes pagam pelo volume de chamadas realizadas.


Languages

Language:PHP 83.9%Language:Blade 14.8%Language:Shell 0.8%Language:JavaScript 0.4%