<?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 Re: CIM java code for charging an existing customer profile in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46771#M23640</link>
    <description>&lt;P&gt;Missing an amount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;doc in here&lt;/P&gt;&lt;P&gt;&lt;A href="http://developer.authorize.net/api/cim/" target="_blank"&gt;http://developer.authorize.net/api/cim/&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 02 Sep 2014 11:14:21 GMT</pubDate>
    <dc:creator>RaynorC1emen7</dc:creator>
    <dc:date>2014-09-02T11:14:21Z</dc:date>
    <item>
      <title>CIM java code for charging an existing customer profile</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46767#M23639</link>
      <description>&lt;P&gt;I've got my code so that I can create customer profiles and payment profiles, but I'm running into a wall when trying to build the code to be able to charge one of those customer profiles.&lt;BR /&gt;&lt;BR /&gt;I've coded to the&amp;nbsp;&lt;A href="https://github.com/AuthorizeNet/sdk-java/blob/master/src/test/java/net/authorize/cim/functional_test/CIMTest.java" target="_blank"&gt;CIMTest.java&lt;/A&gt;&amp;nbsp;code as such:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;// Create an auth capture txn request
net.authorize.cim.Transaction transaction = merchant.createCIMTransaction(TransactionType.CREATE_CUSTOMER_PROFILE_TRANSACTION);

transaction.setRefId(refId);
transaction.setCustomerProfileId(customerProfileId);
transaction.setCustomerPaymentProfileId(customerPaymentProfileId);
//transaction.setCustomerShippingAddressId(customerShippingAddressId);  // not adding a shipping address

paymentTransaction.setTransactionType(net.authorize.TransactionType.AUTH_CAPTURE);
transaction.setPaymentTransaction(paymentTransaction);

Result&amp;lt;Transaction&amp;gt; result = (Result&amp;lt;Transaction&amp;gt;) merchant.postTransaction(transaction);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which produces this xml:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;?xml version="1.0"?&amp;gt;
&amp;lt;createCustomerProfileTransactionRequest xmlns="AnetApi/xml/v1/schema/AnetApiSchema.xsd"&amp;gt;
	&amp;lt;merchantAuthentication&amp;gt;
		&amp;lt;name&amp;gt;xxxxxxxxx&amp;lt;/name&amp;gt;
		&amp;lt;transactionKey&amp;gt;xxxxxxxxxxxxxxxx&amp;lt;/transactionKey&amp;gt;
	&amp;lt;/merchantAuthentication&amp;gt;
	&amp;lt;refId&amp;gt;REFID:1409637084474&amp;lt;/refId&amp;gt;
	&amp;lt;transaction&amp;gt;
		&amp;lt;profileTransAuthCapture&amp;gt;
			&amp;lt;customerProfileId&amp;gt;28572301&amp;lt;/customerProfileId&amp;gt;
			&amp;lt;customerPaymentProfileId&amp;gt;25939915&amp;lt;/customerPaymentProfileId&amp;gt;
			&amp;lt;recurringBilling&amp;gt;false&amp;lt;/recurringBilling&amp;gt;
		&amp;lt;/profileTransAuthCapture&amp;gt;
	&amp;lt;/transaction&amp;gt;
