-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merchant-specific DNS names Support (#390)
- Adds subdomain for merchants - Adds new field challenge_notification_url to the completion object - Fix payment context details response
- Loading branch information
1 parent
95854ed
commit d2543c0
Showing
17 changed files
with
168 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package com.checkout; | ||
|
||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.util.regex.Pattern; | ||
import java.util.regex.Matcher; | ||
|
||
public class EnvironmentSubdomain { | ||
|
||
private URI checkoutApi; | ||
|
||
public EnvironmentSubdomain(IEnvironment environment, String subdomain) { | ||
checkoutApi = addSubdomainToApiUrlEnvironment(environment, subdomain); | ||
} | ||
|
||
public URI getCheckoutApi() { | ||
return checkoutApi; | ||
} | ||
|
||
private static URI addSubdomainToApiUrlEnvironment(IEnvironment environment, String subdomain) { | ||
URI apiUrl = environment.getCheckoutApi(); | ||
URI newEnvironment = null; | ||
try { | ||
newEnvironment = new URI(apiUrl.toString()); | ||
} catch (final URISyntaxException e) { | ||
throw new CheckoutException(e); | ||
} | ||
Pattern pattern = Pattern.compile("^[0-9a-z]{8}$"); | ||
Matcher matcher = pattern.matcher(subdomain); | ||
if (matcher.matches()) { | ||
String host = apiUrl.getHost(); | ||
String scheme = apiUrl.getScheme(); | ||
int port = apiUrl.getPort(); | ||
String newHost = subdomain + "." + host; | ||
try { | ||
newEnvironment = new URI(scheme, null, newHost, port, apiUrl.getPath(), apiUrl.getQuery(), apiUrl.getFragment()); | ||
} catch (final URISyntaxException e) { | ||
throw new CheckoutException(e); | ||
} | ||
} | ||
return newEnvironment; | ||
} | ||
|
||
} |
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