Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0x962/bef1d2c0bec6e9f72548b3ea60b85791 to your computer and use it in GitHub Desktop.
Save 0x962/bef1d2c0bec6e9f72548b3ea60b85791 to your computer and use it in GitHub Desktop.
Rapid development on Square1
# 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