simontreanor / funstripe Goto Github PK
View Code? Open in Web Editor NEWAn F# library to connect to the Stripe API, including code generators to update the model and requests.
An F# library to connect to the Stripe API, including code generators to update the model and requests.
Stripe has an optional "expand" field that takes a list of strings representing fields to expand, e.g. ["latest_charge"] on a payment intent retrieve request will expand the field from a simple payment-intent ID string to a full-blown payment intent object.
However, sometimes the "expand" field is a query-string parameter and sometimes it is a form parameter. In the former case it needs to be formatted as expand = ["latest_charge"]
but in the latter case as expand = ["latestCharge"]
. This is inconsistent behaviour and needs addressing but might break existing implementations.
The Cards endpoint is not present in StripeRequest, likely because it is not defined in the paths in the OpenAPI spec. The API documentation lists a number of methods available on this endpoint that are useful, e.g. find a card by ID, but this cannot currently be done with the FunStripe library. But so far no one has said they're missing this functionality.
Hey Simon, I saw this pass by on Twitter found it an interesting read.
I was curious how you are generating the F# code and it seems like some good old string concatenation.
If you are interested you could actually use Fantomas to generate the code instead.
You could create the matching F# Syntax tree and pass it to Fantomas to print the source code.
You could use the online tool to easily discover what AST nodes you need.
Just wanted to let you know...
Many string values in requests could be strongly typed if the type can be identified unambiguously.
Also, country codes and currency codes could be sourced from the relevant ISO lists.
Hi Simon! Thanks for this library ๐
It would be useful to have a comparison against Stripe.net, perhaps in the README. I'm working for a client who wants Stripe integration and, given Stripe.net is supported by the Stripe team, I'd like some justification if choosing this library over Stripe.net.
What was the reason that you created this library in the first place? Does it enable you to get access to API updates sooner? Write more idiomatic F#? Handle errors in a way that you prefer? Something else? Basically anything that points out why an F# dev might choose FunStripe over Stripe.net would be useful.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.