mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 20:21:35 +00:00
Fix bad reply after submitting invoice
This commit is contained in:
parent
d0b6241d13
commit
f1c4754868
@ -95,7 +95,7 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
|
|||||||
"order_made_link",
|
"order_made_link",
|
||||||
"order_taken_link",
|
"order_taken_link",
|
||||||
"order_escrow_link",
|
"order_escrow_link",
|
||||||
"order_paid_link",
|
"order_paid_LN_link",
|
||||||
)
|
)
|
||||||
list_display_links = ("hash", "concept")
|
list_display_links = ("hash", "concept")
|
||||||
change_links = (
|
change_links = (
|
||||||
@ -104,7 +104,7 @@ class LNPaymentAdmin(AdminChangeLinksMixin, admin.ModelAdmin):
|
|||||||
"order_made",
|
"order_made",
|
||||||
"order_taken",
|
"order_taken",
|
||||||
"order_escrow",
|
"order_escrow",
|
||||||
"order_paid",
|
"order_paid_LN",
|
||||||
)
|
)
|
||||||
list_filter = ("type", "concept", "status")
|
list_filter = ("type", "concept", "status")
|
||||||
ordering = ("-expires_at", )
|
ordering = ("-expires_at", )
|
||||||
|
@ -766,7 +766,7 @@ class Logics:
|
|||||||
send_message.delay(order.id,'fiat_exchange_starts')
|
send_message.delay(order.id,'fiat_exchange_starts')
|
||||||
|
|
||||||
# If the order status is 'Waiting for both'. Move forward to 'waiting for escrow'
|
# If the order status is 'Waiting for both'. Move forward to 'waiting for escrow'
|
||||||
if order.status == Order.Status.WF2:
|
elif order.status == Order.Status.WF2:
|
||||||
# If the escrow does not exist, or is not locked move to WFE.
|
# If the escrow does not exist, or is not locked move to WFE.
|
||||||
if order.trade_escrow == None:
|
if order.trade_escrow == None:
|
||||||
order.status = Order.Status.WFE
|
order.status = Order.Status.WFE
|
||||||
@ -780,7 +780,7 @@ class Logics:
|
|||||||
order.status = Order.Status.WFE
|
order.status = Order.Status.WFE
|
||||||
|
|
||||||
# If the order status is 'Failed Routing'. Retry payment.
|
# If the order status is 'Failed Routing'. Retry payment.
|
||||||
if order.status == Order.Status.FAI:
|
elif order.status == Order.Status.FAI:
|
||||||
if LNNode.double_check_htlc_is_settled(
|
if LNNode.double_check_htlc_is_settled(
|
||||||
order.trade_escrow.payment_hash):
|
order.trade_escrow.payment_hash):
|
||||||
order.status = Order.Status.PAY
|
order.status = Order.Status.PAY
|
||||||
|
@ -475,14 +475,14 @@ class OrderView(viewsets.ViewSet):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# 2) If action is 'update invoice'
|
# 2) If action is 'update invoice'
|
||||||
if action == "update_invoice":
|
elif action == "update_invoice":
|
||||||
valid, context = Logics.update_invoice(order, request.user,
|
valid, context = Logics.update_invoice(order, request.user,
|
||||||
invoice)
|
invoice)
|
||||||
if not valid:
|
if not valid:
|
||||||
return Response(context, status.HTTP_400_BAD_REQUEST)
|
return Response(context, status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
# 2.b) If action is 'update address'
|
# 2.b) If action is 'update address'
|
||||||
if action == "update_address":
|
elif action == "update_address":
|
||||||
valid, context = Logics.update_address(order, request.user,
|
valid, context = Logics.update_address(order, request.user,
|
||||||
address, mining_fee_rate)
|
address, mining_fee_rate)
|
||||||
if not valid:
|
if not valid:
|
||||||
|
Loading…
Reference in New Issue
Block a user