#shsolutions - integration
1 messages ยท Page 1 of 1 (latest)
Good morning codename_duchess, I appreciate your help.
I was working yesterday with Toby and Snufkin. Here's a link to that discussion: #dev-help message
I am trying to integrate Stripe payments into a desktop application. So they explained that I would need to create the card, product, and price objects, and then create a PaymentIntent object for processing the payment. They were very helpful with resources, but after reading the resources I'm still very confused and don't see where everything comes together...
And I also saw different examples that combined the Product and Price objects, so I don't know if that makes more sense either...
But I'm having a very hard time understanding the payment processing structure and how everything connects.
I also feel as though the Card object should be assigning the result to something similar to how Products and Price are... But I can't find a way to do that and the example in the Stripe documentation doesn't do that...
But something like:
Stripe.Card card = ?
Because without doing that, I don't have anything to actually pass to the PaymentIntent object... Unless I'm missing something.
Ok. Discord is very busy, so I don't have the bandwidth to re-read that thread. I'm curious why they suggested you should create products and prices because PaymentIntents are created with amounts, not Product/Price objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You would just specify the amount directly
Hm... I will try that instead...
How do I add the card information or the Card object to the PaymentIntents?
I realize you
I realize you're very busy and appreciate your help.
No problem
You can pass it here: https://stripe.com/docs/api/payment_intents/create#create_payment_intent-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.
You just pass the id after you've created the 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.
Thank you very much.
Sorry for having another question. But how do I get the Card ID from the Card Object?
I don't see an option to get the ID from service or optionsCard...
Am I missing something? Looking at the example on the pages you sent I don't see where I get the response from the objects...
It's all good. It can be a bit confusing. So in Stripe there are Card objects (which are the legacy approach to creating card payments) and Payment Method objects (the new recommended approach). Payment Methods are objects that can be a number of different payment method types (including cards). So, it's recommended to create a Payment Method object of type card here: https://stripe.com/docs/api/payment_methods/create#create_payment_method-type
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
In the response to that object, there is a id param
That is what you'll pass to the payment intent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you very much. I feel like I'm going to feel very stupid when I finally get this, but I don't understand how I get the results from the PaymentMethodCreateOptions.
Where do I access the result so that I can access the ID?
I tried something like this, but this didn't work...
Stripe.StripeList<PaymentCard> CardDetails = Cardservice.List(optionsCard);
I also tried:
Stripe.Card cardDetails = Cardservice.Get(id);
But that also didn't work.
I'm sorry, but I'm just not getting this and I don't understand why.
What code do I use to access the results from the PaymentMethodCreateOptions? What am I missing? I genuinely appreciate your help and patience...
I'm not a .net expert, but you'll need to assign this to a variable to get the response object: service.Create(options);
Then you can access the id property on the response
I could be wrong about this actually since I'm not a .NET expert. Let me rope in a colleague
@modest tusk
In this code:
service.Create(optionsCard);```
How would you access the properties on the PaymentIntent object? Are they within the service variable, or do you actually need to assign `service.Create(options);` to a new variable to access them?
Thank you very much! I was right, I do feel stupid...
So, the correct code is:
var CardDetails = Cardservice.Create(optionsCard);
and then in the PaymentIntent, I do:
PaymentMethod = CardDetails.Id,
It looks like.
So that code creates a Card object
Not a PaymentMethod
Which I explained in this message: #1002564195658760212 message
Yes, but don't I need to create the Card object first and then pass the ID to the PaymentIntent?
No
Thanks Tarzan!
You create a PaymentMethod object and pass that object's id to the PaymentIntent
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hm... Let me take another look.
Thank you for your help codename_duchess, and for your help too Tarzan. I appreciate you looking at everything as well.
let me know if you need any more help
@modest tusk
Thank you very much.
So, I have the below code.
Am I correct that I need to create the PaymentMethodCreateOptions / Card Object, and then pass the ID to the PaymentIntentCreateOptions / Payment Object?
And does the PaymentService.Create(optionsPayment); actually process the payment?
I'm trying to get this integrated into our desktop application and I'm still trying to learn the Stripe structure...
Here is my current code:
Stripe.StripeConfiguration.ApiKey = AccessToken;
//Card Details
var optionsCard = new Stripe.PaymentMethodCreateOptions
{
Type = "card",
Card = new Stripe.PaymentMethodCardOptions
{
Number = CCNumber,
ExpMonth = ExpMonthInt,
ExpYear = ExpYearInt,
Cvc = CCCVV,
},
};
var Cardservice = new Stripe.PaymentMethodService();
Cardservice.Create(optionsCard);
var CardDetails = Cardservice.Create(optionsCard);
//Process Payment
var optionsPayment = new Stripe.PaymentIntentCreateOptions
{
Amount = 2000,
Currency = "usd",
Description = "Services",
PaymentMethodTypes = new List<string>
{
"card",
},
PaymentMethod = CardDetails.Id,
};
var Paymentservice = new Stripe.PaymentIntentService();
Paymentservice.Create(optionsPayment);
I really appreciate your help and time.
for what it's worth you shouldn't be creating the PaymentMethod this way
as far as I understand you're passing the card details over the network to your own API
which means that you'd have to be PCI compliant and that's a headache by itself
you should either create the payment method on the front-end using StripeJs and just send that PM id to the backend
Nothing is being transmitted across our network, it's a class that's built into the local application.
It's a desktop application, so there is no web frontend or javascript for me to use those tools. And the card details are not stored anywhere or leave the local class.
yeah I just got a bit of context from a colleague that worked with you yesterday on that
you really need to worry about PCI compliance it's really important
I think we are compliant though. Nothing is being stored or transmitted other than to Stripe.
but it also applies on the form where the CardInfo are entered
and one more thing, is the customer the one who are entering the card details? or is it an agent that would that for them?
It would be an agent.
It would be processed over the phone (in this case).
We are separately working on integrating Stripe into our website where the customer would be entering it in.
The website will likely use your js components or a shopping cart...
But for the desktop application, you don't offer UI components...
Our payment form on desktop was originally developed to support PayPal payments, but we are planning to move to Stripe.
like technically what you did works
it's just the PCI compliance thing. since you're building a MOTO service you should probably look into this
I'm sorry, what does MOTO stand for?
I also wanted to clarify that the only person that can ever see the card info is the person entering it in, and then only when they're entering it in. The card number gets replaced with Xes and no other card data (CVV, etc.) is stored anywhere ever.
I certainly want to be PCI compliant, I am not dismissing that at all. I'm just explaining the steps we've taken to address those concerns. Because we certainly recognize the sensitive nature of card data and don't have any desire or intention of storing it or otherwise making it accessible.
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Oh, Ok. I wasn't sure what the acronym stood for. I appreciate that.
so you need to contact support https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
and get their help on the subject
Stripe referred me to the discord group for my questions about getting this integrated.
would you mind sharing the account id?
Where do I find my account ID? That's not the secret, correct?
yes you can share it without any fear
I appreciate your help, but I'm not sure about sharing the secret online since I'm supposed to keep it secret.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
you can copy it from there
I'm not asking you to share your secret key