Skip to content

Commit 804980d

Browse files
committed
Amazon Pay Java SDK 3.6.3
1 parent 9b0bf0f commit 804980d

6 files changed

Lines changed: 61 additions & 12 deletions

File tree

CHANGES.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
Version 3.6.3 - February 2020
2+
- Fix Refund operation so that the ProviderCreditList is handled properly
3+
- Add ProviderCreditList support to the AuthorizeOnBillingAgreement operation
4+
15
Version 3.6.2 - August 2019
2-
Fix SetBillingAgreementDetails NPE for US and JP regions.
6+
- Fix SetBillingAgreementDetails NPE for US and JP regions
37

48
Version 3.6.1 - August 2019
5-
Strong Customer Authentication (SCA) implementation bug fix.
9+
- Strong Customer Authentication (SCA) implementation bug fix
610

711
Version 3.6.0 - August 2019
8-
Added additional attributes (successUrl, failureUrl) to ConfirmBillingAgreement and (subscriptionAmount, billingAgreementType) to SetBillingAgreement Details.
9-
See Amazon Pay Strong Customer Authentication (SCA) Upgrade Integration Guide for more information.
12+
- Added additional attributes (successUrl, failureUrl) to ConfirmBillingAgreement and (subscriptionAmount, billingAgreementType) to SetBillingAgreement Details
13+
See Amazon Pay Strong Customer Authentication (SCA) Upgrade Integration Guide for more information
1014

1115
Version 3.5.1 - May 2019
1216
- PaymentAuthenticationStatus getter added for GetOrderReferenceDetails, SetOrderReferenceDetails, and SetOrderAttributes API calls

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.amazon.pay</groupId>
55
<artifactId>amazon-pay-java-sdk</artifactId>
66
<packaging>jar</packaging>
7-
<version>3.6.2</version>
7+
<version>3.6.3</version>
88
<dependencies>
99
<dependency>
1010
<groupId>commons-codec</groupId>

src/com/amazon/pay/request/AuthorizeOnBillingAgreementRequest.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -14,8 +14,10 @@
1414
*/
1515
package com.amazon.pay.request;
1616

17+
import com.amazon.pay.response.model.ProviderCredit;
1718
import com.amazon.pay.types.CurrencyCode;
1819
import java.io.Serializable;
20+
import java.util.List;
1921

