#jose-stripe-help
1 messages · Page 1 of 1 (latest)
@summer reef stripe doesn't work like paypal. The "links" is for making a one off link you give to someone which has hard coded what they buying. Like sending someone an invoice. For integrating with a website shopping cart you have to use their sessions API. A little more involved/complicated.
https://stripe.com/docs/payments/online-payments
https://stripe.com/payments/payment-links is also a viable option
Do I have to generate a payment link for each person who buys?
Depending on what you using for your backend (im just another website like you, im using php) you have to create a "session" which is just an object variable with the details of the transaction using their API you have to install on your server. The API on your server will generate the redirect link you forward you customer to that is the payment/checkout page.
And, yes you would create one of those each time someone clicks the [Payment] button on your webpage.
Unless you use one of the other options, im only talking about one way.
My way means you create one link to buy Price A and then you share that link with all your customers
it's closer to what Paypal does, though not identical
I did that now, but I can't put a note or personalized ID on the payment, so it's impossible for me to know the username of each client on my website, also I need the product to be delivered automatically after the purchase, since it is a virtual hosting service
Then if you need something specific per customer, the Checkout Session approach that @vital loom mentioned is the right one, but it needs server-side code
How can I include the stripe PHP API in my website so that I can use commands like "\Stripe\PaymentIntent::create" ? stripe's PHP source includes hundreds of files and if I do "include stripe/Stripe.php" I get a "500 internal server error"
@summer reef are you a PHP developer? If not, you can't really do that, you'll need to hire a developer to do this for you
In help docs say:
"require 'vendor/autoload.php';"
but i no have this file
I already did it, maybe due to some error it did not download all the files, I will try to do it again
If PHP is what you want to use (there are other languages supported) you can either use composer to install everything you need, or you can download a zip off their github with all the PHP pages needed. You then just add a include_once() to your page to use their API.
Now it downloads correctly, which is strange
I have another problem:
No valid payment method types for this Payment Intent. Please ensure that you have activated payment methods compatible with your chosen currency in your dashboard (https://dashboard.stripe.com/settings/payment_methods) or specify payment_method_types
And i aldeady have allowed payment method
Hard to say without more details unfortunately. Likely due to your account not being ready/activated. Do you have an exact request id?
My account has been active for months, I have already received several payments
POST /v1/payment_intents
req_kc2u3QFRuxxGBt
22/3/22 0:09:54
And other ID
req_kNdIxxmSFlCFPk
{
"amount": "1",
"currency": "EUR",
"automatic_payment_methods": {
"enabled": "true"
}
}
Can you try a second time? I see the same thing on my end where card payments are properly enabled
ah wait you're using PaymentIntents, I thought you wanted to use Payment Links?
Same error:
PHP Fatal error: Uncaught (Status 400) (Request req_GOwK2M7edpv57y) No valid payment method types for this Payment Intent. Please ensure that you have activated payment methods compatible with your chosen currency in your dashboard (https://dashboard.stripe.com/settings/payment_methods) or specify payment_method_types
yeah I think you're just going too fast and using the wrong API
@summer reef once you switch to Checkout or PaymentIntent it will work
the real issue with your API request is that you passed amount: 1 which is $0.01 which is below the minimum amount for cards https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts