Go client for the PayPal REST API
First we create a gopaypal client
client := NewClient(clientID, secretKey, URL)
Then we can start by getting PayPal OAuth2 token
tokenResponse, err := client.GetAccessToken()
You dont really need to get the token response. The client will save your token and update it when needed. After we have the token we can start calling the PayPal REST API. For more information check the tests
You can still use gopaypal even if the endpoint you look for is missing. Create a client and use AuthRequest
or BasicRequest
Testing gopaypal involves the following mandatory command line arguments:
clientid
Your application client identifiersecret
Your application secret keyredirect
Your application redirect URL. Must match your redirect URL of your PayPal application
The following arguments are optional:
token
PayPal OAuth2 token. You can pass this argument to skip the OAuth testiden
Identifier code given by PayPal after a successful login using the identity API. You should pass this argument in order to test several identity API functionspaymentid
Payment identifier to test the execution of an approved PayPal paymentpayerid
Payer identifier to test the execution of an approved PayPal payment
gopaypal is made available under the MIT license