<?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: Ruby on Rails Variables for Information in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Ruby-on-Rails-Variables-for-Information/m-p/61007#M35514</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/22654"&gt;@camerson2017&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The reason why you are getting this error is because 'amount' is not a normal variable in your case. It is an instance variable. Getting and setting instance variable is a bit different in case of ruby. The change is only reflected after it is instantiated via calling class method or while the instantiation of a class. Here's is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="kwd"&gt;class&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Hi&lt;/SPAN&gt;
  &lt;SPAN class="kwd"&gt;def&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; callme
    &lt;/SPAN&gt;&lt;SPAN class="lit"&gt;@hello&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"hello"&lt;/SPAN&gt;
  &lt;SPAN class="kwd"&gt;end&lt;/SPAN&gt;
&lt;SPAN class="kwd"&gt;end&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;h &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Hi&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;new
p h&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;instance_variables 

h&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.callme&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;p h&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;instance_variables

&lt;/SPAN&gt;&lt;SPAN class="com"&gt;# Output&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;[]&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"@hello"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Dec 2017 09:50:38 GMT</pubDate>
    <dc:creator>AforANET</dc:creator>
    <dc:date>2017-12-28T09:50:38Z</dc:date>
    <item>
      <title>Ruby on Rails Variables for Information</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Ruby-on-Rails-Variables-for-Information/m-p/60515#M35041</link>
      <description>&lt;P&gt;I keep getting errors when I try to use variables instead of inserting exact details. Here is my current code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;request &lt;/SPAN&gt;= &lt;SPAN&gt;CreateTransactionRequest&lt;/SPAN&gt;.new&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@amount &lt;/SPAN&gt;= session[&lt;SPAN&gt;:form_total&lt;/SPAN&gt;]&lt;BR /&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;.transactionRequest = &lt;SPAN&gt;TransactionRequestType&lt;/SPAN&gt;.new()&lt;BR /&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;.transactionRequest.amount = &lt;SPAN&gt;@amount&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;.transactionRequest.payment = &lt;SPAN&gt;PaymentType&lt;/SPAN&gt;.new&lt;BR /&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;.transactionRequest.payment.creditCard = &lt;SPAN&gt;CreditCardType&lt;/SPAN&gt;.new(&lt;SPAN&gt;'4111111111111111'&lt;/SPAN&gt;,&lt;SPAN&gt;'0220'&lt;/SPAN&gt;,&lt;SPAN&gt;'123'&lt;/SPAN&gt;)&lt;BR /&gt;&lt;SPAN&gt;request&lt;/SPAN&gt;.transactionRequest.transactionType = &lt;SPAN&gt;TransactionTypeEnum&lt;/SPAN&gt;::&lt;SPAN&gt;AuthCaptureTransaction&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;For this example, it gives me an error that a valid amount is required. The issue is that it isn't just there. In CreditCardType.new, you'll see in this example that there are test numbers. Those work. However, if I replace them with variables, it will not work and will give me an error for that as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas? Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Nov 2017 01:51:58 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Ruby-on-Rails-Variables-for-Information/m-p/60515#M35041</guid>
      <dc:creator>camerson2017</dc:creator>
      <dc:date>2017-11-15T01:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Ruby on Rails Variables for Information</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/Ruby-on-Rails-Variables-for-Information/m-p/61007#M35514</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.developer.cybersource.com/t5/user/viewprofilepage/user-id/22654"&gt;@camerson2017&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;The reason why you are getting this error is because 'amount' is not a normal variable in your case. It is an instance variable. Getting and setting instance variable is a bit different in case of ruby. The change is only reflected after it is instantiated via calling class method or while the instantiation of a class. Here's is an example:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN class="kwd"&gt;class&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Hi&lt;/SPAN&gt;
  &lt;SPAN class="kwd"&gt;def&lt;/SPAN&gt;&lt;SPAN class="pln"&gt; callme
    &lt;/SPAN&gt;&lt;SPAN class="lit"&gt;@hello&lt;/SPAN&gt; &lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="str"&gt;"hello"&lt;/SPAN&gt;
  &lt;SPAN class="kwd"&gt;end&lt;/SPAN&gt;
&lt;SPAN class="kwd"&gt;end&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;h &lt;/SPAN&gt;&lt;SPAN class="pun"&gt;=&lt;/SPAN&gt; &lt;SPAN class="typ"&gt;Hi&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;new
p h&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;instance_variables 

h&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.callme&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;p h&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln"&gt;instance_variables

&lt;/SPAN&gt;&lt;SPAN class="com"&gt;# Output&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;[]&lt;/SPAN&gt;
&lt;SPAN class="pun"&gt;[&lt;/SPAN&gt;&lt;SPAN class="str"&gt;"@hello"&lt;/SPAN&gt;&lt;SPAN class="pun"&gt;]&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 09:50:38 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/Ruby-on-Rails-Variables-for-Information/m-p/61007#M35514</guid>
      <dc:creator>AforANET</dc:creator>
      <dc:date>2017-12-28T09:50:38Z</dc:date>
    </item>
  </channel>
</rss>

