The value '' is invalid according to its datatype

519 views
Skip to first unread message

anywho

unread,
May 27, 2009, 3:31:48 PM5/27/09
to Active Merchant
hi,

I'm using something similar as in the activemerchant book from
peepcode where I've got:

http://pastie.org/491800

class Transaction
...
def cim_charge(amount, payment_detail, options = {})
process('charge_cim', amount) do |gw|
gw.create_customer_profile_transaction(
:transaction => {
:customer_profile_id => payment_detail.profile_id,
:customer_payment_profile_id =>
payment_detail.payment_profile_id,
:type => :auth_capture,
:amount => amount
}
)
end
end

private
def process(action, amount = nil)
self.amount = amount
self.action = action

gateway = Gateway.get vendor_id
begin
response = yield gateway

self.success = response.success?
self.reference = response.authorization
self.message = response.message
self.params = response.params
self.test = response.test?
rescue ActiveMerchant::ActiveMerchantError => e
self.success = false
self.reference = nil
self.message = e.message
self.params = {}
self.test = gateway.test?
end

if not self.save
raise self.error_str
end
self
end
end

The transaction.message I get at the end is this:

"The 'AnetApi/xml/v1/schema/
AnetApiSchema.xsd:customerPaymentProfileId' element is invalid - The
value '' is invalid according to its datatype 'AnetApi/xml/v1/schema/
AnetApiSchema.xsd:numericString' - The Pattern constraint failed."


What does that mean in this context?

Cody Fauser

unread,
May 27, 2009, 4:59:11 PM5/27/09
to activem...@googlegroups.com
Looks like the customer profile ID isn't making it correctly to the CIM gateway.
--
Cody Fauser
http://shopify.com - e-commerce done right
http://www.codyfauser.com - blog
http://peepcode.com/products/activemerchant-pdf - ActiveMerchant PeepCode
http://www.oreilly.com/catalog/rjsrails - RJS Templates for Rails

anywho

unread,
May 27, 2009, 7:06:51 PM5/27/09
to Active Merchant
ok, thank you very much Cody :) I'll have a look.

Ivan Turkovic

unread,
Dec 12, 2011, 3:29:32 PM12/12/11
to activem...@googlegroups.com
did you manage to solve this issue?
Reply all
Reply to author
Forward
0 new messages