Skip to content

Commit

Permalink
Merge pull request #4 from HaraldNordgren/updated_urls
Browse files Browse the repository at this point in the history
Update base URLs
  • Loading branch information
frozzare authored Oct 22, 2018
2 parents cde1642 + f342730 commit c133131
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ func NewClient(opts *Options) (*Client, error) {
func (s *Client) URL() string {
switch s.Env {
case "production":
return "https://swicpc.bankgirot.se/swish-cpcapi/api/v1"
return "https://cpc.getswish.net/swish-cpcapi/api/v1"
default:
return "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1"
return "https://mss.cpc.getswish.net/swish-cpcapi/api/v1"
}
}

Expand Down
16 changes: 8 additions & 8 deletions endpoints_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func TestCreatePaymentRequest(t *testing.T) {
responder: func(req *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(200, "")

resp.Header.Set("Location", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B")
resp.Header.Set("Location", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B")

return resp, nil
},
Expand Down Expand Up @@ -57,7 +57,7 @@ func TestCreatePaymentRequest(t *testing.T) {
responder: func(req *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(500, "")

resp.Header.Set("Location", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B")
resp.Header.Set("Location", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B")

return resp, nil
},
Expand All @@ -76,7 +76,7 @@ func TestCreatePaymentRequest(t *testing.T) {
assert.Nil(t, err)

for _, test := range tests {
httpmock.RegisterResponder("POST", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/paymentrequests", test.responder)
httpmock.RegisterResponder("POST", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/paymentrequests", test.responder)

res, err := client.CreatePaymentRequest(context.Background(), &PaymentRequest{
PayeePaymentReference: "0123456789",
Expand Down Expand Up @@ -162,7 +162,7 @@ func TestPaymentRequest(t *testing.T) {
assert.Nil(t, err)

for _, test := range tests {
httpmock.RegisterResponder("GET", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B", test.responder)
httpmock.RegisterResponder("GET", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B", test.responder)

res, err := client.PaymentRequest(context.Background(), "AB23D7406ECE4542A80152D909EF9F6B")

Expand All @@ -189,7 +189,7 @@ func TestCreateRefundRequest(t *testing.T) {
responder: func(req *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(200, "")

resp.Header.Set("Location", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/refunds/AB23D7406ECE4542A80152D909EF9F6B")
resp.Header.Set("Location", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/refunds/AB23D7406ECE4542A80152D909EF9F6B")

return resp, nil
},
Expand Down Expand Up @@ -227,7 +227,7 @@ func TestCreateRefundRequest(t *testing.T) {
responder: func(req *http.Request) (*http.Response, error) {
resp := httpmock.NewStringResponse(500, "")

resp.Header.Set("Location", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B")
resp.Header.Set("Location", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/paymentrequests/AB23D7406ECE4542A80152D909EF9F6B")

return resp, nil
},
Expand All @@ -246,7 +246,7 @@ func TestCreateRefundRequest(t *testing.T) {
assert.Nil(t, err)

for _, test := range tests {
httpmock.RegisterResponder("POST", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/refunds", test.responder)
httpmock.RegisterResponder("POST", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/refunds", test.responder)

res, err := client.CreateRefundRequest(context.Background(), &PaymentRequest{
OriginalPaymentReference: "AB23D7406ECE4542A80152D909EF9F6B",
Expand Down Expand Up @@ -332,7 +332,7 @@ func TestRefundRequest(t *testing.T) {
assert.Nil(t, err)

for _, test := range tests {
httpmock.RegisterResponder("GET", "https://mss.swicpc.bankgirot.se/swish-cpcapi/api/v1/refunds/AB23D7406ECE4542A80152D909EF9F6B", test.responder)
httpmock.RegisterResponder("GET", "https://mss.cpc.getswish.net/swish-cpcapi/api/v1/refunds/AB23D7406ECE4542A80152D909EF9F6B", test.responder)

res, err := client.RefundRequest(context.Background(), "AB23D7406ECE4542A80152D909EF9F6B")

Expand Down

0 comments on commit c133131

Please sign in to comment.