2022
/**
2123
* For more information documentation, see
@@ -42,11 +44,11 @@ protected AuthorizeOnBillingAgreementRequest getThis() {
4244
private String platformId;
4345
private String sellerNote;
4446
private Boolean inheritShippingAddress;
45-
4647
private String sellerOrderId;
4748
private String storeName;
4849
private String supplementaryData;
4950
private String customInformation;
51+
private List<ProviderCredit> providerCredit;
5052

5153
/**
5254
* Constructs request for AuthorizeOnBillingAgreement operation
@@ -373,6 +375,27 @@ public String getCustomInformation() {
373375
return customInformation;
374376
}
375377

378+
/**
379+
* Applicable for third-party solution providers only.
380+
*
381+
* @return ProviderCredit associated with this operation
382+
*/
383+
public List<ProviderCredit> getProviderCredit() {
384+
return providerCredit;
385+
}
386+
387+
/**
388+
* Applicable for third-party solution providers only.
389+
*
390+
* @param providerCreditList associated with this operation
391+
*
392+
* @return Returns a reference to this object so that methods can be chained together.
393+
*/
394+
public AuthorizeOnBillingAgreementRequest setProviderCredit(List<ProviderCredit> providerCreditList) {
395+
this.providerCredit = providerCreditList;
396+
return this;
397+
}
398+
376399
/**
377400
* Returns a string representation of this object; useful for testing and
378401
* debugging.
@@ -399,6 +422,7 @@ public String toString() {
399422
+ ", storeName=" + storeName
400423
+ ", supplementaryData=" + supplementaryData
401424
+ ", customInformation=" + customInformation
425+
+ ", providerCredit=" + providerCredit
402426
+ ", mwsAuthToken=" + getMwsAuthToken() + '}';
403427
}
404428

src/com/amazon/pay/request/RequestHelper.java

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -336,7 +336,7 @@ public String getPostURL(RefundRequest request) {
336336
parameters.put(ServiceConstants.SOFT_DESCRIPTOR, request.getSoftDescriptor());
337337
}
338338
if (request.getProviderCredit() != null) {
339-
addProviderCreditToParamMap(request.getProviderCredit(), parameters);
339+
addProviderCreditReversalToParamMap(request.getProviderCredit(), parameters);
340340
}
341341
addClientParameters(parameters, request);
342342
return Util.convertParameterMapToString(parameters);
@@ -489,6 +489,8 @@ public String getPostURL(AuthorizeOnBillingAgreementRequest request) {
489489
parameters.put(ServiceConstants.BA_CUSTOM_INFORMATION, request.getCustomInformation());
490490
if (request.getInheritShippingAddress() != null)
491491
parameters.put(ServiceConstants.INHERIT_SHIPPING_ADDRESS, Boolean.toString(request.getInheritShippingAddress()));
492+
if (request.getProviderCredit() != null)
493+
addProviderCreditToParamMap(request.getProviderCredit(), parameters);
492494
addClientParameters(parameters, request);
493495
return Util.convertParameterMapToString(parameters);
494496
}
@@ -662,7 +664,7 @@ private void addProviderCreditToParamMap(List<ProviderCredit> providerCreditList
662664
if (member.getProviderId() != null) {
663665
parameters.put("ProviderCreditList" + "." + "member" + "." + memberListIndex + "." + "ProviderId", member.getProviderId());
664666
}
665-
Price creditAmount = member.getCreditAmount();
667+
final Price creditAmount = member.getCreditAmount();
666668
if (creditAmount != null) {
667669
parameters.put("ProviderCreditList" + "." + "member" + "." + memberListIndex + "." + "CreditAmount" + "." + "Amount", creditAmount.getAmount());
668670
parameters.put("ProviderCreditList" + "." + "member" + "." + memberListIndex + "." + "CreditAmount" + "." + "CurrencyCode", creditAmount.getCurrencyCode());
@@ -673,4 +675,23 @@ private void addProviderCreditToParamMap(List<ProviderCredit> providerCreditList
673675
}
674676
}
675677

678+
private void addProviderCreditReversalToParamMap(List<ProviderCredit> providerCreditList, Map<String,String> parameters) {
679+
if (providerCreditList != null) {
680+
int memberListIndex = 1;
681+
for (ProviderCredit member : providerCreditList) {
682+
if (member != null) {
683+
if (member.getProviderId() != null) {
684+
parameters.put("ProviderCreditReversalList" + "." + "member" + "." + memberListIndex + "." + "ProviderId", member.getProviderId());
685+
}
686+
final Price creditAmount = member.getCreditAmount();
687+
if (creditAmount != null) {
688+
parameters.put("ProviderCreditReversalList" + "." + "member" + "." + memberListIndex + "." + "CreditReversalAmount" + "." + "Amount", creditAmount.getAmount());
689+
parameters.put("ProviderCreditReversalList" + "." + "member" + "." + memberListIndex + "." + "CreditReversalAmount" + "." + "CurrencyCode", creditAmount.getCurrencyCode());
690+
}
691+
memberListIndex++;
692+
}
693+
}
694+
}
695+
}
696+
676697
}

src/com/amazon/pay/types/ServiceConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Copyright 2016-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+
* Copyright 2016-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License").
55
* You may not use this file except in compliance with the License.
@@ -152,7 +152,7 @@ public class ServiceConstants {
152152
public static final String GET_MERCHANT_ACCOUNT_STATUS = "GetMerchantAccountStatus";
153153

154154
// SDK version
155-
public static final String APPLICATION_LIBRARY_VERSION = "3.6.2";
155+
public static final String APPLICATION_LIBRARY_VERSION = "3.6.3";
156156
public static final String GITHUB_SDK_NAME = "amazon-pay-sdk-java";
157157

158158
// Exponential backoff wait times (milliseconds) for retry operations

0 commit comments

Comments
 (0)