TORONTO (Reuters) - BlackBerry maker Research In Motion and Spanish telecom Telefonica are teaming up to test a payment system that turns a mobile phone into an electronic wallet and identity card, the companies said on Wednesday.