Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ require (
github.com/EasyPost/easypost-go/v2 v2.20.0
github.com/EasyPost/easypost-go/v3 v3.2.0
github.com/EasyPost/easypost-go/v4 v4.6.0
github.com/EasyPost/easypost-go/v5 v5.0.0
)
5 changes: 4 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@ github.com/EasyPost/easypost-go/v3 v3.2.0 h1:dNWmPG1AkpgYFJxhw/zGzCz1JOVXPpNIi8+
github.com/EasyPost/easypost-go/v3 v3.2.0/go.mod h1:WDD0qkjwxedVKFXCcdJBz22rtRHpuxjGazgSVcTfdIw=
github.com/EasyPost/easypost-go/v4 v4.6.0 h1:wxMK4wkGEG5vW/4Vdy3rwE9iqww1eQ1xS6oYWUZbhrc=
github.com/EasyPost/easypost-go/v4 v4.6.0/go.mod h1:WGoS4tmjHquhooMNmY6RirP+KWeYV/akcf/Jg9Q6fsk=
github.com/EasyPost/easypost-go/v5 v5.0.0 h1:w6Jp4wBD0Desgk4a1kbJpbEMexBYMz9VWPPrFeTdsak=
github.com/EasyPost/easypost-go/v5 v5.0.0/go.mod h1:wUxStg92sBzWO3m2yoFAN7CbZTr25zQeFog48itvfnw=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ=
github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM=
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8=
github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
12 changes: 12 additions & 0 deletions official/docs/curl/current/billing/add-stripe-bank-account.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
curl -X POST "https://api.easypost.com/v2/bank_accounts" \
-u "$REFERRAL_USER_API_KEY:" \
-H "Content-Type: application/json" \
-d '{
"financial_connections_id": "fca_...",
"mandate_data": {
"ip_address": "127.0.0.1",
"user_agent": "Mozilla/5.0",
"accepted_at": 1722510730,
},
"priority": "primary"
}'
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
curl -X POST "https://api.easypost.com/v2/credit_cards" \
-u "$REFERRAL_USER_API_KEY:" \
-H "Content-Type: application/json" \
-d '{
"credit_card": {
"payment_method_id": "pm_...",
"priority": "primary"
}
}'
12 changes: 0 additions & 12 deletions official/docs/curl/current/billing/create-bank-account.sh

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func createAndVerify() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/addresses/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func create() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/addresses/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func list() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/addresses/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func retrieve() {
Expand Down
4 changes: 2 additions & 2 deletions official/docs/golang/current/addresses/verify-param.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func verifyParam() {
Expand All @@ -20,7 +20,7 @@ func verifyParam() {
Phone: "5555555555",
},
&easypost.CreateAddressOptions{
Verify: []string{"true"},
Verify: true,
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func verifyStrictParam() {
Expand All @@ -20,7 +20,7 @@ func verifyStrictParam() {
Phone: "5555555555",
},
&easypost.CreateAddressOptions{
VerifyStrict: []string{"true"},
VerifyStrict: true,
},
)

Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/addresses/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func verify() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/api-keys/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func retrieve() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/add-shipments.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func addShipments() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/buy.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func buy() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func create() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/label.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func label() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func list() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/remove-shipments.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func removeShipments() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/retrieve.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func retrieve() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/batches/scan-forms.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func scanForms() {
Expand Down
24 changes: 24 additions & 0 deletions official/docs/golang/current/billing/add-stripe-bank-account.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func addStripeBankAccount() {
client := easypost.New("EASYPOST_API_KEY")

bankAccount, _ := client.AddReferralCustomerBankAccountFromStripe(
"REFERRAL_USER_API_KEY",
"fca_...",
&easypost.MandateData{
IpAddress: "127.0.0.1",
UserAgent: "Mozilla/5.0",
AcceptedAt: 1722510730,
},
easypost.PrimaryPaymentMethodPriority,
)

fmt.Println(bankAccount)
}
19 changes: 19 additions & 0 deletions official/docs/golang/current/billing/add-stripe-credit-card.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func addStripeCreditCard() {
client := easypost.New("EASYPOST_API_KEY")

creditCard, _ := client.AddReferralCustomerCreditCardFromStripe(
"REFERRAL_USER_API_KEY",
"seti_123",
easypost.PrimaryPaymentMethodPriority,
)

fmt.Println(creditCard)
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func createEpCreditCard() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func createStripeBankAccountSecret() {
client := easypost.New("EASYPOST_API_KEY")

response, _ := client.BetaCreateBankAccountClientSecret()

fmt.Println(response)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package example

import (
"fmt"

"github.com/EasyPost/easypost-go/v5"
)

func createStripeCreditCardSecret() {
client := easypost.New("EASYPOST_API_KEY")

response, _ := client.BetaCreateCreditCardClientSecret()

fmt.Println(response)
}
2 changes: 1 addition & 1 deletion official/docs/golang/current/billing/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func delete() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/billing/fund.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package example

import (
"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func fund() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/billing/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func list() {
Expand Down
4 changes: 2 additions & 2 deletions official/docs/golang/current/brand/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func brand() {
client := easypost.New("EASYPOST_API_KEY")

brand, _ := client.UpdateBrand(
"user_...",
map[string]interface{}{
"color": "#303F9F",
},
"user_...",
)

fmt.Println(brand)
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/carrier-accounts/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func create() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/carrier-accounts/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func delete() {
Expand Down
2 changes: 1 addition & 1 deletion official/docs/golang/current/carrier-accounts/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func list() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package example
import (
"fmt"

"github.com/EasyPost/easypost-go/v4"
"github.com/EasyPost/easypost-go/v5"
)

func retrieve() {
Expand Down
Loading
Loading