[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Have accessor var= still undefined

dpenney@gmail.com

6/27/2006 4:37:00 PM

So here is the snippet that defines the DoDirectPaymentRequestType
(this is all trying to use the PayPal API)

# {urn:ebay:api:PayPalAPI}DoDirectPaymentRequestType
class DoDirectPaymentRequestType
@@schema_type = "DoDirectPaymentRequestType"
@@schema_ns = "urn:ebay:api:PayPalAPI"
@@schema_element = [
["detailLevel", ["DetailLevelCodeType[]",
XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "DetailLevel")]],
["errorLanguage", ["SOAP::SOAPString",
XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "ErrorLanguage")]],
["messageID", ["SOAP::SOAPString",
XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "MessageID")]],
["version", ["SOAP::SOAPString",
XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "Version")]],
["any", [nil, XSD::QName.new("http://www.w3.org/2001/XMLSc...,
"anyType")]],
["doDirectPaymentRequestDetails",
["DoDirectPaymentRequestDetailsType",
XSD::QName.new("urn:ebay:apis:eBLBaseComponents",
"DoDirectPaymentRequestDetails")]]
]

attr_accessor :detailLevel
attr_accessor :errorLanguage
attr_accessor :messageID
attr_accessor :version
attr_reader :__xmlele_any
attr_accessor :doDirectPaymentRequestDetails


The code to access it is

def Paypal.directauth(params,live=nil)
client = create_client(live)

directreq = DoDirectPaymentReq.new
drtype = DoDirectPaymentRequestType.new
directreq.doDirectPaymentRequest = drtype
drtype.version= "2.0"
dtype = DoDirectPaymentRequestDetailsType.new
dtype.iPAddress = params[:ip]


But all I get is

test_failed_authorization(PaypalTest):
NoMethodError: undefined method `version=' for
#<DoDirectPaymentRequestType:0x3a
20c60>
C:/ruby/store/vendor/plugins/paypal/test/../lib/paypal.rb:186:in
`directauth
'

What am I doing wrong here?

1 Answer

dpenney@gmail.com

6/27/2006 4:48:00 PM

0

Urgh, changed the code in the wrong spot, was looking at an old class
file :)


dpenney@gmail.com wrote:
> So here is the snippet that defines the DoDirectPaymentRequestType
> (this is all trying to use the PayPal API)
>
> # {urn:ebay:api:PayPalAPI}DoDirectPaymentRequestType
> class DoDirectPaymentRequestType
> @@schema_type = "DoDirectPaymentRequestType"
> @@schema_ns = "urn:ebay:api:PayPalAPI"
> @@schema_element = [
> ["detailLevel", ["DetailLevelCodeType[]",
> XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "DetailLevel")]],
> ["errorLanguage", ["SOAP::SOAPString",
> XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "ErrorLanguage")]],
> ["messageID", ["SOAP::SOAPString",
> XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "MessageID")]],
> ["version", ["SOAP::SOAPString",
> XSD::QName.new("urn:ebay:apis:eBLBaseComponents", "Version")]],
> ["any", [nil, XSD::QName.new("http://www.w3.org/2001/XMLSc...,
> "anyType")]],
> ["doDirectPaymentRequestDetails",
> ["DoDirectPaymentRequestDetailsType",
> XSD::QName.new("urn:ebay:apis:eBLBaseComponents",
> "DoDirectPaymentRequestDetails")]]
> ]
>
> attr_accessor :detailLevel
> attr_accessor :errorLanguage
> attr_accessor :messageID
> attr_accessor :version
> attr_reader :__xmlele_any
> attr_accessor :doDirectPaymentRequestDetails
>
>
> The code to access it is
>
> def Paypal.directauth(params,live=nil)
> client = create_client(live)
>
> directreq = DoDirectPaymentReq.new
> drtype = DoDirectPaymentRequestType.new
> directreq.doDirectPaymentRequest = drtype
> drtype.version= "2.0"
> dtype = DoDirectPaymentRequestDetailsType.new
> dtype.iPAddress = params[:ip]
>
>
> But all I get is
>
> test_failed_authorization(PaypalTest):
> NoMethodError: undefined method `version=' for
> #<DoDirectPaymentRequestType:0x3a
> 20c60>
> C:/ruby/store/vendor/plugins/paypal/test/../lib/paypal.rb:186:in
> `directauth
> '
>
> What am I doing wrong here?