1
我使用的是django標準ipn,無法處理通知信號。 付款非常順利只有通知部分不起作用。 這是我signals.pydjango-paypal無法處理通知信號
def show_me_the_money(sender, **kwargs):
ipn_obj = sender
if ipn_obj.payment_status == ST_PP_COMPLETED:
print("yey")
order = Orders.objects.get(id=38)
order.paid = True
order.save()
valid_ipn_received.connect(show_me_the_money)
apps.py
class PaymentConfig(AppConfig):
name = 'payment'
verbose_name = 'Payment'
def ready(self):
import payment.signals
初始化的.py
default_app_config = 'payment.apps.PaymentConfig'
urls.py
url(r'^payment/', include('payment.urls', namespace='payment')),