Nisha Patel
Problem
What is the Mode parameter in Stripe API? When I test Stripe Api in laravel, it says:
Error sending request to Stripe: (Status 400) (Request req_XKxpoKv6C0eFDm) You must provide mode when using prices. Stripe\Exception\InvalidRequestException: You must provide mode when using prices.
Here is my code:
Can anyone give me a solution?
Solution
From >the Stripe docs:
The mode parameter is of type enum with 3 possible values:
payment: accept one-time payments for cards, iDEAL, and more.
setup: save payment details to charge your customers later.
subscription: use Stripe Billing to set up fixed-price subscriptions.
So in your case when creating a session, add the mode parameter that fits your context, for example:
Answered by: >Jarmo T
Credit: >StackOverflow
Blog Links:
>How to manage the Text in the container in Django?
>Fix webapp stops working issue in Django- Python webapp
>Creating a form in Django to upload a picture from the website
>Sending Audio file from Django to Vue
>How to keep all query parameters intact when changing page in Django?
>Solved: TaskList View in Django
>Implement nested serializers in the Django rest framework
>How to filter events by month in Django?
>Sorting the restframework in Django
>Ways to access instances of models in view in order to save both forms at once in Django
>What makes index.html have such kind of name in Django?
>Fix Module Not Found during Deployment- Django
>Creating a Django with existing directories, files, etc.?
>How to Read a CSV file with PHP using cURL?