-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds and update properties. Subdomains for merchants support (#103)
* Add documents to OnboardEntityRequest * Add ChallengeNotificationUrl to nonHostedCompletion * Update PaymentContextDetailsResponse * Add subdomain for merchants
- Loading branch information
1 parent
0ff79c3
commit 0f47e52
Showing
17 changed files
with
411 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
package test | ||
|
||
import ( | ||
"net/http" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
|
||
"github.com/checkout/checkout-sdk-go/configuration" | ||
"github.com/checkout/checkout-sdk-go/mocks" | ||
) | ||
|
||
func TestShouldCreateConfiguration(t *testing.T) { | ||
credentials := new(mocks.CredentialsMock) | ||
environment := configuration.Production() | ||
subdomain := configuration.NewEnvironmentSubdomain(environment, "123dmain") | ||
subdomainBad := configuration.NewEnvironmentSubdomain(environment, "baddomain") | ||
|
||
cases := []struct { | ||
name string | ||
configuration *configuration.Configuration | ||
checker func(*configuration.Configuration, error) | ||
}{ | ||
{ | ||
name: "should create a configuration object", | ||
configuration: configuration.NewConfiguration(credentials, environment, &http.Client{}, nil), | ||
checker: func(configuration *configuration.Configuration, err error) { | ||
assert.NotNil(t, configuration) | ||
}, | ||
}, | ||
{ | ||
name: "should create a configuration object with a valid subdomain", | ||
configuration: configuration.NewConfigurationWithSubdomain(credentials, environment, subdomain, &http.Client{}, nil), | ||
checker: func(configuration *configuration.Configuration, err error) { | ||
assert.NotNil(t, configuration) | ||
assert.Equal(t, "https://123dmain.api.checkout.com", configuration.EnvironmentSubdomain.ApiUrl) | ||
}, | ||
}, | ||
{ | ||
name: "should create a configuration object with a invalid subdomain", | ||
configuration: configuration.NewConfigurationWithSubdomain(credentials, environment, subdomainBad, &http.Client{}, nil), | ||
checker: func(configuration *configuration.Configuration, err error) { | ||
assert.NotNil(t, configuration) | ||
assert.Equal(t, "https://api.checkout.com", configuration.EnvironmentSubdomain.ApiUrl) | ||
}, | ||
}, | ||
} | ||
|
||
for _, tc := range cases { | ||
t.Run(tc.name, func(t *testing.T) { | ||
tc.checker(tc.configuration, nil) | ||
}) | ||
} | ||
} |
Oops, something went wrong.