<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using Bank Accounts With Authorize.Net C# SDK in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Using-Bank-Accounts-With-Authorize-Net-C-SDK/m-p/85285#M53636</link>
    <description>&lt;P&gt;After playing around with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://developer.authorize.net/downloads/samplecode/" target="_blank" rel="noopener noreferrer"&gt;Authorize.Net CIM XML API C# sample code&lt;/A&gt;&amp;nbsp;&lt;A href="https://www.developerbook.net/" target="_blank" rel="noopener"&gt;/developerbook&lt;/A&gt;,&amp;nbsp; &amp;nbsp;I started using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://developer.authorize.net/downloads/" target="_blank" rel="noopener noreferrer"&gt;Authorize.Net C# SDK&lt;/A&gt;&amp;nbsp;&lt;A href="https://chatrandom.download" target="_blank" rel="noopener"&gt;/chatrandom&lt;/A&gt;. I am able to add credit cards and bank accounts to customer profiles using the CIM XML API sample code. I don't see how to add bank accounts using the SDK though.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;I use this subscription extension&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://ecommerce.aheadworks.com/magento-extensions/subscriptions-and-recurring-payments.html" target="_blank" rel="nofollow noopener"&gt;http://ecommerce.aheadworks.com/magento-extensions/subscriptions-and-recurring-payments.html&lt;/A&gt;&amp;nbsp;&lt;A href="https://omegle.ws" target="_blank" rel="noopener"&gt;/ome&lt;/A&gt;&lt;A href="https://omegle.club" target="_blank" rel="noopener"&gt;gle&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Adding bank account with CIM XML API:&lt;/P&gt;&lt;PRE&gt;...
customerPaymentProfileType new_payment_profile = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; customerPaymentProfileType();
paymentType new_payment = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; paymentType();

bankAccountType new_bank = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; bankAccountType();
new_bank.nameOnAccount = &lt;SPAN class=""&gt;"xyz"&lt;/SPAN&gt;;
new_bank.accountNumber = &lt;SPAN class=""&gt;"4111111"&lt;/SPAN&gt;;
new_bank.routingNumber = &lt;SPAN class=""&gt;"325070760"&lt;/SPAN&gt;;
new_payment.Item = new_bank;

new_payment_profile.payment = new_payment;

createCustomerPaymentProfileRequest request = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; createCustomerPaymentProfileRequest();
XmlAPIUtilities.PopulateMerchantAuthentication((ANetApiRequest)request);

request.customerProfileId = profile_id.ToString();
request.paymentProfile = new_payment_profile;
request.validationMode = validationModeEnum.testMode;
...&lt;/PRE&gt;&lt;P&gt;Using the SDK I only see a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;.AddCreditCard()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;method, but no way to add a bank account. When I loop through all my&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;PaymentProfiles&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;It throws an exception when it comes across a bank account too:&lt;/P&gt;&lt;PRE&gt;CustomerGateway cg = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; CustomerGateway(&lt;SPAN class=""&gt;"xxx"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"yyy"&lt;/SPAN&gt;);

