Transfer ICP from user account to another

Hello, everyone!

I was trying to implement a payment system for a application using ICP tokens where user should be able to transfer ICP tokens to another user using rust canister.
I am trying implementing using ledger canister and was able to transfer ICP from canister to user’s Subaccount using ledger canister’s transfer function but was unable to transfer tokens from user’s principal to the canister, So if anyone can please help me with how to transfer ICP tokens from user to canister, or if we can directly transfer from one user to another within our canister. Or if there’s any other way to manage payments.

Thank you

If you want to transfer out of a user’s account, you probably want to use icrc2_transfer_from

5 Likes