paypal

package
v0.0.0-...-a11cca7 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTransactionNotFound = errors.New("pdt: transaction not found")
)

Errors

Functions

This section is empty.

Types

type Email

type Email struct {
	Email *mail.Address
}

func (*Email) UnmarshalText

func (e *Email) UnmarshalText(text []byte) (err error)

type Time

type Time struct {
	Time *time.Time
}

func (*Time) UnmarshalText

func (t *Time) UnmarshalText(text []byte) (err error)

type Transaction

type Transaction struct {
	ID                    string  `schema:"txn_id"`
	Type                  string  `schema:"txn_type"`
	Subject               string  `schema:"transaction_subject"`
	Business              Email   `schema:"business"`
	Custom                string  `schema:"custom"`
	Invoice               string  `schema:invoice`
	ReceiptID             string  `schema:receipt_ID`
	FirstName             string  `schema:"first_name"`
	HandlingAmount        float64 `schema:"handling_amount"`
	ItemNumber            string  `schema:"item_number"`
	ItemName              string  `schema:"item_name"`
	LastName              string  `schema:"last_name"`
	MerchantCurrency      string  `schema:"mc_currency"`
	MerchantFee           float64 `schema:"mc_fee"`
	MerchantGross         float64 `schema:"mc_gross"`
	PayerEmail            Email   `schema:"payer_email"`
	PayerID               string  `schema:"payer_id"`
	PayerStatus           string  `schema:"payer_status"`
	PaymentDate           Time    `schema:"payment_date"`
	PaymentFee            float64 `schema:"payment_fee"`
	PaymentGross          float64 `schema:"payment_gross"`
	PaymentStatus         string  `schema:"payment_status"`
	PaymentType           string  `schema:"payment_type"`
	ProtectionEligibility string  `schema:"protection_eligibility"`
	Quantity              int64   `schema:"quantity"`
	ReceiverID            string  `schema:"receiver_id"`
	ReceiverEmail         Email   `schema:"receiver_email"`
	ResidenceCountry      string  `schema:"residence_country"`
	Shipping              float64 `schema:"shipping"`
	Tax                   float64 `schema:"tax"`
	AddressCountry        string  `schema:"address_country"`
	TestIPN               int64   `schema:"test_ipn"`
	AddressStatus         string  `schema:"address_status"`
	AddressStreet         string  `schema:"address_street"`
	NotifyVersion         float64 `schema:"notify_version"`
	AddressCity           string  `schema:"address_city"`
	VerifySign            string  `schema:"verify_sign"`
	AddressState          string  `schema:"address_state"`
	Charset               string  `schema:"charset"`
	AddressName           string  `schema:"address_name"`
	AddressCountryCode    string  `schema:"address_country_code"`
	AddressZip            int64   `schema:"address_zip"`
	SubscriberID          string  `schema:"subscr_id"`
	TestPDT               int64   `schema:"test_pdt"`
}

Transaction is a PDT transaction. See https://developer.paypal.com/docs/classic/ipn/integration-guide/IPNandPDTVariables.

BUG(arthurwhite): Can't handle multiple items from a shopping cart transaction.

func ParseTransaction

func ParseTransaction(r io.Reader) (*Transaction, error)

func ReadNotification

func ReadNotification(vals url.Values) *Transaction

ReadNotification reads a notification from an //IPN request

Notes

Bugs

  • Can't handle multiple items from a shopping cart transaction.

Jump to

Keyboard shortcuts

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