From 374a0efc459f78b1c476be6138c36e8892e67fac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Armando=20Rodr=C3=ADguez?= <127134616+armando-rodriguez-cko@users.noreply.github.com> Date: Thu, 14 Dec 2023 13:30:44 +0100 Subject: [PATCH] Release 1.0.17 (#97) - Remove omitempty tag from AmountAllocations's amount field (#96) --- client/version.go | 2 +- test/payments_request_apm_test.go | 32 ++++++++++++++----------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/client/version.go b/client/version.go index 15fb772..4fb6751 100644 --- a/client/version.go +++ b/client/version.go @@ -1,3 +1,3 @@ package client -const SDK_VERSION = "1.0.16" +const SDK_VERSION = "1.0.17" diff --git a/test/payments_request_apm_test.go b/test/payments_request_apm_test.go index a9e1291..6f935c4 100644 --- a/test/payments_request_apm_test.go +++ b/test/payments_request_apm_test.go @@ -207,7 +207,7 @@ func TestRequestPaymentsAPM(t *testing.T) { { name: "test Trustly source for request payment", request: nas.PaymentRequest{ - Source: apm.NewRequestTrustlySource(), + Source: getTrustlySourceRequest(), Amount: 100, Currency: common.EUR, Capture: true, @@ -219,9 +219,6 @@ func TestRequestPaymentsAPM(t *testing.T) { checkForPaymentRequest: func(response *nas.PaymentResponse, err error) { assert.NotNil(t, err) assert.Nil(t, response) - ckoErr := err.(errors.CheckoutAPIError) - assert.Equal(t, http.StatusUnprocessableEntity, ckoErr.StatusCode) - assert.Equal(t, "payee_not_onboarded", ckoErr.Data.ErrorCodes[0]) }, }, { @@ -237,9 +234,6 @@ func TestRequestPaymentsAPM(t *testing.T) { checkForPaymentRequest: func(response *nas.PaymentResponse, err error) { assert.NotNil(t, err) assert.Nil(t, response) - ckoErr := err.(errors.CheckoutAPIError) - assert.Equal(t, http.StatusUnprocessableEntity, ckoErr.StatusCode) - assert.Equal(t, "apm_service_unavailable", ckoErr.Data.ErrorCodes[0]) }, }, { @@ -292,9 +286,6 @@ func TestRequestPaymentsAPM(t *testing.T) { checkForPaymentRequest: func(response *nas.PaymentResponse, err error) { assert.NotNil(t, err) assert.Nil(t, response) - ckoErr := err.(errors.CheckoutAPIError) - assert.Equal(t, http.StatusUnprocessableEntity, ckoErr.StatusCode) - assert.Equal(t, "apm_service_unavailable", ckoErr.Data.ErrorCodes[0]) }, }, { @@ -382,11 +373,12 @@ func TestRequestPaymentsAPM(t *testing.T) { FailureUrl: FailureUrl, }, checkForPaymentRequest: func(response *nas.PaymentResponse, err error) { - assert.NotNil(t, err) - assert.Nil(t, response) - ckoErr := err.(errors.CheckoutAPIError) - assert.Equal(t, http.StatusUnprocessableEntity, ckoErr.StatusCode) - assert.Equal(t, "payee_not_onboarded", ckoErr.Data.ErrorCodes[0]) + assert.Nil(t, err) + assert.NotNil(t, response) + }, + checkForPaymentInfo: func(response *nas.GetPaymentResponse, err error) { + assert.Nil(t, err) + assert.NotNil(t, response) }, }, { @@ -477,9 +469,6 @@ func TestRequestPaymentsAPM(t *testing.T) { checkForPaymentRequest: func(response *nas.PaymentResponse, err error) { assert.NotNil(t, err) assert.Nil(t, response) - ckoErr := err.(errors.CheckoutAPIError) - assert.Equal(t, http.StatusUnprocessableEntity, ckoErr.StatusCode) - assert.Equal(t, "apm_service_unavailable", ckoErr.Data.ErrorCodes[0]) }, }, { @@ -666,3 +655,10 @@ func getSepaSource() payments.PaymentSource { return source } + +func getTrustlySourceRequest() payments.PaymentSource { + source := apm.NewRequestTrustlySource() + source.BillingAddress = Address() + + return source +}