Authentication failed with Cybersource

6,793 views
Skip to first unread message

superm...@gmail.com

unread,
May 12, 2008, 12:17:51 PM5/12/08
to Active Merchant
Hi,

I have a cybersource account and I am trying to use ActiveMerchant
with it. I generated a transaction security page under my account and
used it in my purchase request.

Here is what I do.

@gateway_login = <my merchant id>
@gateway_pass = <generated transaction key>
@order_id = self.current_user.login + '@' + Time.now.to_s
@card = ActiveMerchant::Billing::CreditCard.new(params[:card])
gateway = ActiveMerchant::Billing::CyberSourceGateway.new(:login =>
@gateway_login, :password => @gateway_pass)
gateway_response = gateway.purchase(100, @card, :order_id =>
@order_id, :email => self.current_user.email)

And here is the response I got.
wsse:FailedCheck: Security Data : UsernameToken authentication failed.

Am I missing some setup? Also, is there a way to look at the SOAP
message being sent to their server?

Thanks
Andy

Cody Fauser

unread,
May 12, 2008, 1:58:33 PM5/12/08
to activem...@googlegroups.com
Andy,

Are you using a test account or live production account and are you
using the correct corresponding gateway mode in ActiveMerchant? The
default mode in ActiveMerchant is production.

--
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

superm...@gmail.com

unread,
May 14, 2008, 2:37:15 PM5/14/08
to Active Merchant
Thanks Cody.
It was the problem exactly.

TimBooher

unread,
May 28, 2008, 9:42:59 PM5/28/08
to Active Merchant
I am getting the same error -- but can't seem to get around it so
easily.

I have :

OrderTransaction.gateway =
ActiveMerchant::Billing::CyberSourceGateway.new(
:login => 'v1002822',
:password => 'my_password',
:test => true,
:vat_reg_number => 'your VAT registration number',
# sets the states/provinces where you have a physical presense for
tax purposes
:nexus => "GA OH",
# don‘t want to use AVS so continue processing even if AVS would
have failed
:ignore_avs => true,
# don‘t want to use CVV so continue processing even if CVV would
have failed
:ignore_cvv => true
)
and the following:
process('authorization', amount) do |gw|
gw.authorize(amount, credit_card, options)
end

where credit_card is a valid activeMerchant::billing:creditCard object
amount and options have their correct values.

i get the error: wsse:FailedCheck: Security Data : UsernameToken
authentication failed.

i am totally confused with this. any thoughts? I know i should use the
xxx.p12 file that CyberSource gave me, but I can't find any
documentation to teach me how to do this. how do i get to that
generated transaction key? is there a special ssl channel we use to
connect?

v/r,

Tim

TimBooher

unread,
May 28, 2008, 9:57:18 PM5/28/08
to Active Merchant
Part of the problem is that cybersource documentation says:

After you have the security key file or certificate files on your
system, follow
the instructions of your shopping cart provider to integrate these
files with your
shopping cart.

So, I guess it is ActiveMerchant documentation I am looking for?

best,

tim
> > > Cody Fauserhttp://shopify.com-e-commercedone righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJSTemplates for Rails
> > > Cody Fauserhttp://shopify.com-e-commercedone righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJSTemplates for Rails

Cody Fauser

unread,
May 28, 2008, 11:09:21 PM5/28/08
to activem...@googlegroups.com
You don't need the p12 file. That is for another CyberSource API. You
need to generate an API transaction key in the business center and use
that as the password.

--

TimBooher

unread,
May 29, 2008, 10:21:43 PM5/29/08
to Active Merchant
Wow -- so seldom have so few words saved a man so much time. thank you
so much, I was going down the completely wrong direction.

One last problem: Since cybersource measures in dollars, is there an
elegant way to covert in my amount. Per the peepcode, I am loading an
amount in cents, so I multiply my amount by 100, this naturally works
but then I have a total amount in my reports in the thousands. I can
divide again by 100, but I am sure there is a better way.

best,

tim
> >> > Cody Fauserhttp://shopify.com-e-commercedone righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJSTemplates for Rails
> >> > Cody Fauserhttp://shopify.com-e-commercedone righthttp://www.codyfauser.com-bloghttp://peepcode.com/products/activemerc...PeepCodehttp://www.oreilly.com/catalog/rjsrails-RJSTemplates for Rails
>
Reply all
Reply to author
Forward
0 new messages