Python Django Paypal IPN:只有在实时模式下才有错误的内容类型(它在沙盒中工作)

Python Django Paypal IPN:只有在实时模式下才有错误的内容类型(它在沙盒中工作),python,django,paypal,paypal-ipn,django-paypal,Python,Django,Paypal,Paypal Ipn,Django Paypal,我已经成功地在沙箱模式下集成了django paypal以及django调试设置。我的付款完成,并触发连接到接收到的有效IPU的信号 当我转到PayPal live模式时,也会收到付款,但我不再收到任何信号。以下是通常触发PayPal IPN的代码: class StoreItemView(SomeUserCheckMixin, SomeAjaxMixin, View): # …some business logic… paypal_dict = { 'busi

我已经成功地在沙箱模式下集成了django paypal以及django调试设置。我的付款完成,并触发连接到接收到的有效IPU的信号

当我转到PayPal live模式时,也会收到付款,但我不再收到任何信号。以下是通常触发PayPal IPN的代码:

class StoreItemView(SomeUserCheckMixin, SomeAjaxMixin, View):
    # …some business logic…

    paypal_dict = {
        'business': settings.PAYPAL_RECEIVER_EMAIL,
        'item_name': 'my item',
        'amount': '20',
        'discount_amount': '10',
        'currency_code': 'USD',
        'invoice': generate_uuid_as_string(),
        'payment_date': timezone.now().strftime('%H:%M:%S %b %d, %Y') + ' CET',
        'lc': 'FR',
        'bn': 'SomeCompany_BuyNow_WPS_FR',
        'email': request.user.email,
        'first_name': request.user.first_name,
        'last_name': request.user.last_name,
        'address1': request.user.profile.adress.street,
        'address2': request.user.profile.adress.extension,
        'zip': request.user.profile.adress.zip,
        'city': request.user.profile.adress.city,
        'country': 'FR',
        'night_phone_a': '33',
        'night_phone_b': request.user.profile.phone_number,

        'notify_url': notify_url,
        'return': return_url,
        'cancel_return': cancel_return_url,
        'custom': request.user.username + _separateur + str(cible),
    }

    return render(request, self.template_name, {
        'form': PayPalPaymentsForm(initial = paypal_dict)
    })

# After my functions to hook to the Following signals
valid_ipn_received.connect(store_check_transaction)
invalid_ipn_received.connect(store_alert_bad_transaction)
我的配置设置是这样设置的,管理员包含邮件以在出现任何错误时发出警报,一些日志消息将出现在我的自定义日志中(我知道它适用于我网站上的其他操作),我的PayPal设置如下:

# In debug mode:
ALLOWED_HOSTS = ['localhost', '.paypal.com', 'paypal.com.']
PAYPAL_TEST = True
PAYPAL_RECEIVER_EMAIL = 'somemail-facilitator@somecompany.fr'
PAYPAL_BUY_BUTTON_IMAGE = 'https://www.somecompany.fr/static/media/pay.png'

# …and in production / live mode:
ALLOWED_HOSTS = ['.somecompany.fr', '123.234.34.56', 'paypal.com.', 'paypal.com.']
PAYPAL_TEST = False
PAYPAL_RECEIVER_EMAIL = someemail@somecompany.fr'
没有信号出现。我错过了什么?有没有办法检查我的IPN呼叫在哪里结束?我在PayPal开发者仪表板上找不到任何东西

更新:我收到此断言错误,但仅在实时模式下收到

AssertionError: Invalid Content-Type - PayPal is only expected to use application/x-www-form-urlencoded. If using django's test Client, set `content_type` explicitly

我知道它接收的是json。这正常吗?

嗨,你解决了这个问题吗,我正在面对sameNo,我刚刚用了Braintree。祝你好运