Created
June 19, 2020 14:22
-
-
Save SimonHoiberg/40fc0d312ad5fb661e094a7c60517a8d to your computer and use it in GitHub Desktop.
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
const paymentSucceeded = async (dataObject: any) => { | |
const customerID = dataObject['customer'] as string; | |
if (!customerID) { | |
throw Error(`No customer with ID "${customerID}"`); | |
} | |
const customerEmail = dataObject['customer_email'] as string; | |
const customerName = dataObject['customer_name'] as string; | |
const linkToInvoice = dataObject['hosted_invoice_url'] as string; | |
// Use the above to send confirmation email with a link to invoice, | |
// thus enabling the paid functionality. | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment