From 27ffa97190a19664c2f48fd6a5c75e031c523acb Mon Sep 17 00:00:00 2001 From: euphoria-laxis Date: Tue, 22 Oct 2024 14:22:41 +0200 Subject: [PATCH 1/4] Add vendor directory to .gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index d48c759..e5b38e2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -.vscode \ No newline at end of file +.vscode +vendor/ \ No newline at end of file From 6217511bbda3713612ee23f22a3e7c888bf9a029 Mon Sep 17 00:00:00 2001 From: euphoria-laxis Date: Tue, 22 Oct 2024 14:23:53 +0200 Subject: [PATCH 2/4] Add omitempty to JSON tags to PaymentSourceCard type --- types.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/types.go b/types.go index af048e7..edeb0c5 100644 --- a/types.go +++ b/types.go @@ -1057,14 +1057,14 @@ type ( // PaymentSourceCard structure PaymentSourceCard struct { - ID string `json:"id"` - Name string `json:"name"` - Number string `json:"number"` - Expiry string `json:"expiry"` - SecurityCode string `json:"security_code"` - LastDigits string `json:"last_digits"` - CardType string `json:"card_type"` - BillingAddress *CardBillingAddress `json:"billing_address"` + ID string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Number string `json:"number,omitempty"` + Expiry string `json:"expiry,omitempty"` + SecurityCode string `json:"security_code,omitempty"` + LastDigits string `json:"last_digits,omitempty"` + CardType string `json:"card_type,omitempty"` + BillingAddress *CardBillingAddress `json:"billing_address,omitempty"` } // PaymentSourcePaypal structure From f840b7aac72040c6ba1665617ddda19e971f4eb8 Mon Sep 17 00:00:00 2001 From: euphoria-laxis Date: Tue, 22 Oct 2024 14:24:37 +0200 Subject: [PATCH 3/4] Add omitempty to JSON tags to CardBillingAddress AddressLine2 and AdminArea2 --- types.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types.go b/types.go index edeb0c5..aa3d12e 100644 --- a/types.go +++ b/types.go @@ -1086,8 +1086,8 @@ type ( // CardBillingAddress structure CardBillingAddress struct { AddressLine1 string `json:"address_line_1"` - AddressLine2 string `json:"address_line_2"` - AdminArea2 string `json:"admin_area_2"` + AddressLine2 string `json:"address_line_2,omitempty"` + AdminArea2 string `json:"admin_area_2,omitempty"` AdminArea1 string `json:"admin_area_1"` PostalCode string `json:"postal_code"` CountryCode string `json:"country_code"` From fb37ee85f224f629dbd8f64c2cdca30fd908d707 Mon Sep 17 00:00:00 2001 From: euphoria-laxis Date: Tue, 22 Oct 2024 15:26:07 +0200 Subject: [PATCH 4/4] Update package name --- go.mod | 2 +- invoicing_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 13baae2..50267af 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/plutov/paypal/v4 +module euphoria-laxis.fr/go-packages/paypale/v4 go 1.23 diff --git a/invoicing_test.go b/invoicing_test.go index 7fc0b9f..e978ee4 100644 --- a/invoicing_test.go +++ b/invoicing_test.go @@ -5,7 +5,7 @@ import ( "encoding/json" "testing" - "github.com/plutov/paypal/v4" + "euphoria-laxis.fr/go-packages/paypale/v4" "github.com/stretchr/testify/assert" )