Skip to content

Subscription next capture timestamp #39

@jaripartti

Description

@jaripartti

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions