title: What is the equivalent of the "bank_account" type/object under the Charge API in the newer Payments API in Stripe?
body: <p>I'm working on migrating our codebase from using the Source API to the Payments API in Stripe. As a jumping off point I've been <a href="https://stripe.com/docs/payments/payment-methods/transitioning" rel="nofollow noreferrer">following this migration guide</a>.  I'm at the point where I'm <a href="https://stripe.com/docs/payments/payment-intents/migration/charges?read-migration=sources#read" rel="nofollow noreferrer">migrating our code that reads from charges</a> and am trying to figure out what the new equivalent of the type &quot;bank_account&quot; may be.</p>
  <p>An example of our current code is as follows:</p>
  <pre><code>const source = charge.source;  // charge is of type Stripe.Charge
  
  if (source.object === 'card') {
     let month = source.exp_month;
     let lastFour = source.last4;
     ... 
  } else if (source.object === 'bank_account') {
     let bank = source.metadata.bank;
     let fingerprint = source.fingerprint;
     ...
  } else {
     ...
  }
  </code></pre>
  <p>For the migration aspect I have this so far, with the question being how to handle our existing check for 'bank_account':</p>
  <pre><code>const paymentMethodDetails = charge.payment_method_details;  // charge is of type Stripe.Charge
  
  if (paymentMethodDetails.type === 'card') {
     let month = paymentMethodDetails.card.exp_month;
     let lastFour = paymentMethodDetails.card.last4;
     ... 
  } else if (paymentMethodDetails.type === ?????) { // &lt;-- here's the question
     let bank = paymentMethodDetails.??????
     let fingerprint = paymentMethodDetails.??????
     ...
  } else {
     ...
  }
  </code></pre>
  <p>The list of types in the Stripe documentation doesn't include &quot;bank_account&quot; as an option, and while there is a payment_method.details.card object available, there isn't a payment_method_details.bank_account object available.</p>
  <p>Any guidance is very much appreciated!</p>