Stripe Store Configuration
1. Create a Stripe Restricted Secret Key on Stripe dashboard
To enable Stripe integration on your Glassfy account
please contact us here
API Key Permission
The ApiKey must have at least the following
read
permissions:Customers, Invoices, PaymentIntents, Checkout Sessions, Credit notes, Subscriptions
.
and paste on Glassfy Dashboard -> Settings -> Stripe
2. Create the hosted endpoint webhook on Stripe dashboard
Glassfy supports Stripe API version
2022-11-15
and older
Copy the URL from Glassfy Dashboard -> Settings -> Stripe -> Stripe Webhooks Hosted Endpoint URL and paste it in the Endpoint URL in this page
We recommend that you enable all the events but if you want to restrict certain events then you must ensure that at least the following events are enabled:checkout.session.completed
, payment_intent.succeeded
,payment_intent.partially_funded
, customer.subscription.updated
,invoice.paid
,invoice.updated
, charge.refunded
, charge.failed
,charge.succeeded
Copy the signing secret form the generated webhook page and paste it to Glassfy Dashboard -> Settings -> Stripe -> Stripe Webhook Signing Secret
3. Connect Stripe customers
Before you can start seeing Stripe data in our dashboard, you need to connect the customer. Depending on your flow, you can choose to use either Stripe metadata or our OpenAPI:
3.1 Stripe Metadata
Before launching your Stripe payment flow, include the custom identifier as metadata with the key customid
.
metadata: {
customid:'my_custom_id',
},
3.2 Glassfy OpenAPI
At the end of the payment process, call our openapi connect Stripe with your customid
and stripe's customerid
curl --request POST \
--url https://openapi.glassfy.io/v1/connect_stripe \
--header 'Authorization: Bearer REST_API_KEY' \
--header 'Content-Type: application/json' \
--data '{"customid":"my_custom_id", "customerid":"cus_xxxxxxxxxxxxxx"}'
4. Glassfy permissions of Stripe purchases
You can now use the Glassfy.permissions()
functionality to check for Stripe purchases: to enable it create a new SKU including the stripe product and add it to the selected permission.
Users on iOS or Android will be able to check for a stripe purchase directly from the SDK by using that permission
Updated 7 months ago