gopay

package module
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2024 License: GPL-3.0 Imports: 14 Imported by: 0

README

Go用PayPayクライアント

Goで書かれた非公式のPayPayクライアント

インストール

go get github.com/RabiesDev/gopay

使い方

import (
    "fmt"
    "github.com/RabiesDev/gopay"
)

func main() {
    paypay, err := gopay.New(&gopay.PayPayConfig{})
    if err != nil {
        panic(err)
    }

    if err = paypay.SignIn(func() (*string, error) {
        // ここにOTPを取得するコード
        oneTimePassword := "0000"
        return &oneTimePassword, nil
    }); err != nil {
        panic(err)
    }

    fmt.Println("token", paypay.AccessToken)
}

貢献

プロジェクトへの貢献はいつでも歓迎しています

ライセンス

このプロジェクトはGPL-3.0ライセンスです

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MoneyLinkData added in v1.0.2

type MoneyLinkData struct {
	VerificationCode string
	SenderName       string
	ChatRoomID       string
	OrderID          string
	RequestID        string
	MessageID        string
	Status           string
	Amount           int64
}

type PayPayClient added in v1.0.2

type PayPayClient struct {
	HttpClient *http.Client
	Config     *PayPayConfig

	AccessToken  string
	RefreshToken string
	// contains filtered or unexported fields
}

func New

func New(config *PayPayConfig) (*PayPayClient, error)
func (paypay *PayPayClient) AcceptMoneyLink(linkData *MoneyLinkData, passcode *string) error
func (paypay *PayPayClient) CreateMoneyLink(amount int64, passcode *string) (*string, error)

func (*PayPayClient) GetLinkData added in v1.0.2

func (paypay *PayPayClient) GetLinkData(verificationCode string) (*MoneyLinkData, error)

func (*PayPayClient) GetWalletAmount added in v1.0.2

func (paypay *PayPayClient) GetWalletAmount() (int64, error)

func (*PayPayClient) SignIn added in v1.0.2

func (paypay *PayPayClient) SignIn(acquireOneTimePassword func() (*string, error)) error

type PayPayConfig added in v1.0.2

type PayPayConfig struct {
	Proxy       string
	Language    string
	AppVersion  string
	ClientUUID  string
	PhoneNumber string
	Password    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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