Skip to content

Commit

Permalink
Release 1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adyen-git-manager committed Oct 10, 2017
1 parent 166b344 commit 4b0ed75
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 17 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This README provides the usage manual for the SDK itself. For the full documenta
To integrate the Adyen SDK into your project, import the **core**, **utils** and **ui** module by adding the following lines to your build.gradle file.

```
compile 'com.adyen.checkout:core:1.9.0'
compile 'com.adyen.checkout:utils:1.9.0'
compile 'com.adyen.checkout:ui:1.9.0'
compile 'com.adyen.checkout:cardscan:1.9.0'
compile 'com.adyen.checkout:core:1.10.0'
compile 'com.adyen.checkout:utils:1.10.0'
compile 'com.adyen.checkout:ui:1.10.0'
compile 'com.adyen.checkout:cardscan:1.10.0'
```

> For implementing Custom integration, only the **core** module is required. However, you might also want to include the **utils** module to use Adyen's utility methods such as Luhn check, credit card type detection, etc.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import java.util.concurrent.TimeUnit;

import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSocketFactory;

Expand Down Expand Up @@ -53,9 +52,7 @@ public HttpClient() {
readTimeout = (int) TimeUnit.SECONDS.toMillis(60);

try {
SSLContext sslContext = SSLContext.getInstance("TLSv1.2");
sslContext.init(null, null, null);
sslSocketFactory = sslContext.getSocketFactory();
sslSocketFactory = new TLSSocketFactory();
} catch (final @NonNull NoSuchAlgorithmException | KeyManagementException e) {
e.printStackTrace();
sslSocketFactory = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package com.adyen.core.internals;

import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;

import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;

/**
* An SSL Socket factory that only supports TLSv1.2.
*/
public class TLSSocketFactory extends SSLSocketFactory {

private SSLSocketFactory internalSSLSocketFactory;

public TLSSocketFactory() throws KeyManagementException, NoSuchAlgorithmException {
SSLContext context = SSLContext.getInstance("TLSv1.2");
context.init(null, null, null);
internalSSLSocketFactory = context.getSocketFactory();
}

@Override
public String[] getDefaultCipherSuites() {
return internalSSLSocketFactory.getDefaultCipherSuites();
}

@Override
public String[] getSupportedCipherSuites() {
return internalSSLSocketFactory.getSupportedCipherSuites();
}

@Override
public Socket createSocket() throws IOException {
return enableTLSOnSocket(internalSSLSocketFactory.createSocket());
}

@Override
public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
return enableTLSOnSocket(internalSSLSocketFactory.createSocket(s, host, port, autoClose));
}

@Override
public Socket createSocket(String host, int port) throws IOException {
return enableTLSOnSocket(internalSSLSocketFactory.createSocket(host, port));
}

@Override
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
return enableTLSOnSocket(internalSSLSocketFactory.createSocket(host, port, localHost, localPort));
}

@Override
public Socket createSocket(InetAddress host, int port) throws IOException {
return enableTLSOnSocket(internalSSLSocketFactory.createSocket(host, port));
}

@Override
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
return enableTLSOnSocket(internalSSLSocketFactory.createSocket(address, port, localAddress, localPort));
}

private Socket enableTLSOnSocket(Socket socket) {
if (socket != null && (socket instanceof SSLSocket)) {
((SSLSocket) socket).setEnabledProtocols(new String[]{"TLSv1.2"});
}
return socket;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ public void testIdealPayment() throws Exception {

@Test
public void testSepaDirectDebitPayment() throws Exception {
checkSepaPayment(AMOUNT, EUR, IBAN, ACCOUNT_OWNER_NAME, Payment.PaymentStatus.RECEIVED.toString());
checkSepaPayment(AMOUNT, EUR, IBAN, ACCOUNT_OWNER_NAME, Payment.PaymentStatus.AUTHORISED.toString());
}

@Test
Expand All @@ -269,7 +269,7 @@ public void testOrientationChangeOnSEPADirectDebitScreen() throws Exception {
onView(withId(R.id.consent_direct_debit_checkbox)).perform(click());
EspressoTestUtils.rotateScreen();
onView(withId(R.id.collect_direct_debit_data)).perform(click());
checkResultString(Payment.PaymentStatus.RECEIVED.toString());
checkResultString(Payment.PaymentStatus.AUTHORISED.toString());
}

@Test
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ ext {
supportAnnotationsVersion = "25.3.1"
jUnitVersion = "4.12"

minSdkVersion = 15
minSdkVersion = 16
targetSdkVersion = 25
versionCode = 11
versionName = "1.9.0"
versionCode = 12
versionName = "1.10.0"

release_debuggable = false
release_minifyEnabled = false
Expand Down
8 changes: 4 additions & 4 deletions checkoutdemo/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ dependencies {
})
compile "com.android.support:appcompat-v7:${rootProject.supportLibVersion}"
testCompile "junit:junit:${rootProject.jUnitVersion}"
compile 'com.adyen.checkout:core:1.9.0'
compile 'com.adyen.checkout:ui:1.9.0'
compile 'com.adyen.checkout:utils:1.9.0'
compile 'com.adyen.checkout:cardscan:1.9.0'
compile 'com.adyen.checkout:core:1.10.0'
compile 'com.adyen.checkout:ui:1.10.0'
compile 'com.adyen.checkout:utils:1.10.0'
compile 'com.adyen.checkout:cardscan:1.10.0'
}

0 comments on commit 4b0ed75

Please sign in to comment.