Created
May 28, 2019 09:23
-
-
Save 0x962/bef1d2c0bec6e9f72548b3ea60b85791 to your computer and use it in GitHub Desktop.
Rapid development on Square1
This file contains 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
# Implementing TFA | |
... | |
from comms.comms import send_otp | |
send_otp(self.request, provider="twilio") | |
... | |
if not verify_otp(self.request, '42576'): | |
return Response({ | |
"success": false, | |
"message": "OTP is invalid." | |
}) | |
# Collecting payment | |
axios.post("/api/v1/payment/make/", { | |
"cart": "1", | |
"username_or_email": "", | |
"method": "paypal" | |
}) | |
.then((response) => { | |
window.location = response.data.redirect_to | |
}) | |
# Checking out | |
self.request.cart.checkout() | |
# Sending email | |
from comms.comms import send_email_template | |
send_email_template(to="hello@me.com", template="order_notification", **{ | |
"order_number": "12345", | |
"full_name": "Jane Doe" | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment