in functions/pay_with_stripe/main.py [0:0]
def stream_event(topic_name, event_type, event_context):
topic_path = publisher.topic_path(GCP_PROJECT, topic_name)
request = {
'event_type': event_type,
'created_time': str(int(time.time())),
'event_context': event_context
}
data = json.dumps(request).encode()
publisher.publish(topic_path, data)