&lt;SPAN class=""&gt;foreach&lt;/SPAN&gt; (&lt;SPAN class=""&gt;string&lt;/SPAN&gt; cid &lt;SPAN class=""&gt;in&lt;/SPAN&gt; cg.GetCustomerIDs())
{
    Customer c = cg.GetCustomer(cid);
    &lt;SPAN class=""&gt;foreach&lt;/SPAN&gt; (PaymentProfile pp &lt;SPAN class=""&gt;in&lt;/SPAN&gt; c.PaymentProfiles)
    {
        Console.WriteLine(pp.ToString());
    }
}&lt;/PRE&gt;&lt;P&gt;Exception:&lt;/P&gt;&lt;PRE&gt;Unable to cast &lt;SPAN class=""&gt;object&lt;/SPAN&gt; of type &lt;SPAN class=""&gt;'AuthorizeNet.APICore.bankAccountMaskedType'&lt;/SPAN&gt; to type &lt;SPAN class=""&gt;'AuthorizeNet.APICore.creditCardMaskedType'&lt;/SPAN&gt;.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 19 Dec 2022 08:28:43 GMT</pubDate>
    <dc:creator>LansoirThemos</dc:creator>
    <dc:date>2022-12-19T08:28:43Z</dc:date>
    <item>
      <title>Using Bank Accounts With Authorize.Net C# SDK</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Using-Bank-Accounts-With-Authorize-Net-C-SDK/m-p/85285#M53636</link>
      <description>&lt;P&gt;After playing around with the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://developer.authorize.net/downloads/samplecode/" target="_blank" rel="noopener noreferrer"&gt;Authorize.Net CIM XML API C# sample code&lt;/A&gt;&amp;nbsp;&lt;A href="https://www.developerbook.net/" target="_blank" rel="noopener"&gt;/developerbook&lt;/A&gt;,&amp;nbsp; &amp;nbsp;I started using the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://developer.authorize.net/downloads/" target="_blank" rel="noopener noreferrer"&gt;Authorize.Net C# SDK&lt;/A&gt;&amp;nbsp;&lt;A href="https://chatrandom.download" target="_blank" rel="noopener"&gt;/chatrandom&lt;/A&gt;. I am able to add credit cards and bank accounts to customer profiles using the CIM XML API sample code. I don't see how to add bank accounts using the SDK though.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;I use this subscription extension&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://ecommerce.aheadworks.com/magento-extensions/subscriptions-and-recurring-payments.html" target="_blank" rel="nofollow noopener"&gt;http://ecommerce.aheadworks.com/magento-extensions/subscriptions-and-recurring-payments.html&lt;/A&gt;&amp;nbsp;&lt;A href="https://omegle.ws" target="_blank" rel="noopener"&gt;/ome&lt;/A&gt;&lt;A href="https://omegle.club" target="_blank" rel="noopener"&gt;gle&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Adding bank account with CIM XML API:&lt;/P&gt;&lt;PRE&gt;...
customerPaymentProfileType new_payment_profile = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; customerPaymentProfileType();
paymentType new_payment = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; paymentType();

bankAccountType new_bank = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; bankAccountType();
new_bank.nameOnAccount = &lt;SPAN class=""&gt;"xyz"&lt;/SPAN&gt;;
new_bank.accountNumber = &lt;SPAN class=""&gt;"4111111"&lt;/SPAN&gt;;
new_bank.routingNumber = &lt;SPAN class=""&gt;"325070760"&lt;/SPAN&gt;;
new_payment.Item = new_bank;

new_payment_profile.payment = new_payment;

createCustomerPaymentProfileRequest request = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; createCustomerPaymentProfileRequest();
XmlAPIUtilities.PopulateMerchantAuthentication((ANetApiRequest)request);

request.customerProfileId = profile_id.ToString();
request.paymentProfile = new_payment_profile;
request.validationMode = validationModeEnum.testMode;
...&lt;/PRE&gt;&lt;P&gt;Using the SDK I only see a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;.AddCreditCard()&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;method, but no way to add a bank account. When I loop through all my&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;PaymentProfiles&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;It throws an exception when it comes across a bank account too:&lt;/P&gt;&lt;PRE&gt;CustomerGateway cg = &lt;SPAN class=""&gt;new&lt;/SPAN&gt; CustomerGateway(&lt;SPAN class=""&gt;"xxx"&lt;/SPAN&gt;, &lt;SPAN class=""&gt;"yyy"&lt;/SPAN&gt;);

&lt;SPAN class=""&gt;foreach&lt;/SPAN&gt; (&lt;SPAN class=""&gt;string&lt;/SPAN&gt; cid &lt;SPAN class=""&gt;in&lt;/SPAN&gt; cg.GetCustomerIDs())
{
    Customer c = cg.GetCustomer(cid);
    &lt;SPAN class=""&gt;foreach&lt;/SPAN&gt; (PaymentProfile pp &lt;SPAN class=""&gt;in&lt;/SPAN&gt; c.PaymentProfiles)
    {
        Console.WriteLine(pp.ToString());
    }
}&lt;/PRE&gt;&lt;P&gt;Exception:&lt;/P&gt;&lt;PRE&gt;Unable to cast &lt;SPAN class=""&gt;object&lt;/SPAN&gt; of type &lt;SPAN class=""&gt;'AuthorizeNet.APICore.bankAccountMaskedType'&lt;/SPAN&gt; to type &lt;SPAN class=""&gt;'AuthorizeNet.APICore.creditCardMaskedType'&lt;/SPAN&gt;.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2022 08:28:43 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Using-Bank-Accounts-With-Authorize-Net-C-SDK/m-p/85285#M53636</guid>
      <dc:creator>LansoirThemos</dc:creator>
      <dc:date>2022-12-19T08:28:43Z</dc:date>
    </item>
  </channel>
</rss>

