@Subroutine(TealType.none)
def closeAccountTo() -> Expr:
#return If(Balance(Global.current_application_address()) != Int(0)).Then(
return If(App.globalGet(PurchaserApprove) == Int(1)).Then(
Seq(
InnerTxnBuilder.Begin(),
InnerTxnBuilder.SetFields(
{
TxnField.type_enum: TxnType.Payment,
TxnField.amount:App.globalGet(Amount),
TxnField.sender: Global.current_application_address(),
TxnField.receiver: App.globalGet(Seller_Address),
}
),
InnerTxnBuilder.Submit(),
)
)
return ElseIf(App.globalGet(PurchaserApprove) ==Int(0)).Then(
Seq(
InnerTxnBuilder.Begin(),
InnerTxnBuilder.SetFields(
{
TxnField.type_enum: TxnType.Payment,
TxnField.amount:App.globalGet(Amount),
TxnField.sender: Global.current_application_address(),
TxnField.receiver: App.globalGet(Purchaser_key),
}
),
InnerTxnBuilder.Submit(),
)
)
This is part of my contract where payment receiver changes on INT flag. Not sure what I am missing since its not working.
If anyone can help.
Thanks