Created
September 25, 2023 11:32
-
-
Save Snakeyyy/915f99c6a2a357081b1dbea6f20a303c to your computer and use it in GitHub Desktop.
PartnerJam - example of notifying PartnerJam about successfull installation of the app - Python/Django
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def install_app_view(request): | |
# do your logic | |
shop = store_shop_data(request) | |
app_secret = '<secret>' # obtain this secret in the code example in PartnerJam dashboard | |
token = request.COOKIES.get("partner_jam_token") | |
requests.post( | |
"https://be-app.partnerjam.com/webhooks/installation-confirm/", | |
json={ | |
"token": token, | |
"shopify_id": shop.shopify_id, | |
"shop_name": shop.shop_name, | |
"myshopify_domain": shop.myshopify_domain, | |
"pricing_plan": shop.plan, | |
"secret": app_secret, | |
"test": False, # set True for dry run (only for testing purposes) | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment