I am using a PHP Stripe Payment form to collect payments. The payments seem be going through OK and take the user to the confirmation page upon successful completion. I am in test mode and am able to see the payments as they show up in the 'Payments' section of the dashboard. However, when I click on the 'Home' section of the dashboard, I do not see them under the 'Gross volume' tab. There are no error logs created by my code. Also, the Stripe dashboard shows no errors as well. Does it usually take a while for the payments to shown up in the dashboard (even in the test mode)? Or it there something else?
Here's what I have tried after researching on the Internet - clearing browser cache. It worked and showed some of the payments, but its not showing the new charges under the 'Gross Volume' tab, though they show up OK in the 'Payments' section of the dashboard.
Thanks!
You're most likely only creating Tokens but not using those Tokens to create Charges on the server side.
You'll need to make sure you're creating both the Token - using Checkout or Elements - and then the Charge: https://stripe.com/docs/charges
If that's not causing the problem, you'll want to reach out to Stripe Support so they can look into the details for you.
You need to clear out all test data.
Login to your Stripe account
Business Settings
Data
Look for Test data
Click Delete all test data
Go back to your dashboard and click on Payments. Your non-test data will appear.
This is a strange work-a-round because, if I searched for the know good order, the order would show up. So somehow deleting the test data allows the order to appear in the Payment List without doing a search.
Related
I am implementing the Stripe payment platform using JavaScript and the PHP SDK.
I don't have any issues with the implementation itself, but I am not sure whether I have to reuse an existing PaymentIntent or it's perfectly fine to have a bunch of them created and incomplete.
I searched for this in Stripe's documentation, but I can't seem to find anything related to this.
For example, in my test account I have this:
It's all for the same transaction, because I was changing some visuals and refreshing the browser.
I am aware that each PaymentIntent has an ID, but is it recommended to add it as a query parameter and retrieve it on refreshing, or is it better to always generate a new Payment Intent.
My main reasoning is to avoid having a huge collection of incomplete payment intents.
The default integration path for Stripe today is to create a PaymentIntent first so that you get a client_secret you can use client-side to render their UI via PaymentElement. This means that if your customers decide not to pay after all, you end up with an incomplete PaymentIntent which is expected.
This is not really a problem, other than appearing in the Payments list which can be confusing. You could also write a background job daily that would cancel any PaymentIntent via you know won't be completed because the customer left and you didn't have any data to contact them to upsell them for example but this isn't really needed.
Stripe also has a beta (docs) right now (Feb 2023) that changes the default integration path. This simplifies the experience because you can render the PaymentElement client-side with specific options such as amount and currency. You'd then only create the PaymentIntent at the end of the flow
when the customer is attempting to pay. That flow limits the number of incomplete PaymentIntents since you only create them when the customer really pays. You'd still get some, for example after a decline by the customer's bank though.
Background
I am integrating stripe API into my site to take one off payments. My site will be API first on server side with a separate web and mobile front end. I am working on the API server side code. I will eventually use stripe payment pages to take credit card payments. I am trying to automate the testing of my APIs and am bamboozled by the documentation (which are thorough) as I just can't see what steps to take next.
My server side initiates a call with stripe using stripe sdk to create a stripe Session object - this contains a URL to redirect to checkout.stripe.com/pay/..., a success URL when payment is successful and a cancel URL (these I set to handle the callback).
Problem
I can automate in Postman all my API calls from Browse Products, Select Product, Place Order but the next step I am stuck. After Placing Order I get back the stripe session but how can I mimick making the payment with stripe for the session and then call my Success URL ?
When the site is complete I will redirect the UI to stripe to take payments but I am testing and completing the back end flow first.
I have copied and pasted the session URL which is returned by the stripe Session object to bring up the page in a browser and used Dev tools on Chrome to inspect Network to see which APIs are being called by stripe in an attempt to reproduce and I can see a POST to stripe.com/api/payment_methods and I can see the posted values but I can't reproduce this in Postman. Also, the documentation (https://stripe.com/docs/api/payment_methods/create) says
"Instead of creating a PaymentMethod directly, we recommend using the
PaymentsIntents API to accept a payment immediately"
Question
Which stripe APIs do I need to call to automate the flow from a stripe Session object to make a payment and then check that it was successful? Payment Methods? Make a Charge? Payments Intents? ...and how. Happy to be pointed to the documentation if you can help me understand the flow.
TIA
Checkout is a Stripe product that looks like a "box" and you can't know (and shouldn't need to know) what happens inside. It is created for the purpose that merchants won't have to think about what's being done under the hood.
Speaking from an automation perspective, you can try to reproduce the whole process but there's no guarantee it won't change in the future, and it could leave you with more problems later.
For options to reproduce:
The closest way is simulating browser filling and submission, using automated browser tools (ie Selenium). But it's not as straightforward as PostMan. Generally you would want to simulate every browser action that a human could do.
Or you can try to accomplish the same with the logs and events you receive on Stripe's Dashboard, when you test a Checkout Session by yourself. From now there are 3 requests.
And your goal is to receive the same 5 events in Webhook:
TBH I recommend to reconsider the need of this test, to see if it worth your efforts.
I'm generating Invoice object in Stripe and then redirecting customer to the hosted_invoice_url (https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url)
After customer completes the payment, in the final step they are presented with two buttons - Download Invoice and Download Receipt, but there is no button/link for going back to my store. So it's a dead end. Customer can only close their browser tab.
Is there a way to specify something like success_url or home_url that would add a button for getting the customer back to my store?
Right now as a workaround I'm forcing hosted_invoice_url to open in a new tab. Customer closes the tab after they are finished and they get back to my store in the original tab.
From what I know, this is not possible with hosted invoices pages. I'd recommend relaying this use case/feedback directly to Stripe.
However, if you were to use Stripe Checkout you can pass success_url and cancel_url parameters which will fulfil your requirements in this case. Perhaps Checkout might be a better product for your use case?
I'm trying to test my Stripe account with a live payment using my own debit card, but even though the toggle on my homepage dashboard is pointing to "Live", I get the following error on my site:
"Your card was declined. Your request was in test mode, but used a non test card. For a list of valid test cards, visit: https://stripe.com/docs/testing."
Dummy test numbers work ok in either mode, but it just keeps thinking it’s in test mode. I’ve checked the test and live API keys and they are correct, having re-entered them several times with no change.
The toggle you see on your dashboard doesn't actually affect your ability to create charges in test mode or live mode, it just changes the view on the dashboard.
You can always use both test mode and live mode, no matter what that toggle is set to. This is done by specifying which set of API keys you're using to make a charge: https://dashboard.stripe.com/account/apikeys
I am trying to create sales orders using WebServices from our CRM (Salesforce) to NetSuite. I am having an issue with international sales orders, in particular I am hitting this issue with United Kingdom.
If I create a sales order in the UI and set a bunch of field values and then set the Address to United Kingdom, I get a popup with the following message:
The address you have selected is based in a nexus for which you are required to charge a different kind of tax. Click OK to change the form to one that is applicable for that Nexus.
In the UI, when you click "ok", the page reloads and a few new tax fields appear (the fields are built in, denoted by the field ids). The problem is when the page reloads, all of the data is wiped out.
I did this UI testing to determine what was causing this. However, in WebServices, all the data sets at once (not able to be done in any "order"). What is happening with my webservice call is that it gets this same warning and then all of the data it tried to send is lost and then it tries to submit the record, hitting validation rules we have in place.
Has anyone hit this before? Is there a field or something I can set via webservices that is what NS is doing on the backend when you click "ok"?
I am open to any solution. I do have a ticket open with NS Support, however so far they have not been helpful. If I do get a resolution, I intend to post it for others.
to get around it, you can access the vendor first then select dropdown icon to open the purchase order