Comments (9)
That shouldn’t be the case and works fine for me. Even in my test cases. If you look at Provider.swift
all of the route properties are using the protocol type rather than the concrete type. So those default implementations with nil
being the default value should work fine.
from stripe.
This compiles fine for me
let stripe = try req.make(StripeClient.self)
return try stripe.customer.create(email: registration.email).flatMap { customer in
from stripe.
Hmmmm. That's strange
func create(_ req: Request) throws -> Future<Customer> {
let stripe = try req.make(StripeClient.self)
return try req.content.decode(Customer.self).flatMap(to: Customer.self) { customer in
let stripeCustomer = try stripe.customer.create(email: customer.email, description: customer.description)
customer.stripeId = stripeCustomer.id
return customer.save(on: req)
}
}
/Users/jamescoonce/SwiftWeb/StripeCustomer/Sources/App/Controllers/CustomersController.swift:21:61: error: m
issing argument for parameter 'accountBalance' in call
let stripeCustomer = try stripe.customer.create(email: customer.email, description: customer.des
cription)
^
accountBalance: <#Int?#>,
Stripe.CustomerRoutes:2:17: note: 'create(accountBalance:businessVatId:coupon:defaultSource:description:email:metadata:shipping:source:)' declared here
public func create(accountBalance: Int?, businessVatId: String?, coupon: String?, defaultSource: String?, description: String?, email: String?, metadata: [String : String]?, shipping: Stripe.ShippingLabel?, source: Any?) throws -> NIO.EventLoopFuture<Stripe.StripeCustomer>
from stripe.
You sure you have the latest version of the provider?
from stripe.
.package(url: "https://github.com/vapor-community/stripe-provider.git", from: "2.2.0"),
from stripe.
That's interesting. I have no idea why you're getting a compile error. Get rid of the build folder, delete Package.resolved
and try to do a package update. Maybe you have a really old version still.
from stripe.
A new version of the provider was just released also. Although those changes were in previous release try the latest and see if that helps 2.2.1
https://github.com/vapor-community/stripe-provider/releases/tag/2.2.1
from stripe.
.package(url: "https://github.com/vapor-community/stripe-provider.git", from: "2.2.1"),
In Package.resolved
{
"package": "Stripe",
"repositoryURL": "https://github.com/vapor-community/stripe-provider.git",
"state": {
"branch": null,
"revision": "20c35dabd901c02bc7ad5fffd47f7a8e34595cbc",
"version": "2.2.1"
}
},
.build was also delete
This is the output.
/Users/jamescoonce/SwiftWeb/StripeCustomer/Sources/App/Controllers/CustomersController.swift:21:61: error: missing argument for parameter 'accountBalance' in call
let stripeCustomer = try stripe.customer.create(email: customer.email, description: customer.description)
^
accountBalance: <#Int?#>,
Stripe.CustomerRoutes:2:17: note: 'create(accountBalance:businessVatId:coupon:defaultSource:description:email:metadata:shipping:source:)' declared here
public func create(accountBalance: Int?, businessVatId: String?, coupon: String?, defaultSource: String?, description: String?, email: String?, metadata: [String : String]?, shipping: Stripe.ShippingLabel?, source: Any?) throws -> NIO.EventLoopFuture<Stripe.StripeCustomer>
^
from stripe.
Where you able to figure this out? I don’t think anyone else has had this problem.
from stripe.
Related Issues (20)
- Charges list request fails due to trailing / HOT 2
- Unable to prefill customer email when creating a checkout session HOT 11
- Bump to the lastest version of the Stripe-KIT that introduces Stripe Identity fixes HOT 1
- Multiple Stripe Accounts HOT 17
- Better Setup Walkthrough HOT 4
- [ ERROR ] DecodingError.keyNotFound: Value required for key 'sources.data.Index 0.client_secret' HOT 5
- Nullable Source "creation" Date HOT 5
- Documentation HOT 2
- Unable to retrieve list of customers HOT 5
- Add file upload support.
- Typo in Customer.bussinessVATId HOT 1
- URL query injection HOT 1
- Make Models Parameterizable HOT 2
- Upcoming Invoice has no id HOT 5
- Fix Refunds for connect accounts HOT 3
- [ ERROR ] DecodingError.valueNotFound - Token issue HOT 5
- Conform StripeError to AbortError HOT 1
- Add webhooks support HOT 3
- NIO based Stripe Client HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stripe.