Stripe payment issues

I am trying to add Stripe to my apps. I made a simple app using the sample Stripe app for testing.

I downloaded the Stripe files from here and added them to my server. I also added the stripe.php file to my server. I deployed the app to my server.

These are the Chrome messages i see as soon as i open the page without doing anything.

After i make a test payment using the app, i get the following messages

Everything seems fine up until the last step. I checked the Stripe logs (by logging into Stripe), and i can see that the payment is successful but in NSBasic the Stripe1.onTransactionComplete function is never called.

The only real difference between my code and the sample is that i used

require_once('/StripeFiles/stripe-php/init.php');

at the start of the PHP file (as i downloaded the Stripe files to my server) instead of

require '/usr/home/nsbasic/scripts/stripe/vendor/autoload.php';

I think there might need to be a sample update.

Any help or suggestions are greatly appreciated.

Yes, I agree. The sample needs to be updated. Can you give us a few days?

Share your story with the AppStudio Community! Quarantine Stories

That would be great, thanks.

I just tried the sample here. It worked fine, which makes me think there are some other differences in your app. (Have you tried the sample yourself).

I did notice a couple of things that looked odd.

  • The referrer policy message sounds like something is misconfigured on your server. Stripe support might be able to help you with that.
  • The stripeCheckout.open warnings look like some sort of misconfiguration of your account. It works properly in the sample.
  • The warning about using a legacy version of Stripe also points to a configuration issue. Your API version is set on the Developer page of the Stripe Dashboard:

So, it looks like the sample is OK, but you need to work on some settings.

Share your story with the AppStudio Community! Quarantine Stories

Yes, i based all my testing on the sample.
I have the same Stripe API version as you.

Maybe if you can mention exactly what you changed from the sample, i can see if i can do the same with my API keys.
I inserted my testing public and secret key with the sample.
Which Stripe files did you add to your server for the first part of the php file? (require ‘/usr/home/nsbasic/scripts/stripe/vendor/autoload.php’; )

Thanks

I made no changes to the PHP or the app.

Give it a try here: https://www.nsbasic.com/i/Stripe/

Share your story with the AppStudio Community! Quarantine Stories

I tried your url and it worked.

I contacted Stripe and am waiting for their response.

I finally received a response from Stripe today and they’ve asked for a bit more info.
In the mean time, i’ve had more of a play with the Stripe sample.

@AppStudioSupport, i don’t really understand how you didn’t change the sample to make it work. Besides using your keys, how did you add the Stripe files to your server? Did you use Composer than add those files to your server?
I added the files created below from Composer to my server.

I also don’t understand the chargeScript value used with the sample - ‘/app/stripe.php’. I get an error if i use that.

Now, i can get the Stripe1.onTransactionComplete function to be called, however i get this error message from the app.
image
Even though i use this in my stripe PHP file and that folder with files exists.
require ‘StripeFiles/vendor/autoload.php’;

Again, not sure what’s wrong with it.

Thanks

So i finally got it working. I had to change a number of things on my server side and the sample to make it work. Even now, there a still a few warnings that i need to query Stripe about. Messy but finally got there.

Great - if you have a chance, can you add any tips you have to the Wiki article?

https://wiki.appstudio.dev/Stripe

Share your story with the AppStudio Community! Quarantine Stories

No problems. I’ll see what Stripe says about these warning messages then check if the Wiki can be updated.