Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update api apilayer #1455

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion lib/remote/suppliers/numverify.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (r *NumverifyRequest) ValidateNumber(internationalNumber string) (res *Numv
WithField("number", internationalNumber).
Debug("Running validate operation through Numverify API")

url := fmt.Sprintf("%s/number_verification/validate?number=%s", r.uri, internationalNumber)
url := fmt.Sprintf("%s/api/validate?number=%s", r.uri, internationalNumber)

// Build the request
client := &http.Client{}
Expand Down
12 changes: 6 additions & 6 deletions lib/remote/suppliers/numverify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ func TestNumverifySupplierSuccessCustomApiKey(t *testing.T) {
}

gock.New("https://api.apilayer.com").
Get("/number_verification/validate").
MatchHeader("Apikey", apikey).
Get("/api/validate").
MatchParam("access_key", apikey).
MatchParam("number", number).
Reply(200).
JSON(expectedResult)
Expand All @@ -54,8 +54,8 @@ func TestNumverifySupplierError(t *testing.T) {
}

gock.New("https://api.apilayer.com").
Get("/number_verification/validate").
MatchHeader("Apikey", apikey).
Get("/api/validate").
MatchParam("access_key", apikey).
MatchParam("number", number).
Reply(429).
JSON(expectedResult)
Expand All @@ -78,7 +78,7 @@ func TestNumverifySupplierHTTPError(t *testing.T) {
dummyError := errors.New("test")

gock.New("https://api.apilayer.com").
Get("/number_verification/validate").
Get("/api/validate").
ReplyError(dummyError)

s := NewNumverifySupplier()
Expand All @@ -87,7 +87,7 @@ func TestNumverifySupplierHTTPError(t *testing.T) {
assert.Nil(t, got)
assert.Equal(t, &url.Error{
Op: "Get",
URL: "https://api.apilayer.com/number_verification/validate?number=11115551212",
URL: "https://api.apilayer.com/api/validate?number=11115551212",
Err: dummyError,
}, err)
}
8 changes: 4 additions & 4 deletions web/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ func TestApi(t *testing.T) {
}

gock.New("https://api.apilayer.com").
Get("/number_verification/validate").
MatchHeader("Apikey", "5ad5554ac240e4d3d31107941b35a5eb").
Get("/api/validate").
MatchParam("access_key", "5ad5554ac240e4d3d31107941b35a5eb").
MatchParam("number", number).
Reply(200).
JSON(expectedResult)
Expand Down Expand Up @@ -173,8 +173,8 @@ func TestApi(t *testing.T) {
}

gock.New("https://api.apilayer.com").
Get("/number_verification/validate").
MatchHeader("Apikey", "5ad5554ac240e4d3d31107941b35a5eb").
Get("/api/validate").
MatchParam("access_key", "5ad5554ac240e4d3d31107941b35a5eb").
MatchParam("number", number).
Reply(429).
JSON(expectedResult)
Expand Down