Skip to Content
author's profile photo Former Member
Former Member

Any idea why authorizePayment(..) method of DefaultCheckoutFacade.java returning "false"?

Hello,

We are integrating Cybersource with our B2B store. We are able to make authorization and tokenization after successful integration with Cybersource. Have checked in Cybersource portal as well, and looks like, subscription is getting created successfully.

However, the problem is, when hybris is making authorizePayment(null) call from DefaultCheckoutFacade.java

We are calling authorizePayment(..) method by passing "null" and it is returning "false" for us.

Any help will be greatly appreciated. Thank you!

public boolean authorizePayment(final String securityCode) { final CartModel cartModel = getCart(); if (cartModel != null) { final UserModel currentUser = getCurrentUserForCheckout(); if (cartModel.getUser().equals(currentUser)) { final CreditCardPaymentInfoModel creditCardPaymentInfoModel = (CreditCardPaymentInfoModel) cartModel.getPaymentInfo(); if (creditCardPaymentInfoModel != null && StringUtils.isNotBlank(creditCardPaymentInfoModel.getSubscriptionId())) { final PaymentTransactionEntryModel paymentTransactionEntryModel = getCommerceCheckoutService().authorizePayment( cartModel, securityCode, getPaymentProvider()); return paymentTransactionEntryModel != null && (TransactionStatus.ACCEPTED.name().equals(paymentTransactionEntryModel.getTransactionStatus()) || TransactionStatus.REVIEW .name().equals(paymentTransactionEntryModel.getTransactionStatus())); } } } return false; }

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 15, 2015 at 01:22 AM

    This config is loaded in this bean in cybersource-spring.xml:

         <!--
             factory for executor instances. An Executor is needed to perform every
             single request to Cybersource PSP
         -->
         <bean name="executorFactory"
             class="de.hybris.platform.cybersource.adapter.impl.ExecutorFactoryImpl">
             <property name="codeTranslator">
                 <ref bean="codeTranslator" />
             </property>
             <property name="cybersourceFactory">
                 <ref bean="dtoFactory" />
             </property>
             <property name="cardRegistry">
                 <ref bean="cardRegistry" />
             </property>
         </bean>
     
    

    You need a decompiler like JD or JD-GUI to look at it in cybersourceserver.jar. Try to reimplement and register that as a custom spring bean outside the .jar, then you can check if this is called for every tenant. If yes you are lucky, then you can simply load different files here.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 13, 2015 at 07:57 AM

    A call with securityCode == null causes the false to be returned? Have you tried to give a (fake) security code? Why do you need securityCode to be null? Is there cards without security code at all today?

    Researched this a bit and I see that up until the call to the actual PaymentProvider there is no check on security code, if it's filled or not, the hybris side doesn't care.

    That means the authorization at the payment provider (Cybersource) fails and no TransactionStatus.ACCEPTED or REVIEW are returned.

    Debug and view or log the returned "paymentTransactionEntryModel" to confirm.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 14, 2015 at 08:06 PM

    Thank you Konard for your prompt reply.

    Actually, we have identified the problem , however, not sure how to fix the same. The issue is with the "merchant id" that we are using for Cybersource. We are having tenant specific merchant ID. Merchant ID 1 is related to master and Merchant ID 2 is associated with slave.

    However, cybs.properties file is having only master specific Merchant ID, and in our tenant.properties file, we tried to specify slave related Merchant ID. Looks like, the above approach did not work.

    Can you please provide any guidance on how to define separate merchant ID for slave tenant?

    Thank You!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.