cypay

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

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

README

cypay

cy 支付

Documentation

Index

Constants

View Source
const (
	ENVByAppEnv = "APP_ENV"
	ENVPRD      = "prd"
)

Variables

This section is empty.

Functions

func AppleTime

func AppleTime(t any) (time.Time, error)

func GetAppleLatestReceiptInfo

func GetAppleLatestReceiptInfo(rsp *apple.VerifyResponse) (*apple.LatestReceiptInfo, error)

GetAppleLatestReceiptInfo 获取第一个数据

func IsPrd

func IsPrd() bool

func NotificationTypeSubtypeExpire

func NotificationTypeSubtypeExpire(notificationType, subtype string) bool

NotificationTypeSubtypeExpire 取消用户会员

func NotificationTypeSubtypeJoinVIP

func NotificationTypeSubtypeJoinVIP(notificationType, subtype string) bool

NotificationTypeSubtypeJoinVIP 根据状态继续是会员

Types

type AppleNotifications

type AppleNotifications struct {
	SignedPayload   string                       `json:"signed_payload"`
	Payload         *apple.NotificationV2Payload `json:"payload"`
	RenewalInfo     *apple.RenewalInfo           `json:"renewal_info"`
	TransactionInfo *apple.TransactionInfo       `json:"transaction_info"`
}

type AppleNotificationsHandler

type AppleNotificationsHandler func(notifications *AppleNotifications) error

type ApplePay

type ApplePay struct {
	Pwd string
}

func NewApplePay

func NewApplePay(pwd string) *ApplePay

func (*ApplePay) HandlerNotifications

func (a *ApplePay) HandlerNotifications(signedPayload string, handlers ...AppleNotificationsHandler) error

HandlerNotifications 支付回调用

func (*ApplePay) ParseNotifications

func (a *ApplePay) ParseNotifications(signedPayload string) (*AppleNotifications, error)

ParseNotifications 苹果支付回调解析

func (*ApplePay) VerifyReceipt

func (a *ApplePay) VerifyReceipt(receipt string) (*apple.VerifyResponse, error)

type Exception

type Exception struct {
	Code    int
	Message string
}

func NewException

func NewException(code int) *Exception

func (*Exception) Error

func (p *Exception) Error() string

Jump to

Keyboard shortcuts

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