&amp;lt;/createCustomerProfileTransactionRequest&amp;gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;and when that is posted this error comes back:&lt;BR /&gt;&lt;BR /&gt;E00003:The element 'profileTransAuthCapture' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'&lt;BR /&gt;has invalid child element 'customerProfileId' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.&lt;BR /&gt;List of possible elements expected: 'amount' in namespace 'AnetApi/xml/v1/schema/AnetApiSchema.xsd'.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I've got the same code basically that is in&amp;nbsp;the auth.net&amp;nbsp;unit test code,&amp;nbsp;So what's wrong with this? &amp;nbsp;&lt;/P&gt;&lt;P&gt;Why doesn't this work? &amp;nbsp;And what do I have to change to make it work?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 05:55:37 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46767#M23639</guid>
      <dc:creator>wavebiddev</dc:creator>
      <dc:date>2014-09-02T05:55:37Z</dc:date>
    </item>
    <item>
      <title>Re: CIM java code for charging an existing customer profile</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46771#M23640</link>
      <description>&lt;P&gt;Missing an amount&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;doc in here&lt;/P&gt;&lt;P&gt;&lt;A href="http://developer.authorize.net/api/cim/" target="_blank"&gt;http://developer.authorize.net/api/cim/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 11:14:21 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46771#M23640</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2014-09-02T11:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: CIM java code for charging an existing customer profile</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46775#M23642</link>
      <description>&lt;P&gt;Thank you for your response. &amp;nbsp;I've read through the doc and the code and obviously the error and your post. &amp;nbsp;I still don't see anything that explains&amp;nbsp;why profileTransAuthCapture doesn't like the customerProfileId child element. &amp;nbsp;Also if I'm missing the amount, then how/where do I add it? &amp;nbsp;I'm using JAVA so I'm not directly manipulating the XML and there for I can't just add in a tag. &amp;nbsp;(I wish I could, this would be easier).&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;To me it looks like the library is not working as it should.&lt;BR /&gt;&lt;BR /&gt;Maybe I need to use the Order object? &amp;nbsp;Is there example Java code somewhere for this? &amp;nbsp;Nothing in the example code I can find shows how to charge an existing Customer Profile.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 13:49:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46775#M23642</guid>
      <dc:creator>wavebiddev</dc:creator>
      <dc:date>2014-09-02T13:49:15Z</dc:date>
    </item>
    <item>
      <title>Re: CIM java code for charging an existing customer profile</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46777#M23643</link>
      <description>&lt;P&gt;The error is saiding amount is required and it should be before customerprofileid.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;look at the &lt;SPAN&gt;public&lt;/SPAN&gt; &lt;SPAN&gt;void&lt;/SPAN&gt; &lt;SPAN&gt;setUp&lt;/SPAN&gt;&lt;SPAN&gt;()&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;order&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;Order&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;createOrder&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;....&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;paymentTransaction&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;setOrder&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;order&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Sep 2014 14:02:23 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/46777#M23643</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2014-09-02T14:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: CIM java code for charging an existing customer profile</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/70028#M42928</link>
      <description>&lt;P&gt;We were able to successfully use the invoice number in Java.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Look under OrderType.&amp;nbsp; You can set both Invoice Number (as invoiceNum) and a Description (as decription).&amp;nbsp; Here is the piece of our code where we set it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;// Create the payment transaction request
        TransactionRequestType txnRequest = new TransactionRequestType();
        txnRequest.setTransactionType(TransactionTypeEnum.AUTH_CAPTURE_TRANSACTION.value());
        txnRequest.setAmount(new BigDecimal(amountTotal).setScale(2, RoundingMode.CEILING));
        txnRequest.setProfile(profileToCharge);
        OrderType ot=new OrderType();
        ot.setInvoiceNumber("Put Your Invoice Number Here");
        ot.setDescription("A description of the transaction");
        txnRequest.setOrder(ot);
        ArrayOfLineItem lineItemsArray = new ArrayOfLineItem();
            List&amp;lt;LineItemType&amp;gt; lineItems = lineItemsArray.getLineItem();
            LineItemType line1 = new LineItemType();
            line1.setName("Some Detail");
            line1.setDescription("Some Detail Description");
            line1.setItemId("1");
            line1.setQuantity( BigDecimal.valueOf( 1 ) );
            line1.setTaxable( false );
            line1.setUnitPrice( BigDecimal.valueOf(amount) );
            lineItems.add( line1 );
            LineItemType line2 = new LineItemType();
            line2.setName("Another Item");
            line2.setDescription("Another description for the 2nd item");
            line2.setItemId("2");
            line2.setQuantity( BigDecimal.valueOf( 1 ) );
            line2.setTaxable( false );
            line2.setUnitPrice( BigDecimal.valueOf(adminfee) );
            lineItems.add( line2 );&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Dec 2019 05:42:20 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/CIM-java-code-for-charging-an-existing-customer-profile/m-p/70028#M42928</guid>
      <dc:creator>kennydavis416</dc:creator>
      <dc:date>2019-12-17T05:42:20Z</dc:date>
    </item>
  </channel>
</rss>

