Package paypal provides a PayPal SDK.
-
Get package:
go get -u github.com/arthurwhite/paypal/...
-
Import it in your code:
import "github.com/arthurwhite/paypal"
Make a new client:
pp := &paypal.Client{
Token: "G-ddvHQfRB2wqzrHCgdkbx0uXEcgKTcWbG2GjlI581zbPbGxKekGXgyVwU0",
Production: false,
}
Import package pdt in your code:
import "github.com/arthurwhite/paypal/pdt"
Use pdt.GetTransaction to retreive a transaction by its ID:
tx, _ := pdt.GetTransaction(pp, "EPC66XON1D4EE27M9")
fmt.Println(tx)