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 +}