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

Fix spec and response conversion for mandates API #23

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased] ##

## [0.3.5] - 2023-11-15 ##

### Fixed ###

- Spec error on get mandates API call ([#22](https://github.com/AdGoji/mollie/issues/22)).

### Added ###
- Test data cleanup

Expand Down Expand Up @@ -74,7 +80,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Mandates management ([#1](https://github.com/AdGoji/mollie/issues/1)).
- Subscriptions management ([#1](https://github.com/AdGoji/mollie/issues/1)).

[unreleased]: https://github.com/AdGoji/mollie/compare/0.3.4..HEAD
[unreleased]: https://github.com/AdGoji/mollie/compare/0.3.5..HEAD
[0.3.5]: https://github.com/AdGoji/mollie/compare/0.3.4..0.3.5
[0.3.4]: https://github.com/AdGoji/mollie/compare/0.3.3..0.3.4
[0.3.3]: https://github.com/AdGoji/mollie/compare/0.3.2..0.3.3
[0.3.2]: https://github.com/AdGoji/mollie/compare/0.3.1..0.3.2
Expand Down
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

test
{:doc "Run unit tests"
:task (clojure "-M:test")}
:task (clojure "-M:test:test-runner")}

install-git-hooks
{:doc "Install required Git pre-commit hooks"
Expand Down
14 changes: 8 additions & 6 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
com.cognitect/anomalies {:mvn/version "0.1.12"}}

:aliases {:test
{:extra-paths ["test"]
:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}
{:extra-paths ["test"]}

:test-runner
{:extra-deps {io.github.cognitect-labs/test-runner {:git/tag "v0.5.1" :git/sha "dfb30dd"}}
:main-opts ["-m" "cognitect.test-runner"]
:exec-fn cognitect.test-runner.api/test}

:cloverage
{:extra-deps {cloverage/cloverage {:mvn/version "1.2.4"}}
Expand All @@ -21,6 +23,6 @@
"--codecov"]}

:build
{:deps {io.github.clojure/tools.build {:mvn/version "0.9.4"}
slipset/deps-deploy {:mvn/version "0.2.1"}}
{:deps {io.github.clojure/tools.build {:mvn/version "0.9.6"}
slipset/deps-deploy {:mvn/version "0.2.2"}}
:ns-default build}}}
10 changes: 5 additions & 5 deletions spec/com/adgoji/mollie.clj
Original file line number Diff line number Diff line change
Expand Up @@ -318,16 +318,16 @@
::mandate/status
::mandate/method
::mandate/mandate-reference
::mandate/signature-date
::mandate/created-at
::creditcard/card-holder
::creditcard/card-number
::creditcard/card-label
::creditcard/card-fingerprint
::creditcard/card-expiry-date
::link/self
::link/customer
::link/documentation]))
::link/documentation]
:opt [::creditcard/card-number
::creditcard/card-holder
::creditcard/card-label
::mandate/signature-date]))

(defmethod mandate-spec :paypal
[_]
Expand Down
10 changes: 5 additions & 5 deletions src/com/adgoji/mollie/api/mandates.clj
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
:directdebit {::directdebit/consumer-name consumer-name
::directdebit/consumer-account consumer-account
::directdebit/consumer-bic consumer-bic}
:creditcard {::creditcard/card-holder card-holder
::creditcard/card-number card-number
::creditcard/card-label card-label
::creditcard/card-fingerprint card-fingerprint
::creditcard/card-expiry-date (LocalDate/parse card-expiry-date)}
:creditcard (cond-> {::creditcard/card-fingerprint card-fingerprint
::creditcard/card-expiry-date (LocalDate/parse card-expiry-date)}
card-number (assoc ::creditcard/card-number card-number)
card-holder (assoc ::creditcard/card-holder card-holder)
card-label (assoc ::creditcard/card-label card-label))
:paypal {::paypal/consumer-name consumer-name
::paypal/consumer-account consumer-account}
{})]
Expand Down