diff --git a/README.md b/README.md index 5dff0a5..1b7a836 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,10 @@ Currently supports **v2** only, if you want to use **v1**, use **v1.1.4** git ta * PATCH /v1/vault/credit-cards/**ID** * GET /v1/vault/credit-cards/**ID** * GET /v1/vault/credit-cards - * GET /v2/payments/authorization/**ID** - * POST /v2/payments/authorization/**ID**/capture - * POST /v2/payments/authorization/**ID**/void - * POST /v2/payments/authorization/**ID**/reauthorize + * GET /v2/payments/authorizations/**ID** + * POST /v2/payments/authorizations/**ID**/capture + * POST /v2/payments/authorizations/**ID**/void + * POST /v2/payments/authorizations/**ID**/reauthorize * GET /v2/payments/sale/**ID** * POST /v2/payments/sale/**ID**/refund * GET /v2/payments/refund/**ID** @@ -37,10 +37,12 @@ Currently supports **v2** only, if you want to use **v1**, use **v1.1.4** git ta * PATCH /v2/checkout/orders/**ID** * POST /v2/checkout/orders/**ID**/authorize * POST /v2/checkout/orders/**ID**/capture + * GET /v2/payments/billing-plans * POST /v2/payments/billing-plans * PATCH /v2/payments/billing-plans/***ID*** * POST /v2/payments/billing-agreements * POST /v2/payments/billing-agreements/***TOKEN***/agreement-execute + * POST /v1/notifications/verify-webhook-signature ### Missing endpoints It is possible that some endpoints are missing in this SDK Client, but you can use built-in **paypal** functions to perform a request: **NewClient -> NewRequest -> SendWithAuth** diff --git a/authorization.go b/authorization.go index 8438fd6..2f9b353 100644 --- a/authorization.go +++ b/authorization.go @@ -7,7 +7,7 @@ import ( ) // GetAuthorization returns an authorization by ID -// Endpoint: GET /v2/payments/authorization/ID +// Endpoint: GET /v2/payments/authorizations/ID func (c *Client) GetAuthorization(authID string) (*Authorization, error) { buf := bytes.NewBuffer([]byte("")) req, err := http.NewRequest("GET", fmt.Sprintf("%s%s%s", c.APIBase, "/v2/payments/authorizations/", authID), buf) @@ -37,7 +37,7 @@ func (c *Client) CaptureAuthorization(authID string, paymentCaptureRequest *Paym } // VoidAuthorization voids a previously authorized payment -// Endpoint: POST /v2/payments/authorization/ID/void +// Endpoint: POST /v2/payments/authorizations/ID/void func (c *Client) VoidAuthorization(authID string) (*Authorization, error) { buf := bytes.NewBuffer([]byte("")) req, err := http.NewRequest("POST", fmt.Sprintf("%s%s", c.APIBase, "/v2/payments/authorizations/"+authID+"/void"), buf) @@ -53,7 +53,7 @@ func (c *Client) VoidAuthorization(authID string) (*Authorization, error) { // ReauthorizeAuthorization reauthorize a Paypal account payment. // PayPal recommends to reauthorize payment after ~3 days -// Endpoint: POST /v2/payments/authorization/ID/reauthorize +// Endpoint: POST /v2/payments/authorizations/ID/reauthorize func (c *Client) ReauthorizeAuthorization(authID string, a *Amount) (*Authorization, error) { buf := bytes.NewBuffer([]byte(`{"amount":{"currency":"` + a.Currency + `","total":"` + a.Total + `"}}`)) req, err := http.NewRequest("POST", fmt.Sprintf("%s%s", c.APIBase, "/v2/payments/authorizations/"+authID+"/reauthorize"), buf)