File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 */
1212class PaymentStorage extends CommerceContentEntityStorage implements PaymentStorageInterface {
1313
14+ /**
15+ * {@inheritdoc}
16+ */
17+ public function loadByRemoteId ($ remote_id ) {
18+ $ payments = $ this ->loadByProperties (['remote_id ' => $ remote_id ]);
19+ $ payment = reset ($ payments );
20+
21+ return $ payment ?: NULL ;
22+ }
23+
1424 /**
1525 * {@inheritdoc}
1626 */
Original file line number Diff line number Diff line change 1010 */
1111interface PaymentStorageInterface extends ContentEntityStorageInterface {
1212
13+ /**
14+ * Loads the payment for the given remote ID.
15+ *
16+ * @param string $remote_id
17+ * The remote ID.
18+ *
19+ * @return \Drupal\commerce_payment\Entity\PaymentInterface|null
20+ * The payment, or NULL if none found.
21+ */
22+ public function loadByRemoteId ($ remote_id );
23+
1324 /**
1425 * Loads all payments for the given order.
1526 *
You can’t perform that action at this time.
0 commit comments