I'm trying to integrate a simple (well I thought so...) Stripe API REST into aware IM.
Basically, when a new user signs up, I want it to create a stripe customer.
I've got the cURL code:
https://api.stripe.com/v1/customers \
-u sk_test_aaaa \
-d description="My First Test Customer (created for API docs)"
When submitting the process, its coming up with the error "Service provider returned the following error: { "error": { "message": "You did not provide an API key. You need to provide your API key in the Authorization header, using Bearer auth (e.g. 'Authorization: Bearer YOUR_SECRET_KEY'). See https://stripe.com/docs/api#authentication for details, or we can help at https://support.stripe.com/.", "type": "invalid_request_error" }}"
I have used the "Request HTTP Headers" in the REST settings as instructed, but still no luck.
I'm pretty sure I'll able to integrate attributes, I just can't seem to get past the Authentication
Anyone got any ideas or done this before?
Stripe API
Re: Stripe API
Is this oauth?
Which AwareIM version are you on?
Do you have this option when creating a REST channel?
Which AwareIM version are you on?
Do you have this option when creating a REST channel?
Re: Stripe API
Well, that's what I thought too. But I tried that, that didn't work...
It says this on Stripes website:
Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" instead of -u sk_test_4eC39HqLyjWDarjtT1zdp7dc.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
https://stripe.com/docs/api/authentication
It says this on Stripes website:
Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.
If you need to authenticate via bearer auth (e.g., for a cross-origin request), use -H "Authorization: Bearer sk_test_4eC39HqLyjWDarjtT1zdp7dc" instead of -u sk_test_4eC39HqLyjWDarjtT1zdp7dc.
All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.
https://stripe.com/docs/api/authentication
Re: Stripe API
Do you use an API tool like Postman to test your requests?
https://www.postman.com/
If not, it is highly recommended for troubleshooting!
I usually think of it this way: If you can't get it to work in Postman, It will not work in AwareIM.
https://www.postman.com/
If not, it is highly recommended for troubleshooting!
I usually think of it this way: If you can't get it to work in Postman, It will not work in AwareIM.
Re: Stripe API
Wow postman is great!
The type of authentication its using is Bearer. Not sure how to authorise that in Aware though.
Couldn't get the OAuth to work in postman
The type of authentication its using is Bearer. Not sure how to authorise that in Aware though.
Couldn't get the OAuth to work in postman
Re: Stripe API
I don't think this type of authentication is classified as OAuth. I was wrong before.
Here is what I did for it to work in Postman:
1. Added the bearer token, sent a request, it worked:
2. Looked at the actual headers and displayed the hidden ones, this is what you should enter in AwareIM:
3. This is where I believe the key should be placed in AwareIM (I have not tested this yet but it should work): Good luck!
Here is what I did for it to work in Postman:
1. Added the bearer token, sent a request, it worked:
2. Looked at the actual headers and displayed the hidden ones, this is what you should enter in AwareIM:
3. This is where I believe the key should be placed in AwareIM (I have not tested this yet but it should work): Good luck!
Re: Stripe API
Got it working, thanks heaps!
Re: Stripe API
I would be very interested in either getting this integrated in some way in Aware or a document or sample with all that is needed to use the Stripe API in Aware apps. I would pay for that and I am sure others would as well.
The solution should be able to handle all aspects of charging (only charge and all things required to make that work like create customer in Stripe account, add CC details to customer, changing CC details for customer, charge x amount etc.. Things like refunds is not needed) users via Stripe (without storing credit card information "locally" in an Aware DB).
Anyone feel up to the task of this or maybe already have it working and would consider selling a document or sample detailing how to get this up and running?
The solution should be able to handle all aspects of charging (only charge and all things required to make that work like create customer in Stripe account, add CC details to customer, changing CC details for customer, charge x amount etc.. Things like refunds is not needed) users via Stripe (without storing credit card information "locally" in an Aware DB).
Anyone feel up to the task of this or maybe already have it working and would consider selling a document or sample detailing how to get this up and running?
Henrik (V8 Developer Ed. - Windows)
Re: Stripe API
Have had similar thoughts hpl123.
I imagine a future with free and paid API sample .bsv's connected to popular services such as Mailchimp, Azure, various RMM and ERP systems.
Basically, you import the .bsv package and just enter your own API keys and parameters and you have saved tons of hard work.
AwareIM could have its own marketplace on the website with their own API packages as well as those made by third parties (its many talented users).
I imagine a future with free and paid API sample .bsv's connected to popular services such as Mailchimp, Azure, various RMM and ERP systems.
Basically, you import the .bsv package and just enter your own API keys and parameters and you have saved tons of hard work.
AwareIM could have its own marketplace on the website with their own API packages as well as those made by third parties (its many talented users).
Re: Stripe API
Ditto, would be great!joben wrote: ↑Wed Jan 12, 2022 8:27 am Have had similar thoughts hpl123.
I imagine a future with free and paid API sample .bsv's connected to popular services such as Mailchimp, Azure, various RMM and ERP systems.
Basically, you import the .bsv package and just enter your own API keys and parameters and you have saved tons of hard work.
AwareIM could have its own marketplace on the website with their own API packages as well as those made by third parties (its many talented users).
Henrik (V8 Developer Ed. - Windows)