#bign0name
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- bign0name-pci-windowsapp, 6 days ago, 38 messages
Tokens has been deprecated since quite a while back and you should be creating a PaymentMethod with PaymentIntents/SetupIntents instead.
I don't have an example in .NET, but you can infer how it generally works from the cURL example below
PaymentIntent
curl https://api.stripe.com/v1/payment_intents \
-u sk_test_XXXX: \
-d amount=1000 \
-d currency=usd \
-d confirm=true \
-d payment_method_types[]=card \
-d payment_method_data[type]=card \
-d payment_method_data[card][number]=4242424242424242 \
-d payment_method_data[card][exp_month]=12 \
-d payment_method_data[card][exp_year]=2026 \
-d payment_method_data[card][cvc]=123
For Subscriptions, if you already have a PaymentMethod attached to the Customer, ensure that you define the PaymentMethod the default payment method on either the Customer's invoice_settings.default_payment_method [0] (then create the Subscription), or set the default_payment_method when creating the Subscription [1]
[0] https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
[1] https://stripe.com/docs/api/subscriptions/object#subscription_object-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
can i do it without creating a customer?
yeah this was my problem i remember
there is no card option with the stripe nuget package
for Subscriptions, you must create a Customer. I recommend that you go through this guide to see how it generally works : https://stripe.com/docs/billing/subscriptions/build-subscriptions?ui=elements
you should use SetupIntents to generate a PaymentMethod : https://stripe.com/docs/api/setup_intents
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
there is no option for card number when I try to do it via intent
i can't recall off the top of my head if the dotnet library has those parameters for PaymentIntent/SetupIntent has the payment_method_data[card] parameters. If it doesn't, you'll need to use AddExtraParam : https://github.com/stripe/stripe-dotnet#how-to-use-undocumented-parameters-and-properties
Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class library for stripe.com. - GitHub - stripe/stripe-dotnet: Stripe.net is a sync/async .NET 4.6.1+ client, and a portable class libr...
it'll still work but it isn't being upgraded to support new features. Tokens doesn't support other PaymentMethods (besides cards), and it also doesn't support 3DS
https://stripe.com/docs/payments/save-and-reuse - this might be a useful guide to go through as well
payment intents now make sense for me. Getting it all set up. Thanks a lot for your help :) have a good night
To add on, for Subscriptions, if you're collecting a new payment method details for the Customer. You should use/confirm the Subsciption's underlying PaymentIntent or SetupIntent with the raw card details (instead of separately creating a SetupIntent first to collect the card details from the customer, and then creating a Subscription with that newly created PaymentMethod).
Example
curl https://api.stripe.com/v1/payment_intents/pi_3OKu0PJQtHgRImA72Efj02Oq/confirm \
-u sk_test_...: \
-d payment_method_data[type]=card \
-d payment_method_data[card][number]=4242424242424242 \
-d payment_method_data[card][exp_month]=12 \
-d payment_method_data[card][exp_year]=2026 \
-d payment_method_data[card][cvc]=123