Skip to content

Commit 0189a25

Browse files
author
Sam Ritchie
committed
saving.
1 parent 2192ce6 commit 0189a25

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/clj/stripe/charge.clj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
(s/defschema ChargeReq
2020
"Supported options for a Stripe charge request."
2121
(-> {:amount ChargeAmount
22+
s/Any s/Any
2223
(s/optional-key :expand) h/Expansion
2324
(s/optional-key :currency) ss/CurrencyID
2425
(s/optional-key :source) t/Card
@@ -31,6 +32,7 @@
3132
(s/defschema RefundReq
3233
"Supported options for a Stripe refund request."
3334
(-> {:id ChargeID
35+
s/Any s/Any
3436
(s/optional-key :expand) h/Expansion
3537
(s/optional-key :amount) ss/PositiveInt
3638
(s/optional-key :refund_application_fee) s/Bool}))

src/clj/stripe/http.clj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@
9595
:query-params params
9696
:throw-exceptions false}
9797
version (when-let [v (or (:api-version opts) (api-version))]
98-
{:headers {"Stripe-Version" v}})]
98+
{:headers (merge {"Stripe-Version" v}
99+
(:headers opts))})]
99100
(merge base-params version (dissoc opts :api-version))))
100101

101102
;; ## Public Methods

src/clj/stripe/transfer.clj

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ or not at all."))
3333
(s/optional-key :description) TransferDescription
3434
(s/optional-key :statement_descriptor) StatementDescriptor
3535
(s/optional-key :metadata) ss/Metadata
36-
(s/optional-key :expand) h/Expansion})
36+
(s/optional-key :expand) h/Expansion
37+
s/Any s/Any})
3738

3839
(def TransferUpdate
3940
"Supported inputs for updating a Transfer object."
@@ -48,7 +49,7 @@ or not at all."))
4849
:currency ss/CurrencyID
4950
:date ss/UnixTimestamp
5051
:status (s/enum "paid" "pending" "failed" "canceled")
51-
(s/optional-key :type) (s/eq "bank_account")
52+
(s/optional-key :type) (s/enum "bank_account" "stripe_account")
5253
(s/optional-key :account) r/BankAccount
5354
(s/optional-key :bank_account) r/BankAccount
5455
:balance_transaction (s/either b/BalanceTxID b/BalanceTx)
@@ -92,9 +93,9 @@ or not at all."))
9293
An optional map of RequestOptions can be used to expand the
9394
balance_transaction field or supply an async channel."
9495
([id :- TransferID]
95-
(get-transfer id {}))
96+
(get-transfer id {}))
9697
([id :- TransferID more :- h/RequestOptions]
97-
(h/get-req (str "transfers/" id) more)))
98+
(h/get-req (str "transfers/" id) more)))
9899

99100
(s/defn update-transfer :- TransferAPIResponse
100101
"Updates the specified transfer by setting the values of the
@@ -116,5 +117,7 @@ or not at all."))
116117
charged on the transfer will be refunded. You may not cancel
117118
transfers that have already been paid out, or automatic Stripe
118119
transfers."
119-
[id :- TransferID]
120-
(h/post-req (str "transfers/" id "/cancel")))
120+
([id :- TransferID]
121+
(cancel-transfer id {}))
122+
([id :- TransferID more :- h/RequestOptions]
123+
(h/post-req (str "transfers/" id "/cancel") more)))

0 commit comments

Comments
 (0)