#bign0name

1 messages · Page 1 of 1 (latest)

hybrid forumBOT
#

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.

subtle wave
#

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
frozen shale
#

i got this setup

#

i can try intents

subtle wave
#

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

frozen shale
#

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

subtle wave
frozen shale
#

there is no option for card number when I try to do it via intent

subtle wave
#

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

GitHub

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...

frozen shale
#

alright thank you

#

will tokens be not supported in future?

subtle wave
#

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

frozen shale
#

payment intents now make sense for me. Getting it all set up. Thanks a lot for your help :) have a good night

subtle wave
#

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