mirror of
https://github.com/plutov/paypal.git
synced 2025-01-23 02:11:02 +01:00
Update endpoints in coverage section in README (#132)
This commit is contained in:
parent
5822d5ee58
commit
89088bee4e
10
README.md
10
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**
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user