Skip to content

Commit

Permalink
Amazon Pay Java SDK 3.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Harshika Agarwal committed Aug 21, 2019
1 parent d6830ed commit 2d45448
Show file tree
Hide file tree
Showing 12 changed files with 457 additions and 82 deletions.
4 changes: 4 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 3.6.0 - August 2019
Added additional attributes (successUrl, failureUrl) to ConfirmBillingAgreement and (subscriptionAmount, billingAgreementType) to SetBillingAgreement Details.
See Amazon Pay Strong Customer Authentication (SCA) Upgrade Integration Guide for more information.

Version 3.5.1 - May 2019
- PaymentAuthenticationStatus getter added for GetOrderReferenceDetails, SetOrderReferenceDetails, and SetOrderAttributes API calls
- StaticToken getter added for GetOrderReferenceDetails
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.5.1</version>
<version>3.6.0</version>
<dependencies>
<dependency>
<groupId>commons-codec</groupId>
Expand Down
48 changes: 47 additions & 1 deletion src/com/amazon/pay/request/ConfirmBillingAgreementRequest.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2016-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,6 +32,10 @@ protected ConfirmBillingAgreementRequest getThis() {
//required parameters
private String amazonBillingAgreementId;

//optional parameters
private String successUrl;
private String failureUrl;

/**
*
* @param amazonBillingAgreementId
Expand All @@ -50,6 +54,46 @@ public String getAmazonBillingAgreementId() {
return amazonBillingAgreementId;
}

/**
* Sets the URL where AmazonPay need to return after buyer successfully authenticate a transaction.
* @param successUrl After Successful authentication AmazonPay redirects
* to the SuccessUrl provided by the merchant
*
* @return Success Url
*/
public ConfirmBillingAgreementRequest setSuccessUrl(String successUrl) {
this.successUrl = successUrl;
return this;
}

/**
* Sets the URL where AmazonPay need to return after buyer fails to authenticate a transaction.
* @param failureUrl If the buyer failed to provide correct Authentication AmazonPay redirects
* to FailureUrl provided by the merchant.
*
* @return Failure Url
*/
public ConfirmBillingAgreementRequest setFailureUrl(String failureUrl) {
this.failureUrl = failureUrl;
return this;
}

/**
*
* @return successUrl
*/
public String getSuccessUrl() {
return successUrl;
}

/**
*
* @return failureUrl
*/
public String getFailureUrl() {
return failureUrl;
}

/**
* Returns a string representation of this object; useful for testing and
* debugging.
Expand All @@ -62,6 +106,8 @@ public String getAmazonBillingAgreementId() {
public String toString() {
return "ConfirmBillingAgreementRequest{"
+ "amazonBillingAgreementId=" + amazonBillingAgreementId
+ ", successUrl=" + successUrl
+ ", failureUrl=" + failureUrl
+ ", mwsAuthToken=" + getMwsAuthToken() + '}';
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2016-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2016-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,8 @@
*/
package com.amazon.pay.request;

import com.amazon.pay.response.model.Price;
import com.amazon.pay.types.BillingAgreementType;
import java.io.Serializable;

/**
Expand All @@ -37,6 +39,8 @@ protected SetBillingAgreementDetailsRequest getThis() {
private String sellerBillingAgreementId;
private String storeName;
private String customInformation;
private BillingAgreementType billingAgreementType;
private Price subscriptionAmount;

/**
*
Expand Down Expand Up @@ -108,6 +112,28 @@ public SetBillingAgreementDetailsRequest setCustomInformation(String customInfor
return this;
}

/**
* Sets attribute to determine whether the BillingAgreement is merchant initiated or customer initiated.
* @param billingAgreementType can be either "CustomerInitiatedTransaction” or “MerchantInitiatedTransaction"
*
* @return BillingAgreementType
*/
public SetBillingAgreementDetailsRequest setBillingAgreementType(BillingAgreementType billingAgreementType) {
this.billingAgreementType = billingAgreementType;
return this;
}

/**
* Sets the subscription amount for every charge till the subscription period
* @param subscriptionAmount The subscription amount for every charge till the subscription period.
*
* @return Subscription Amount
*/
public SetBillingAgreementDetailsRequest setSubscriptionAmount(Price subscriptionAmount) {
this.subscriptionAmount = subscriptionAmount;
return this;
}

/**
*
* @return amazonBillingAgreementId
Expand Down Expand Up @@ -156,6 +182,22 @@ public String getCustomInformation() {
return customInformation;
}

/**
*
* @return billingAgreementType
*/
public BillingAgreementType getBillingAgreementType() {
return billingAgreementType;
}

/**
*
* @return subscriptionAmount
*/
public Price getSubscriptionAmount() {
return subscriptionAmount;
}

/**
* Returns a string representation of this object; useful for testing and
* debugging.
Expand All @@ -172,6 +214,8 @@ public String toString() {
+ ", sellerBillingAgreementId=" + sellerBillingAgreementId
+ ", storeName=" + storeName
+ ", customInformation=" + customInformation
+ ", billingAgreementType=" + billingAgreementType
+ ", subscriptionAmount=" + subscriptionAmount
+ ", mwsAuthToken=" + getMwsAuthToken() + '}';
}

Expand Down
Loading

0 comments on commit 2d45448

Please sign in to comment.