Follow @ServiceStack, view the docs, use StackOverflow or Customer Forums for support.
servicestack / stripe Goto Github PK
View Code? Open in Web Editor NEWTyped .NET clients for stripe.com REST APIs
License: Other
Typed .NET clients for stripe.com REST APIs
License: Other
Follow @ServiceStack, view the docs, use StackOverflow or Customer Forums for support.
Hi,
Stripe support decimal amount can we change it to decimal as well ?
Thanks
Please review this documentation.
Need to define get/create/etc types like CreateStripeLineItem, to create invoice items for a stripe customer.
When the Stripe API returns 402, and the code is card_declined, can we get the decline_code?
This would help us to tell our customers when to reach out to their bank. For example, if the decline_code is "do_not_honor", the Stripe documentation indicates that the customer has to reach out to her bank to correct the payment processing issue. It's not an issue on Stripe's end our ours as the merchant. These type of "it's the bank's issue with their client" issues would be good to just tell them upfront as it would save us support time.
Metadata problem for ServiceStack/Stripe when having multiple entries in Metadata Dictionary.
gateway.Post(new UpdateStripeCustomer
{
Id = "xxxx",
Metadata = new Dictionary<string, string>
{
{ "Data1", "Value1" },
{ "Data2", "Value2" }
}
}
Metadata seen by Stripe dashboard
Data1 = "Value1metadata[Data2]=Value2"
Test function Can_Create_and_UpdateCustomer_with_Metadata() would spot this bug if it was testing for more than one dictionary member.
Please review this documentation.
Some properties are missing from a Stripe Customer object, which would be useful.
MetaData
BusinessVatId
Currency
Add to CreateStripeCustomer, CreateStripeCustomerWithToken and UpdateStripeCustomer
Would it be possible to implement the API charges[lt], lte etc. which allow charges from a particular period to be returned. When there are many charges its nice to be able to filter them by a period.
In the documentation the "GetStripeCards" is not a valid Class name.
There is something similar called "GetStripeCustomerCards" but those goes to the incorrect endpoint.
So it looks like there is currently no way to get a list of payment methods for a specific customer.
I'm using the .net standard version (.Core)
Most of the other actions are not in the Types namespace, and also have Routes, IReturn<> definitions, etc.
Stripe/src/Stripe/StripeGateway.cs
Line 403 in f467493
not sure if this is the right place to report since all other issues are unanswered.
anyway:
the cancel subscription dto is missing a crucial parameter "CancelAtPeriodEnd"
I can use it in my Xamarin iOS or Android application creating a custom View to gather the credit card information right? I know it can be done I'm just trying to find out if I'm not breaking any policy etc because there are Xamarin iOS/Android components (https://github.com/xamarin/XamarinStripe) but really old so trying to understand they way to go.
hello how can we mock the stripe services using xunit test mocking.
Hello,
I have some problems with subscriptions.
When I create a subscription, it is well created at the stripe level but when I want to create another new subscription with the same customer, it just update the last subscription and not create a new one. So I would like to know if there is a method to create a new subscription like here and not update the customer old subscription like given here.
Hey, I wanted to ask you that how can I handle payments which are being made by customers using 3D Secure Credit/Debit Cards?
Is there any way to handle that using this library?
Here are some sample Test Cards, Stripe Testing Cards.
This issue always comes, when using cards for whichs 3D Secure or 3D Secure 2 is required.
Your support on this would be highly appreciated.
Based on the documentation, it looks like we should be able to take a card token obtained through stripe.js, and attach it to a customer via the Source parameter of the update request. however, this property is missing.
https://stripe.com/docs/api/curl#create_customer
specifically:
curl https://api.stripe.com/v1/customers
-u sk_test_testkeyhere:
-d description="Customer for [email protected]"
-d source=tok_testtokenhere
Hey, i have been trying to integrate Stipe into my iPhone application but got crash
Here is the inner exception
"InnerException {System.TypeInitializationException: An exception was thrown by the type initializer for ServiceStack.LicenseUtils ---> System.NullReferenceException: Object reference not set to an instance of an object at ServiceStack.LicenseUtils..cctor () [0x00000] in :0 --- End of inner exception stack trace --- at ServiceStack.Text.JsConfig..cctor () [0x00000] in :0 } System.TypeInitializationException"
Could you please prepare working sample for iPhone (trial period maybe just for testing )
Are there any plans to support Stripe events? I would like to be able to use this with webhook requests
Hi Guys,
I can see that a fix was made on 9th Sept (commit = 1ed9160) that should have fixed this issue. So I've updated all my nuget packages (V4.0.33) so I have the latest but so for some reason when I'm debugging GetStripeCustomer I'm still getting a null Subscription property in the StripeCustomer object rather than a Subscriptions collection. I'm deleted all the servicestack package and re-downloaded then, restarted VS, restarted IIS and no joy.
Can someone confirm whether this fix was in the latest release... I'm guessing as on master branch it should be in there.
I know for sure the Stripe API is working and returning subs as I've debugged that also (screenshot attached).
Any help much appreciated.
Thanks in advance
Claire
Hi,
I'm testing Create Stripe Customer API:
return _stripeGateway.Post(new CreateStripeCustomer
{
Email = email,
Description = description
});
The above code throws the below exception:
Method not found: 'ServiceStack.Text.JsConfigScope ServiceStack.Text.JsConfig.With(System.Nullable1<Boolean>, System.Nullable
1, System.Nullable1<Boolean>, System.Nullable
1<ServiceStack.Text.ParseAsType>, System.Nullable1<ServiceStack.Text.ParseAsType>, System.Nullable
1, System.Nullable1<Boolean>, System.Nullable
1, System.Nullable1<Boolean>, System.Nullable
1, System.Nullable1<Boolean>, System.Nullable
1<ServiceStack.Text.DateHandler>, System.Nullable1<ServiceStack.Text.TimeSpanHandler>, System.Nullable
1<ServiceStack.Text.PropertyConvention>, System.Nullable1<Boolean>, System.Nullable
1, System.String, System.Func2<System.Type,System.String>, System.Func
2<System.String,System.Type>, System.Nullable1<Boolean>, System.Nullable
1, System.Nullable1<Boolean>, System.Nullable
1, System.Nullable1<Boolean>, System.Nullable
1, System.Nullable1<Boolean>, System.Nullable
1, ServiceStack.EmptyCtorFactoryDelegate, System.String[])'.
I have installed ServiceStack.Stripe using 'Manage Nuget Packages' in Visual Studio.
Following are the dll versions show in my Visual Studio properties window:
Stripe: 4.0.42.0
ServiceStack.Client: 4.0.42.0
ServiceStack.Interfaces: 4.0.0.0
ServiceStack.Text: 4.0.42.0
Someone on Stackoverflow mentioned it could be because of dll version mismatch. Could ServiceStack.Interfaces dll causing the issue? If yes, then how and where to get the latest dll version (4.0.42.0)?
Please help !
Cheers,
I just noticed this library is missing a license, and would love to use it for an upcoming project. Could you put the license file in this repo?
https://stripe.com/docs/api/curl#idempotent_requests
To safely retry an API request without accidentally performing the same operation twice, you can attach a unique key to any POST request made to the Stripe API via the Idempotency-Key: header.
does this repo have one?
In CancelStripeSubscription there's no field to inform the subscriptionID, only CustomerId.
If the customer have more than one subscription to a different plans, wich will be canceled?
Both?
I would like to Create a card from a token. It seems missing from the library.
$ curl https://api.stripe.com/v1/customers/cus_9O9nDRLqwaxzcX/sources \
-u sk_test_BQokikJOvBiI2zlWg34LMnQ2: \
-d source=tok_1895WV2eZvKYlo2CJRqkCEf5
I guess the code could be used like this:
StripeCard card = gateway.Post(new CreateStripeCard
{
CustomerId = "cus_9O9nDRLqwaxzcX",
Source = "tok_1895WV2eZvKYlo2CJRqkCEf5"
});
I would like to see async versions of the entire API for all the reasons that the async/await pattern is good.
public async Task<String> CreateCustomer(String cardId, String stripeApiKey)
{
var gateway = new StripeGateway(stripeApiKey);
var customer = await gateway.PostAsync(new CreateStripeCustomerWithToken { Card = cardId });
return customer.Id;
}
Hi,
I am using stripe.dll to create a subscription in stripe. This subscription is for new user creation in our application. Below is code to create a new subscription using VB.Net. This subscription will create when user will register first time to our application.
Dim gateway = New StripeGateway(stripeKey)
If (list("CouponId").ToString() = "") Then GoTo Line1 Else GoTo Line2
Line1: Dim subscription = gateway.Post(New SubscribeStripeCustomer() With { _
.CustomerId = "cus_96OuD7MM31KKR3", _
.Plan = "IG-monthly"
})
If subscription.Id = "" Then GoTo Line2 Else GoTo Line3
Line2: Dim subscription1 = gateway.Post(New SubscribeStripeCustomer() With { _
.CustomerId = "cus_96OuD7MM31KKR3", _
.Plan = "IG-monthly", _
.Coupon ="choicefree2"_
})
User is created successfully in stripe. Again our requirement is to create another subscription in stripe for same customer when he will purchase “Email on Acid” in our application. To do this task I wrote following code.
Dim subscription As ServiceStack.Stripe.Types.StripeSubscription
If list("CouponCode") <> "" Then
subscription = gateway.Post(New SubscribeStripeCustomer() With { _
.CustomerId = "cus_96OuD7MM31KKR3", _
.Plan = "EOAMTH", _
.Coupon = "testc2"
})
Else
subscription = gateway.Post(New SubscribeStripeCustomer() With { _
.CustomerId = "cus_96OuD7MM31KKR3", _
.Plan = "EOAMTH" _
})
End If
Here again subscription is created successfully but it is ending existing subscription(IG-Monthly) and new subscription for EOAMTH is created. It is overriding existing subscription. Our requirement is to run both subscription for same customer. If user purchases “Email On Acid” then along with IG-Monthly plan he has to charge for EOAMTH plan based on his subscription date.
I have updated old stripe dll and now I am using ServiceStack.Stripe dll (Verson 4.5.0.0) but still this issue did not resolve.
Is this dll support multiple subscription only for licenced ?????? So i can purchase and go forword.
Please suggest me how will I fulfil my requirement.
Thanks & Regards,
Piyush Srivastava
From what I read in the stripe documentation, it seems as if you use stripe.net or Servicestack.stripe, that you need to be PCI compliant, unless you create a token for a charge from a client side library like stripe.js and the pass to servicestack. Do we need to be PCI compliant when using Servicestack Stripe
Need to derive this, based on the codes, when it would be easier to just check it directly.
I created some new types to deal with Stripe Accounts, but they serialize incorrectly and get rejected by the Stripe servers. Here are the relevant Types.
// Extend the Existing Api with call the Create a Stripe Account
[Route("/accounts")]
public class CreateStripeAccount : IPost, IReturn<StripeAccount>
{
public string Country { get; set; }
public bool Managed { get; set; }
public string Email { get; set; }
public StripeTOSAcceptance TOSAcceptance { get; set; }
public StripeLegalEntity LegalEntity { get; set; }
}
public class StripeTOSAcceptance
{
public DateTime Date { get; set; }
public string IP { get; set; }
public string UserAgent { get; set; }
}
public class StripeLegalEntity
{
public StripeDOB DOB { get; set; }
}
public class StripeAccount : StripeId
{
public Dictionary<string, string> Keys { get; set; }
}
If I submit a CreateStripeAccount request like this:
var entity = new StripeLegalEntity { DOB = new StripeDOB { Day = "1", Month = "1", Year = "1970" }};
var custAccount = gateway.Post(new CreateStripeAccount
{
Country = "US",
Email = newCust.Email,
Managed = true,
TOSAcceptance = tos,
LegalEntity = entity
}, Guid.NewGuid().ToString());
The problem is with the DOB
property of StripeLegalEntity
. It gets serialized as
...&legal_entity[dob]={day:1,month:1,year:1970}
resulting in this error
{
"error": {
"type": "invalid_request_error",
"message": "'dob' must be a hash.",
"param": "legal_entity[dob]"
}
}
instead of a success response if I submit this
...&legal_entity[dob][day]=1&legal_entity[dob][month]=1&legal_entity[dob][year]=1970
How can I tell this library to serialize these types properly? The StripeTOSAcceptance
object serializes properly, but it's only a 1 deep graph. I'm guessing that this has something to do with ServiceStack.Text and how it decides to emit these Complex objects to the UrlParams sequence, but am not sure.
Thanks,
Paul
Was trying to find a way to access the Prices attached to a product, I can't seem to find any reference to Stripe Price object.
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.