<?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: Charging Card using CIM in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Charging-Card-using-CIM/m-p/52688#M27913</link>
    <description>&lt;P&gt;So&amp;nbsp;I found the solution and in case anyone else needs it, I put the relevant parts below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$paymentProfile = new AnetAPI\PaymentProfileType();&lt;BR /&gt;$paymentProfile-&amp;gt;setPaymentProfileId("");&lt;/P&gt;&lt;P&gt;$profile = new AnetAPI\CustomerProfilePaymentType();&lt;BR /&gt;$profile-&amp;gt;setCustomerProfileId("");&lt;BR /&gt;$profile-&amp;gt;setPaymentProfile($paymentProfile);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$transactionRequestType = new AnetAPI\TransactionRequestType();&lt;BR /&gt;$transactionRequestType-&amp;gt;setTransactionType( "authCaptureTransaction");&lt;BR /&gt;$transactionRequestType-&amp;gt;setProfile($profile);&lt;/P&gt;</description>
    <pubDate>Thu, 22 Oct 2015 10:32:19 GMT</pubDate>
    <dc:creator>NewToThis</dc:creator>
    <dc:date>2015-10-22T10:32:19Z</dc:date>
    <item>
      <title>Charging Card using CIM</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Charging-Card-using-CIM/m-p/52686#M27911</link>
      <description>&lt;P&gt;Hey all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm having issues charging a credit using the CIM customer profile ID and payment ID. I looked at the example in the API reference, but I'm not seeing a place to put the profile ID and payment ID after the account&amp;nbsp;is already created. I put the code sample below, but the code seems to be pulling the payment information from the information used to create the CIM&amp;nbsp;profile. Any advice would be greatly appreciated!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Create additional payment data and add a new credit card&lt;BR /&gt;$creditCard = new AnetAPI\CreditCardType();&lt;BR /&gt;$creditCard-&amp;gt;setCardNumber( "4007000000027" );&lt;BR /&gt;$creditCard-&amp;gt;setExpirationDate( "2038-12");&lt;BR /&gt;$paymentTwo = new AnetAPI\PaymentType();&lt;BR /&gt;$paymentTwo-&amp;gt;setCreditCard($creditCard);&lt;/P&gt;&lt;P&gt;$request = new AnetAPI\CreateCustomerPaymentProfileRequest();&lt;BR /&gt;$request-&amp;gt;setMerchantAuthentication($merchantAuthentication);&lt;BR /&gt;$request-&amp;gt;setRefId( $refId);&lt;BR /&gt;$request-&amp;gt;setCustomerProfileId($customerProfileId);&lt;/P&gt;&lt;P&gt;$paymentprofile2 = new AnetAPI\CustomerPaymentProfileType();&lt;BR /&gt;$paymentprofile2-&amp;gt;setCustomerType('business');&lt;BR /&gt;$paymentprofile2-&amp;gt;setBillTo($billto);&lt;BR /&gt;$paymentprofile2-&amp;gt;setPayment($paymentTwo);&lt;BR /&gt;$paymentprofiles2[] = $paymentprofile2;&lt;/P&gt;&lt;P&gt;$request-&amp;gt;setPaymentProfile($paymentprofile2);&lt;BR /&gt;$controller = new AnetController\CreateCustomerPaymentProfileController($request);&lt;BR /&gt;$response = $controller-&amp;gt;executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);&lt;BR /&gt;if (($response != null) &amp;amp;&amp;amp; ($response-&amp;gt;getMessages()-&amp;gt;getResultCode() == "Ok") )&lt;BR /&gt;{&lt;BR /&gt;echo "CreateCustomerPaymentProfileRequest SUCCESS: PROFILE ID : " . $response-&amp;gt;getCustomerPaymentProfileId() . "\n";&lt;BR /&gt;$customerProfileId = $response-&amp;gt;getCustomerPaymentProfileId();&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;echo "CreateCustomerPaymentProfileRequest ERROR : Invalid response\n";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$transactionRequestType = new AnetAPI\TransactionRequestType();&lt;BR /&gt;$transactionRequestType-&amp;gt;setTransactionType( "authCaptureTransaction");&lt;BR /&gt;$transactionRequestType-&amp;gt;setAmount(100.50);&lt;BR /&gt;$transactionRequestType-&amp;gt;setPayment($paymentprofile2-&amp;gt;getPayment());&lt;BR /&gt;$transactionRequestType-&amp;gt;setOrder($order);&lt;BR /&gt;$transactionRequestType-&amp;gt;addToLineItems($lineitem);&lt;BR /&gt;$transactionRequestType-&amp;gt;setTax($tax);&lt;BR /&gt;//$transactionRequestType-&amp;gt;setPoNumber($ponumber);&lt;BR /&gt;//$transactionRequestType-&amp;gt;setCustomer($customer);&lt;BR /&gt;$transactionRequestType-&amp;gt;setBillTo($billto);&lt;BR /&gt;$transactionRequestType-&amp;gt;setShipTo($shipto);&lt;BR /&gt;$request = new AnetAPI\CreateTransactionRequest();&lt;BR /&gt;$request-&amp;gt;setMerchantAuthentication($merchantAuthentication);&lt;BR /&gt;$request-&amp;gt;setRefId( $refId);&lt;BR /&gt;$request-&amp;gt;setTransactionRequest( $transactionRequestType);&lt;BR /&gt;$controller = new AnetController\CreateTransactionController($request);&lt;BR /&gt;$response = $controller-&amp;gt;executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::SANDBOX);&lt;BR /&gt;if ($response != null)&lt;BR /&gt;{&lt;BR /&gt;$tresponse = $response-&amp;gt;getTransactionResponse();&lt;BR /&gt;if (($tresponse != null) &amp;amp;&amp;amp; ($tresponse-&amp;gt;getResponseCode()=="1") )&lt;BR /&gt;{&lt;BR /&gt;echo "Charge Customer Profile APPROVED :" . "\n";&lt;BR /&gt;echo " Charge Customer Profile AUTH CODE : " . $tresponse-&amp;gt;getAuthCode() . "\n";&lt;BR /&gt;echo " Charge Customer Profile TRANS ID : " . $tresponse-&amp;gt;getTransId() . "\n";&lt;BR /&gt;}&lt;BR /&gt;elseif (($tresponse != null) &amp;amp;&amp;amp; ($tresponse-&amp;gt;getResponseCode()=="2") )&lt;BR /&gt;{&lt;BR /&gt;echo "ERROR" . "\n";&lt;BR /&gt;}&lt;BR /&gt;elseif (($tresponse != null) &amp;amp;&amp;amp; ($tresponse-&amp;gt;getResponseCode()=="4") )&lt;BR /&gt;{&lt;BR /&gt;echo "ERROR: HELD FOR REVIEW:" . "\n";&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 00:50:49 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Charging-Card-using-CIM/m-p/52686#M27911</guid>
      <dc:creator>NewToThis</dc:creator>
      <dc:date>2015-10-22T00:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Charging Card using CIM</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Charging-Card-using-CIM/m-p/52688#M27913</link>
      <description>&lt;P&gt;So&amp;nbsp;I found the solution and in case anyone else needs it, I put the relevant parts below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$paymentProfile = new AnetAPI\PaymentProfileType();&lt;BR /&gt;$paymentProfile-&amp;gt;setPaymentProfileId("");&lt;/P&gt;&lt;P&gt;$profile = new AnetAPI\CustomerProfilePaymentType();&lt;BR /&gt;$profile-&amp;gt;setCustomerProfileId("");&lt;BR /&gt;$profile-&amp;gt;setPaymentProfile($paymentProfile);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$transactionRequestType = new AnetAPI\TransactionRequestType();&lt;BR /&gt;$transactionRequestType-&amp;gt;setTransactionType( "authCaptureTransaction");&lt;BR /&gt;$transactionRequestType-&amp;gt;setProfile($profile);&lt;/P&gt;</description>
      <pubDate>Thu, 22 Oct 2015 10:32:19 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Charging-Card-using-CIM/m-p/52688#M27913</guid>
      <dc:creator>NewToThis</dc:creator>
      <dc:date>2015-10-22T10:32:19Z</dc:date>
    </item>
  </channel>
</rss>

