Help us shape the future of Go! Take the 2026 Go Developer Survey

paypalauth

package module
v0.0.0-...-8daefb7 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: MIT Imports: 6 Imported by: 1

README

github.com/taichi-hagiwara/paypalauth

Connect with PayPal を Go でやるよ。

OAuth2 でログインしたあとに userinfo を取得するところまでできるよ。それしかできないよ。

Usage

取得する

go get github.com/taichi-hagiwara/paypalauth

使う

import "github.com/taichi-hagiwara/paypalauth"

詳しい使い方は example/serve を見てね。

TODO

  • godoc を英語にしたいよ。

  • テストを書きたいよ。

License

MIT

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LiveEndpoint = Endpoint{
	RootURL: "https://api.paypal.com",
	AuthURL: "https://www.paypal.com/connect",
}

LiveEndpoint は、本番環境のエンドポイント。

View Source
var SandboxEndpoint = Endpoint{
	RootURL: "https://api.sandbox.paypal.com",
	AuthURL: "https://www.sandbox.paypal.com/connect",
}

SandboxEndpoint は、サンドボックス環境のエンドポイント。

Functions

This section is empty.

Types

type Client

type Client struct {
	ClientID     string
	ClientSecret string
	Endpoint     Endpoint
}

Client は、クライアント。

func (*Client) OAuth2Config

func (c *Client) OAuth2Config(redirectURL string, scopes ...string) *oauth2.Config

OAuth2Config は、 *oauth2.Config を得る。

func (*Client) Token

func (c *Client) Token(token *oauth2.Token) *Token

Token は、 *oauth2.Token から *Token を得る。

type Endpoint

type Endpoint struct {
	RootURL string
	AuthURL string
}

Endpoint は、paypal API エンドポイントを表す。

type Token

type Token struct {
	Client      *Client
	OAuth2Token *oauth2.Token
}

Token は、アクセス トークン。

func (*Token) UserInfo

func (t *Token) UserInfo(ctx context.Context, result interface{}) error

UserInfo は、ユーザ情報を取得する。

Directories

Path Synopsis
example
serve module

Jump to

Keyboard shortcuts

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