Giter VIP home page Giter VIP logo

elephant's People

Contributors

adamfrey avatar andrey-barkanov avatar anthonygalea avatar michaelklishin avatar z00b avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elephant's Issues

Ability to retrieve total count of a resource

I wanted to retrieve the total count of customers. According to the documentation for the upstream Stripe API,

You can optionally request that the response include the total count of all
customers that match your filters. To do so, specify include[]=total_count in
your request.

However, I couldn't figure out if this is possible using Elephant and the clojurewerkz.elephant.customers/list function. I tried using (ecr/list {"include[]" "total_count"}) but, as the result is always a plain sequence of customer maps, the count was not accessible.

Missing API-key method signature for create Customer

Version
1.0.0-beta18

Behaviour
The customer "Create" function only has one method signature, which does not take an API-key.

(defn ^IPersistentMap create [^IPersistentMap m] (cnv/customer->map (Customer/create m)))

Expected behaviour
The customer "Create" function should have an additional method signature which takes the API-key. Something similar to the charge "Create" function:

(defn create ([m] (cnv/charge->map (Charge/create (wlk/stringify-keys m)))) ([^String api-key m] (cnv/charge->map (Charge/create (wlk/stringify-keys m) api-key))))

Additional info
It is my understanding that you would need to pass your API-key to actually create real customers tied to your Stripe account. Am I correct that this is currently a missing feature? If so, would you encourage a pull request to add this?

Thanks!

Deploy new beta

Any chance you could push the current code to a new beta artifact? My PR (#9) was merged back in November, and I'm just hoping I can avoid this warning every time I compile.

WARNING: list already refers to: #'clojure.core/list in namespace: clojurewerkz.elephant.charges, being replaced by: #'clojurewerkz.elephant.charges/list

Thanks

com.stripe.exception.InvalidRequestException: This customer has no attached payment source or default payment method.

I'm getting the following error:

com.stripe.exception.InvalidRequestException: This customer has no attached payment source or default payment method.
	at com.stripe.net.LiveStripeResponseGetter.handleAPIError(LiveStripeResponseGetter.java:591)
	at com.stripe.net.LiveStripeResponseGetter._request(LiveStripeResponseGetter.java:443)
	at com.stripe.net.LiveStripeResponseGetter.request(LiveStripeResponseGetter.java:65)
	at com.stripe.net.APIResource.request(APIResource.java:140)
	at com.stripe.model.Customer.createSubscription(Customer.java:478)
	at com.stripe.model.Customer.createSubscription(Customer.java:320)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:167)
	at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:102)
	at clojurewerkz.elephant.subscriptions$create.invokeStatic(subscriptions.clj:32)
	at clojurewerkz.elephant.subscriptions$create.invoke(subscriptions.clj:29)
	at vendo.routes.home$create_subscription.invokeStatic(home.clj:62)
	at vendo.routes.home$create_subscription.invoke(home.clj:56)
	at muuntaja.middleware$wrap_params$fn__8119.invoke(middleware.clj:52)
	at muuntaja.middleware$wrap_format$fn__8123.invoke(middleware.clj:73)
	at vendo.middleware$wrap_formats$fn__9256.invoke(middleware.clj:40)
	at reitit.ring$ring_handler$fn__15124.invoke(ring.cljc:326)
	at clojure.lang.AFn.applyToHelper(AFn.java:154)
	at clojure.lang.AFn.applyTo(AFn.java:144)
	at clojure.lang.AFunction$1.doInvoke(AFunction.java:31)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.lang.Var.invoke(Var.java:384)
	at ring.middleware.reload$wrap_reload$fn__4448.invoke(reload.clj:39)
	at selmer.middleware$wrap_error_page$fn__4463.invoke(middleware.clj:18)
	at prone.middleware$wrap_exceptions$fn__4704.invoke(middleware.clj:159)
	at ring.middleware.flash$wrap_flash$fn__8361.invoke(flash.clj:39)
	at ring.middleware.session$wrap_session$fn__8728.invoke(session.clj:108)
	at ring.middleware.keyword_params$wrap_keyword_params$fn__8774.invoke(keyword_params.clj:53)
	at ring.middleware.nested_params$wrap_nested_params$fn__8832.invoke(nested_params.clj:89)
	at ring.middleware.multipart_params$wrap_multipart_params$fn__8964.invoke(multipart_params.clj:171)
	at ring.middleware.params$wrap_params$fn__8988.invoke(params.clj:67)
	at ring.middleware.cookies$wrap_cookies$fn__8679.invoke(cookies.clj:214)
	at ring.middleware.absolute_redirects$wrap_absolute_redirects$fn__9176.invoke(absolute_redirects.clj:47)
	at ring.middleware.resource$wrap_resource_prefer_resources$fn__9024.invoke(resource.clj:25)
	at ring.middleware.content_type$wrap_content_type$fn__9124.invoke(content_type.clj:34)
	at ring.middleware.default_charset$wrap_default_charset$fn__9148.invoke(default_charset.clj:31)
	at ring.middleware.not_modified$wrap_not_modified$fn__9090.invoke(not_modified.clj:61)
	at ring.middleware.x_headers$wrap_x_header$fn__8324.invoke(x_headers.clj:22)
	at ring.middleware.x_headers$wrap_x_header$fn__8324.invoke(x_headers.clj:22)
	at ring.middleware.x_headers$wrap_x_header$fn__8324.invoke(x_headers.clj:22)
	at vendo.middleware$wrap_internal_error$fn__9250.invoke(middleware.clj:19)
	at aleph.http.server$handle_request$fn__29655$f__16451__auto____29656.invoke(server.clj:158)
	at clojure.lang.AFn.run(AFn.java:22)
	at io.aleph.dirigiste.Executor$Worker$1.run(Executor.java:62)
	at manifold.executor$thread_factory$reify__16333$f__16334.invoke(executor.clj:44)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.lang.Thread.run(Thread.java:748)

When using [clojurewerkz.elephant.customers :as cust]

(cust/create {"email" (:email (:params req))
                               "payment_method" (:payment-method-id (:params req))
                               })

I have the payment_method key, yet I'm seeing this error. How to fix this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.