Esempio n. 1
0
def notify(request, apikey):
    if apikey != settings.RECURLY_API_KEY:
        return HttpResponseForbidden()
    obj = recurly_parser.parse(request.body)
    if obj is None:
        return HttpResponse("unsupported", mimetype="text/plain")

    resp, content = obj.save()

    if resp['status'] != '200':
        return HttpResponseServerError(content, mimetype="text/plain")

    return HttpResponse("ok", mimetype="text/plain")
Esempio n. 2
0
def it_detects_a_successful_payment_notification_and_creates_an_invoice():
    obj = parse(recurly_successful_payment)
    assert isinstance(obj, Invoice)
Esempio n. 3
0
def it_detects_a_new_account_notification_and_creates_a_contact():
    obj = parse(recurly_contact)
    assert isinstance(obj, Contact)
Esempio n. 4
0
def it_detects_a_successful_payment_notification_and_creates_an_invoice():
    obj = parse(recurly_successful_payment)
    assert isinstance(obj, Invoice)
Esempio n. 5
0
def it_detects_a_new_account_notification_and_creates_a_contact():
    obj = parse(recurly_contact)
    assert isinstance(obj, Contact)