Skip to content

Commit

Permalink
Amazon Pay Java SDK 3.6.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Shangamesh T committed Jan 29, 2021
1 parent 12ab080 commit f5f1838
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Version 3.6.5 - January 2021
- Added additional attribute (expectImmediateAuthorization) to ConfirmOrderReference. This value can be set to true or false (Boolean). See Amazon Pay Strong Customer Authentication (SCA) Upgrade Integration Guide for more information.

Version 3.6.4 - September 2020
- getPaymentDetails was throwing NPE instead of AmazonServiceException in certain situations
- Remediate weakly configured XML processor in PayLogUtil class
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>com.amazon.pay</groupId>
<artifactId>amazon-pay-java-sdk</artifactId>
<packaging>jar</packaging>
<version>3.6.4</version>
<version>3.6.5</version>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
Expand Down
26 changes: 25 additions & 1 deletion src/com/amazon/pay/request/ConfirmOrderReferenceRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ protected ConfirmOrderReferenceRequest getThis() {
private String failureUrl;
private String authorizationAmount;
private CurrencyCode authorizationCurrencyCode;
private Boolean expectImmediateAuthorization;

/**
* Constructor requires an order reference identifier.
Expand Down Expand Up @@ -147,6 +148,28 @@ public ConfirmOrderReferenceRequest setFailureUrl(final String failureUrl) {
public String getFailureUrl() {
return failureUrl;
}

/**
* The ExpectImmediateAuthorization set in the request
*
* @return Boolean
*/
public Boolean isExpectImmediateAuthorization() {
return expectImmediateAuthorization;
}

/**
* Sets the ExpectImmediateAuthorization in ConfirmOrderReference
*
* @param expectImmediateAuthorization Sets the expectImmediateAuthorization in ConfirmOrderReference
*
* @return ConfirmOrderReferenceRequest
* Container holding Confirm Order Reference operation parameters
*/
public ConfirmOrderReferenceRequest setExpectImmediateAuthorization(Boolean expectImmediateAuthorization) {
this.expectImmediateAuthorization = expectImmediateAuthorization;
return this;
}

/**
* Returns a string representation of this object; useful for testing and
Expand All @@ -164,7 +187,8 @@ public String toString() {
+ ", authorizationCurrencyCode=" + authorizationCurrencyCode
+ ", successUrl=" + successUrl
+ ", failureUrl=" + failureUrl
+ ", mwsAuthToken=" + getMwsAuthToken() + '}';
+ ", mwsAuthToken=" + getMwsAuthToken()
+ ", expectImmediateAuthorize=" + isExpectImmediateAuthorization() +'}';
}

}
4 changes: 3 additions & 1 deletion src/com/amazon/pay/request/RequestHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ public String getPostURL(ConfirmOrderReferenceRequest request) {
}
parameters.put(ServiceConstants.AUTHORIZATION_CURRENCEYCODE, request.getAuthorizationCurrencyCode().toString());
}

if (request.isExpectImmediateAuthorization() != null) {
parameters.put(ServiceConstants.EXPECT_IMMEDIATE_AUTHORIZATION, request.isExpectImmediateAuthorization().toString());
}
addClientParameters(parameters, request);
return Util.convertParameterMapToString(parameters);
}
Expand Down
3 changes: 2 additions & 1 deletion src/com/amazon/pay/types/ServiceConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public class ServiceConstants {
public static final String ORDER_ATTRIBUTES_SUPPLEMENTARY_DATA = "OrderAttributes.SellerOrderAttributes.SupplementaryData";
public static final String SUCCESS_URL = "SuccessUrl";
public static final String FAILURE_URL = "FailureUrl";
public static final String EXPECT_IMMEDIATE_AUTHORIZATION = "ExpectImmediateAuthorization";

// API Request Parameters - (Mostly) Required Parameters
public static final String ACTION = "Action";
Expand Down Expand Up @@ -152,7 +153,7 @@ public class ServiceConstants {
public static final String GET_MERCHANT_ACCOUNT_STATUS = "GetMerchantAccountStatus";

// SDK version
public static final String APPLICATION_LIBRARY_VERSION = "3.6.4";
public static final String APPLICATION_LIBRARY_VERSION = "3.6.5";
public static final String GITHUB_SDK_NAME = "amazon-pay-sdk-java";

// Exponential backoff wait times (milliseconds) for retry operations
Expand Down
4 changes: 3 additions & 1 deletion tst/com/amazon/pay/request/PaymentsAPIRequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,14 +124,16 @@ public void testConfirmOrderReferenceRequest() {
.setAuthorizationAmount(TestConstants.AUTHORIZE_AMOUNT)
.setAuthorizationCurrencyCode(CurrencyCode.EUR)
.setSuccessUrl(TestConstants.SUCCESS_URL)
.setFailureUrl(TestConstants.FAILURE_URL);
.setFailureUrl(TestConstants.FAILURE_URL)
.setExpectImmediateAuthorization(true);

Assert.assertEquals(request.getAmazonOrderReferenceId(),TestConstants.amazonOrderReferenceId);
Assert.assertEquals(request.getMwsAuthToken(), TestConstants.mwsAuthToken);
Assert.assertEquals(request.getAuthorizationAmount(), TestConstants.AUTHORIZE_AMOUNT);
Assert.assertEquals(request.getAuthorizationCurrencyCode(), CurrencyCode.EUR);
Assert.assertEquals(request.getSuccessUrl(), TestConstants.SUCCESS_URL);
Assert.assertEquals(request.getFailureUrl(), TestConstants.FAILURE_URL);
Assert.assertEquals(request.isExpectImmediateAuthorization(), true);
}

@Test
Expand Down

0 comments on commit f5f1838

Please sign in to comment.