Closed (won't fix)
Project:
Commerce Core
Version:
7.x-1.3
Component:
Payment
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Jul 2012 at 21:11 UTC
Updated:
9 Nov 2017 at 21:47 UTC
Jump to comment: Most recent
Comments
Comment #1
rszrama commentedI don't think we'll be making this change, as it's possible for there to be multiple payment transactions per order ID. There's already a core Drupal API feature called the EntityFieldQuery that would do the exact same thing, load an entity based on some property (i.e. load payment transactions based on their order ID property). I recommend you research that and use that to load your payment transactions.
Comment #2
a.ross commentedHere's an example of how to do that:
Docs for EFQ are here: http://api.drupal.org/api/drupal/includes!entity.inc/class/EntityFieldQu...
Comment #3
cafuego commentedFor the record, you can use the commerce API to load the entire payment object (or objects in case of multiple transactions) pretty easily:
Comment #4
samba b commented@cafuego Thanks! This saved my day! :)
Comment #5
tostinni commentedI found this answer too but it's important to notice that
commerce_payment_transaction_load_multiple()can also load unsuccessful attempt of the same transaction.So in order to retrieve only the correct object you have to make :