用戶無(wú)法互相付款 django-paypal
我有一個(gè)在線商店,用戶可以互相付款購(gòu)買東西,我一直在使用沙箱帳戶對(duì)其進(jìn)行測(cè)試,但我認(rèn)為它不起作用。我實(shí)在不明白問(wèn)題出在哪里這是我的觀點(diǎn).py:def payment_process(request, trade_id): trade = get_object_or_404(Trade, id=trade_id) host = request.get_host() paypal_dict = { 'business': trade.seller.email, 'amount': Decimal(trade.price), 'item_name': trade.filename, 'invoice': str(trade.id), 'currency_code': 'USD', 'notify_url': 'https://{}{}'.format(host, reverse('paypal-ipn')), 'return_url': 'https://{}{}/{}'.format(host, *reverse('payment_done', kwargs={'trade_id': trade.id})), 'cancel_return': 'https://{}{}'.format(host, reverse('home')), } form = PayPalPaymentsForm(initial=paypal_dict) return render(request, 'payment/payment_process.html', {'trade': trade, 'form': form})@csrf_exemptdef payment_done(request, trade_id): # Do some very important stuff after paying ... # It would be really nice if someone can help me with a checker messages.success(request, 'Your product is in your inbox now') return redirect('trade:inbox')我的網(wǎng)址.py:urlpatterns = [ path('admin/', admin.site.urls), ... # Prodbox Payment path('payment/process/<int:trade_id>/', payment_views.payment_process, name="payment_process"), path('payment/done/<int:trade_id>/', payment_views.payment_done, name="payment_done"), # Prodbox packages path('paypal/', include('paypal.standard.ipn.urls')),]完成付款后將用戶重定向到 payment_done 視圖非常重要(如果我有一個(gè)檢查器在運(yùn)行完成功能之前檢查付款是否完成,那就太好了)另請(qǐng)注意,我強(qiáng)調(diào)用戶使用他們的 PayPal 電子郵件帳戶那么為什么它不起作用?
查看完整描述