forked from go-packages/paypal
README headers
This commit is contained in:
parent
17cb42ea4f
commit
5eab9b94ed
48
README.md
48
README.md
|
@ -2,9 +2,9 @@
|
||||||
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/logpacker/PayPal-Go-SDK)
|
[![Godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/logpacker/PayPal-Go-SDK)
|
||||||
[![Chat at https://gitter.im/logpacker/PayPal-Go-SDK](https://img.shields.io/badge/gitter-dev_chat-46bc99.svg)](https://gitter.im/logpacker/PayPal-Go-SDK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
[![Chat at https://gitter.im/logpacker/PayPal-Go-SDK](https://img.shields.io/badge/gitter-dev_chat-46bc99.svg)](https://gitter.im/logpacker/PayPal-Go-SDK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||||
|
|
||||||
#### GO client for PayPal REST API
|
### GO client for PayPal REST API
|
||||||
|
|
||||||
#### Coverage
|
### Coverage
|
||||||
* POST /v1/oauth2/token
|
* POST /v1/oauth2/token
|
||||||
* POST /v1/payments/payment
|
* POST /v1/payments/payment
|
||||||
* GET /v1/payments/payment/**ID**
|
* GET /v1/payments/payment/**ID**
|
||||||
|
@ -29,10 +29,10 @@
|
||||||
* PUT /v1/payment-experience/web-profiles/**ID**
|
* PUT /v1/payment-experience/web-profiles/**ID**
|
||||||
* DELETE /v1/payment-experience/web-profiles/**ID**
|
* DELETE /v1/payment-experience/web-profiles/**ID**
|
||||||
|
|
||||||
#### Missing endpoints
|
### Missing endpoints
|
||||||
It is possible that some endpoints are missing in this SDK Client, but you can use built-in **paypalsdk** functions to perform a request: **NewClient -> NewRequest -> SendWithAuth**
|
It is possible that some endpoints are missing in this SDK Client, but you can use built-in **paypalsdk** functions to perform a request: **NewClient -> NewRequest -> SendWithAuth**
|
||||||
|
|
||||||
#### Create Client
|
### Create Client
|
||||||
|
|
||||||
```go
|
```go
|
||||||
import "github.com/logpacker/PayPal-Go-SDK"
|
import "github.com/logpacker/PayPal-Go-SDK"
|
||||||
|
@ -44,13 +44,13 @@ c, err := paypalsdk.NewClient("clientID", "secretID", paypalsdk.APIBaseSandBox)
|
||||||
c.SetLog(os.Stdout) // Set log to terminal stdout
|
c.SetLog(os.Stdout) // Set log to terminal stdout
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get access token
|
### Get access token
|
||||||
```go
|
```go
|
||||||
// When you will have authorization_code you can get an access_token
|
// When you will have authorization_code you can get an access_token
|
||||||
accessToken, err := c.GetAccessToken()
|
accessToken, err := c.GetAccessToken()
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Create direct paypal payment
|
### Create direct paypal payment
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Now we can create a paypal payment
|
// Now we can create a paypal payment
|
||||||
|
@ -101,7 +101,7 @@ p := paypalsdk.Payment{
|
||||||
paymentResponse, err := client.CreatePayment(p)
|
paymentResponse, err := client.CreatePayment(p)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Execute approved payment
|
### Execute approved payment
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// And the last step is to execute approved payment
|
// And the last step is to execute approved payment
|
||||||
|
@ -112,53 +112,53 @@ payerID := "7E7MGXCWTTKK2"
|
||||||
executeResult, err := c.ExecuteApprovedPayment(paymentID, payerID)
|
executeResult, err := c.ExecuteApprovedPayment(paymentID, payerID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get payment by ID
|
### Get payment by ID
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Get created payment info
|
// Get created payment info
|
||||||
payment, err := c.GetPayment(paymentID)
|
payment, err := c.GetPayment(paymentID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get list of payments
|
### Get list of payments
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Get all payments slice
|
// Get all payments slice
|
||||||
payments, err := c.GetPayments()
|
payments, err := c.GetPayments()
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get authorization by ID
|
### Get authorization by ID
|
||||||
|
|
||||||
```go
|
```go
|
||||||
authID := "2DC87612EK520411B"
|
authID := "2DC87612EK520411B"
|
||||||
auth, err := c.GetAuthorization(authID)
|
auth, err := c.GetAuthorization(authID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Capture authorization
|
### Capture authorization
|
||||||
|
|
||||||
```go
|
```go
|
||||||
capture, err := c.CaptureAuthorization(authID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"}, true)
|
capture, err := c.CaptureAuthorization(authID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"}, true)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Void authorization
|
### Void authorization
|
||||||
|
|
||||||
```go
|
```go
|
||||||
auth, err := c.VoidAuthorization(authID)
|
auth, err := c.VoidAuthorization(authID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Reauthorize authorization
|
### Reauthorize authorization
|
||||||
|
|
||||||
```go
|
```go
|
||||||
auth, err := c.ReauthorizeAuthorization(authID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"})
|
auth, err := c.ReauthorizeAuthorization(authID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"})
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get Sale by ID
|
### Get Sale by ID
|
||||||
|
|
||||||
```go
|
```go
|
||||||
saleID := "36C38912MN9658832"
|
saleID := "36C38912MN9658832"
|
||||||
sale, err := c.GetSale(saleID)
|
sale, err := c.GetSale(saleID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Refund Sale by ID
|
### Refund Sale by ID
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Full
|
// Full
|
||||||
|
@ -167,38 +167,38 @@ refund, err := c.RefundSale(saleID, nil)
|
||||||
refund, err := c.RefundSale(saleID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"})
|
refund, err := c.RefundSale(saleID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"})
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get Refund by ID
|
### Get Refund by ID
|
||||||
|
|
||||||
```go
|
```go
|
||||||
orderID := "O-4J082351X3132253H"
|
orderID := "O-4J082351X3132253H"
|
||||||
refund, err := c.GetRefund(orderID)
|
refund, err := c.GetRefund(orderID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Get Order by ID
|
### Get Order by ID
|
||||||
|
|
||||||
```go
|
```go
|
||||||
order, err := c.GetOrder(orderID)
|
order, err := c.GetOrder(orderID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Authorize Order
|
### Authorize Order
|
||||||
|
|
||||||
```go
|
```go
|
||||||
auth, err := c.AuthorizeOrder(orderID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"})
|
auth, err := c.AuthorizeOrder(orderID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"})
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Capture Order
|
### Capture Order
|
||||||
|
|
||||||
```go
|
```go
|
||||||
capture, err := c.CaptureOrder(orderID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"}, true, nil)
|
capture, err := c.CaptureOrder(orderID, &paypalsdk.Amount{Total: "7.00", Currency: "USD"}, true, nil)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Void Order
|
### Void Order
|
||||||
|
|
||||||
```go
|
```go
|
||||||
order, err := c.VoidOrder(orderID)
|
order, err := c.VoidOrder(orderID)
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Identity
|
### Identity
|
||||||
|
|
||||||
```go
|
```go
|
||||||
// Retreive tolen by authorization code
|
// Retreive tolen by authorization code
|
||||||
|
@ -207,13 +207,13 @@ token, err := c.GrantNewAccessTokenFromAuthCode("<Authorization-Code>", "http://
|
||||||
token, err := c.GrantNewAccessTokenFromRefreshToken("<Refresh-Token>")
|
token, err := c.GrantNewAccessTokenFromRefreshToken("<Refresh-Token>")
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Retreive user information
|
### Retreive user information
|
||||||
|
|
||||||
```go
|
```go
|
||||||
userInfo, err := c.GetUserInfo("openid")
|
userInfo, err := c.GetUserInfo("openid")
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Create single payout to email
|
### Create single payout to email
|
||||||
|
|
||||||
```go
|
```go
|
||||||
payout := paypalsdk.Payout{
|
payout := paypalsdk.Payout{
|
||||||
|
@ -292,7 +292,7 @@ err := c.SetWebProfile(webprofile)
|
||||||
err := c.DeleteWebProfile("XP-CP6S-W9DY-96H8-MVN2")
|
err := c.DeleteWebProfile("XP-CP6S-W9DY-96H8-MVN2")
|
||||||
```
|
```
|
||||||
|
|
||||||
#### How to Contribute
|
### How to Contribute
|
||||||
|
|
||||||
* Fork a repository
|
* Fork a repository
|
||||||
* Add/Fix something
|
* Add/Fix something
|
||||||
|
|
Loading…
Reference in New Issue
Block a user