This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Illuminate\Notifications\Notifiable; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
use Laravel\Cashier\Billable; | |
class User extends Authenticatable | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="content"> | |
<form action="{{ asset('charge') }}" method="POST"> | |
{{ csrf_field() }} | |
<script | |
src="https://checkout.stripe.com/checkout.js" class="stripe-button" | |
data-key="{{ env('STRIPE_KEY') }}" | |
data-amount="1000" | |
data-name="Stripe Demo" | |
data-label="決済をする" | |
data-description="Online course about integrating Stripe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use Stripe\Stripe; | |
use Stripe\Customer; | |
use Stripe\Charge; | |
class ChargeController extends Controller |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('content') | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-8 col-md-offset-2"> | |
<div class="panel panel-default"> | |
<div class="panel-heading">Dashboard</div> | |
<div class="panel-body"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function index() | |
{ | |
return view('home'); | |
} | |
public function subscribe_process(Request $request) | |
{ | |
try { | |
Stripe::setApiKey(env('STRIPE_SECRET')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('content') | |
<div class="container"> | |
<div class="row"> | |
<div class="col-md-8 col-md-offset-2"> | |
<div class="panel panel-default"> | |
<div class="panel-heading">Dashboard</div> | |
<div class="panel-body"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function subscribe_cancel(Request $request)//キャンセル用 | |
{ | |
try { | |
Stripe::setApiKey(env('STRIPE_SECRET')); | |
$id = Auth::id();//user_id取得 | |
$user = User::find($id); | |
// すぐにキャンセル | |
$user->subscription('main')->cancelNow(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function connect(){//子ユーザーコネクト作成 | |
define('CLIENT_ID', 'クライアントID');//connectの設置ページにある | |
define('TOKEN_URI', 'https://connect.stripe.com/oauth/token'); | |
define('AUTHORIZE_URI', 'https://connect.stripe.com/oauth/authorize'); | |
if (isset($_GET['code'])) { // Redirect/ code | |
$code = $_GET['code']; | |
$token_request_body = array( | |
'client_secret' => env('STRIPE_SECRET'), | |
'grant_type' => 'authorization_code', | |
'client_id' => CLIENT_ID, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@extends('layouts.app') | |
@section('content') | |
<!-- content | |
================================================== --> | |
<section class="container"> | |
<!--<section class="content">--> | |
<!-- Small boxes (Stat box) --> | |
<div class="row"> | |
<div class="col-md-12"> | |
<a href="{{$url}}"><button type="button" class="btn btn-primary">コネクト</button></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="{{ app()->getLocale() }}"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<!-- CSRF Token --> | |
<meta name="csrf-token" content="{{ csrf_token() }}"> |
OlderNewer