feat: Only send WP licence email on subscription start
This commit is contained in:
parent
63ee2aa82b
commit
9d06151ed2
@ -277,7 +277,14 @@ def stripeapi():
|
|||||||
return jsonify({'success': 'false'})
|
return jsonify({'success': 'false'})
|
||||||
|
|
||||||
if event.type == 'payment_intent.succeeded':
|
if event.type == 'payment_intent.succeeded':
|
||||||
|
# Only for payments for licences
|
||||||
payment_intent = event.data.object
|
payment_intent = event.data.object
|
||||||
|
if payment_intent['amount'] != 1000:
|
||||||
|
return jsonify({'success': 'true'})
|
||||||
|
|
||||||
|
if payment_intent['description'] != "Subscription creation":
|
||||||
|
return jsonify({'success': 'true'})
|
||||||
|
|
||||||
# Get email
|
# Get email
|
||||||
email = payment_intent['receipt_email']
|
email = payment_intent['receipt_email']
|
||||||
# Create licence key
|
# Create licence key
|
||||||
|
Loading…
Reference in New Issue
Block a user