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
from decimal import Decimal | |
import pymill | |
p = pymill.Pymill(PRIVATE_KEY) | |
token = self.cleaned_data.get('token') | |
plan = {'initial_price': Decimal(0), 'external_id': 'ext_plan_id'} | |
price = int(plan.initial_price * Decimal(100)) | |
email = '[email protected]' | |
try: |
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
$(function() { | |
function paymillResponseHandler(error, result) { | |
if (error) { | |
$(".alert-danger").removeClass('hidden'); | |
$(".alert-danger").append('<p>' + error.apierror + '</p>'); | |
$("button.btn-success").removeAttr("disabled"); | |
} else { | |
$("#id_token").val(result.token) | |
$("form").get(0).submit(); | |
} |
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
requests.post("https://api.mailgun.net/v2/DOMAIN/messages", | |
auth=("api", "key-SECRET"), | |
files={ | |
"attachment[0]": ("FileName1.ext", open(FILE_PATH_1, 'rb')), | |
"attachment[1]": ("FileName2.ext", open(FILE_PATH_2, 'rb')) | |
}, | |
data={"from": "FROM_EMAIL", | |
"to": [TO_EMAIL], | |
"subject": SUBJECT, | |
"html": HTML_CONTENT |