Skip to content
Open
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9.1</version>
<version>3.1.1</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<use>false</use>
<use>false</use>
<source>1.8</source>
<links><link>http://docs.oracle.com/javase/7/docs/api/</link> <link>http://docs.oracle.com/javase/7/docs/api/</link></links>
<doclint>none</doclint>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
12 changes: 12 additions & 0 deletions src/main/java/cc/protea/spreedly/Spreedly.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package cc.protea.spreedly;

import cc.protea.spreedly.model.*;
import cc.protea.spreedly.model.internal.*;

import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -387,5 +390,14 @@ public List<SpreedlyTransactionResponse> listPaymentMethodTransactions(final Str
public SpreedlyPaymentMethod update(final SpreedlyPaymentMethod paymentMethod) {
return util.put("https://core.spreedly.com/v1/payment_methods/" + paymentMethod.token + ".xml", paymentMethod, SpreedlyPaymentMethod.class);
}

/**
* Completes a 3DS 2 transaction in the device fingerprint stage.
* For more details see https://docs.spreedly.com/guides/3dsecure2/
* @param token transaction_token to complete
*/
public SpreedlyTransactionResponse complete(String token) {
return util.post("https://core.spreedly.com/v1/transactions/" + token + "/complete.xml", null, SpreedlyTransactionResponse.class);
}

}
18 changes: 18 additions & 0 deletions src/main/java/cc/protea/spreedly/model/SpreedlyGatewayAccount.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class SpreedlyGatewayAccount {
@XmlElement(name = "created_at") public Date createdOn;
@XmlElement(name = "updated_at") public Date updatedOn;
@XmlElement(name = "description") public String description;
public String mode;
public boolean sandbox;

public String getToken() {
return token;
}
Expand Down Expand Up @@ -105,4 +108,19 @@ public void setDescription(final String description) {
this.description = description;
}

public String getMode() {
return mode;
}

public void setMode(String mode) {
this.mode = mode;
}

public boolean isSandbox() {
return sandbox;
}

public void setSandbox(boolean sandbox) {
this.sandbox = sandbox;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ public class SpreedlyTransactionRequest {
*/
@XmlElement(name = "callback_url") public String callbackUrl;

/**
* Browser info collected for 3ds. Please see https://docs.spreedly.com/guides/3dsecure2/ for more info
*/
@XmlElement(name = "browser_info") public String browserInfo;

/**
* Set to 2 to use 3DS2. Please see https://docs.spreedly.com/guides/3dsecure2/ for more info
*/
@XmlElement(name = "three_ds_version") public String threeDsVersion;

/**
* @return A unique string generated by Spreedly to identify a gateway.
*/
Expand Down Expand Up @@ -284,8 +294,9 @@ public boolean isAttempt3dSecure() {
/**
* @param attempt3dSecure true if the system should use a multi-stage 3D Secure workflow. See https://docs.spreedly.com/guides/3dsecure/ for instructions.
*/
public void setAttempt3dSecure(final boolean attempt3dSecure) {
public SpreedlyTransactionRequest setAttempt3dSecure(final boolean attempt3dSecure) {
this.attempt3dSecure = attempt3dSecure;
return this;
}
/**
* @return See https://docs.spreedly.com/guides/3dsecure/ for instructions.
Expand All @@ -296,8 +307,9 @@ public String getRedirectUrl() {
/**
* @param redirectUrl See https://docs.spreedly.com/guides/3dsecure/ for instructions.
*/
public void setRedirectUrl(final String redirectUrl) {
public SpreedlyTransactionRequest setRedirectUrl(final String redirectUrl) {
this.redirectUrl = redirectUrl;
return this;
}
/**
* The callback url will receive a POST back of all transactions that have changed since the last callback.
Expand All @@ -314,10 +326,28 @@ public String getCallbackUrl() {
* it will retry the callback again at least 4 times at ever-increasing intervals.
* @param callbackUrl
*/
public void setCallbackUrl(final String callbackUrl) {
public SpreedlyTransactionRequest setCallbackUrl(final String callbackUrl) {
this.callbackUrl = callbackUrl;
return this;
}

public String getBrowserInfo()
{
return browserInfo;
}

public void setBrowserInfo(String browserInfo)
{
this.browserInfo = browserInfo;
}

public String getThreeDsVersion()
{
return threeDsVersion;
}

public void setThreeDsVersion(String threeDsVersion)
{
this.threeDsVersion = threeDsVersion;
}
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
package cc.protea.spreedly.model;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;
import cc.protea.spreedly.model.internal.SpreedlyErrorSetting;
import cc.protea.spreedly.model.internal.SpreedlyNestedMapAdapter;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

import cc.protea.spreedly.model.internal.SpreedlyErrorSetting;
import cc.protea.spreedly.model.internal.SpreedlyNestedMapAdapter;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@XmlRootElement(name = "transaction")
@XmlAccessorType(XmlAccessType.FIELD)
Expand Down Expand Up @@ -117,7 +116,24 @@ public class SpreedlyTransactionResponse implements SpreedlyErrorSetting {
@XmlElement(name = "setup_response") public SpreedlyTransactionResponseDetails setupResponse;
@XmlElement(name = "redirect_response") public SpreedlyTransactionResponseDetails redirectResponse;
@XmlElement(name = "callback_response") public SpreedlyTransactionResponseDetails callbackResponse;


/**
* The required action in the 3DS 2 flow, e.g., none, device_fingerprint, challenge, etc
* See https://docs.spreedly.com/guides/3dsecure2/ for more information.
*/
@XmlElement(name = "required_action") public String requiredAction;


/**
* The device fingerprint form to render in case that the required_action is device_fingerprint.
* See https://docs.spreedly.com/guides/3dsecure2/ for more information.
*/
@XmlElement(name = "device_fingerprint_form") public String deviceFingerprintForm;

@XmlElement(name = "challenge_url") public String challengeUrl;

@XmlElement(name = "challenge_form") public String challengeForm;

/**
* @return Any positive whole number, for example 1234 = $12.34.
*/
Expand Down Expand Up @@ -534,5 +550,48 @@ public SpreedlyTransactionResponse setShippingAddress(SpreedlyShippingAddress sh
this.shippingAddress = shippingAddress;
return this;
}


public String getRequiredAction()
{
return requiredAction;
}

public SpreedlyTransactionResponse setRequiredAction(String requiredAction)
{
this.requiredAction = requiredAction;
return this;
}

public String getDeviceFingerprintForm()
{
return deviceFingerprintForm;
}

public SpreedlyTransactionResponse setDeviceFingerprintForm(String deviceFingerprintForm)
{
this.deviceFingerprintForm = deviceFingerprintForm;
return this;
}

public String getChallengeUrl()
{
return challengeUrl;
}

public SpreedlyTransactionResponse setChallengeUrl(String challengeUrl)
{
this.challengeUrl = challengeUrl;
return this;
}

public String getChallengeForm()
{
return challengeForm;
}

public SpreedlyTransactionResponse setChallengeForm(String challengeForm)
{
this.challengeForm = challengeForm;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
public class SpreedlyGatewayAccountUpdate {

DocumentBuilder documentBuilder;

@XmlElement(name = "mode")
public String mode;

public SpreedlyGatewayAccountUpdate() {
try {
Expand All @@ -28,6 +31,7 @@ public SpreedlyGatewayAccountUpdate() {

public SpreedlyGatewayAccountUpdate(final SpreedlyGatewayAccount in) {
this.gatewayType = in.gatewayType;
this.mode = in.getMode();
for (SpreedlyGatewayCredential credential : in.credentials) {
SpreedlyInternalKeyValuePair pair = new SpreedlyInternalKeyValuePair();
pair.key = credential.name;
Expand Down
56 changes: 0 additions & 56 deletions target/test-classes/SpreedlyTransactionResponse.xml

This file was deleted.