Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Subscription next capture timestamp #39

Closed
jaripartti opened this issue Jan 9, 2014 · 1 comment
Closed

Subscription next capture timestamp #39

jaripartti opened this issue Jan 9, 2014 · 1 comment

Comments

@jaripartti
Copy link

Deserialization of Subscription next capture timestamp is not working properly, because implementation expects timestamp to be in milliseconds instead of seconds returned by the API. Here's a patch, which would fix this issue:


diff --git a/src/main/java/com/paymill/models/Subscription.java b/src/main/java/com/paymill/models/Subscription.java
index fc64fe2..03a391c 100755
--- a/src/main/java/com/paymill/models/Subscription.java
+++ b/src/main/java/com/paymill/models/Subscription.java
@@ -96,10 +96,20 @@ public final class Subscription {
return this.nextCaptureAt;
}

  • @JsonIgnore
    public void setNextCaptureAt( final Date nextCaptureAt ) {
    this.nextCaptureAt = nextCaptureAt;
    }
  • /**
  • * Sets the next capture.
  • * @param seconds
  • * Next capture representation is seconds.
  • */
  • public void setNextCaptureAt( final long seconds ) {
  • this.nextCaptureAt = new Date( seconds * 1000 );
  • }

public Payment getPayment() {
return this.payment;
}

@nikoloff
Copy link
Contributor

@jaripartti Thx for the report, new version with fix is available http://search.maven.org/#artifactdetails%7Ccom.paymill%7Cpaymill-java%7C3.0.3%7Cjar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants