Giter VIP home page Giter VIP logo

adyen-hybris's Introduction

Adyen SAP Commerce (Hybris) v6 plugin

Latest stable version: https://github.com/Adyen/adyen-hybris/releases/tag/12.0.0

This plugin supports SAP Commerce (Hybris) versions 2105

The plugin is using following adyen libraries and API.

Integration

The SAP Commerce integrates Adyen Checkout for all card payments and local/redirect payment methods.

Requirements

SAP Commerce (Hybris) version 2105 or later

Installation

1. Copy extension files to bin/custom directory

2. Add the Adyen extensions to the config/localextensions.xml file

Checkout

Required for accelerator checkout:

<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6core"/>
<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6b2ccheckoutaddon"/>
<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6backoffice"/>

Required for headless checkout:

<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6core"/>
<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyencheckoutaddonapi"/>
<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6backoffice"/>

Required for headless checkout api with example React SPA checkout:

<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6core"/>
<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyencheckoutaddonapi"/>
<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyencheckoutaddonspa"/>
<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6backoffice"/>

Notifications

Required for the notifications:

<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6notification"/>

Required for the event driven notifications:

<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6notificationv2"/>

Order management

Additionally, required when using yacceleratorordermanagement (b2c_acc_oms recipe for 6.x and b2c_b2b_acc_oms recipe for 1905) :

<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6ordermanagement"/>

Fulfilment

Additionally, required when using yacceleratorfulfilment (b2c_acc recipe for 6.x and b2c_acc_plus for 1905):

<extension dir="${HYBRIS_BIN_DIR}/custom/adyen-hybris/adyenv6fulfilmentprocess"/>

3. Modify local.properties

Modify config/local.properties file:

  1. append ,/[^/]+(/[^?]*)+(adyen-response)$,/adyen(/[^?]*)+$ to the value of csrf.allowed.url.patterns
  2. add is3DS2allowed = true

4. Build

cd bin/platform
. ./setantenv.sh
ant addoninstall -Daddonnames="adyenv6b2ccheckoutaddon" -DaddonStorefront.yacceleratorstorefront="yacceleratorstorefront"
ant clean all

5. Add your Adyen credentials to the BaseStore via Hybris backoffice

For more detailed instructions you can visit the documentation page Please make sure your merchant has Variant true in API and responses section so that you get paymentMethod back in response.

React fronend build

  1. Go to adyencheckoutaddonspa/acceleratoraddon/web/webroot/_ui/responsive/common/js/adyen-checkout
  2. Open terminal and run npm run i
  3. For development build run npm run build
  4. For deployment build run npm run build-prod

Supported payment methods

A reference of all supported payment methods is here.

Credit Cards

Credit Card payments are supported using Checkout Components.

Apple Pay

Apple Pay is supported using Checkout Components.

Ratepay

Ratepay is supported via Adyen API.

AfterPay

AfterPay is supported via Adyen component and API.

Boleto

Boleto is supported via Adyen API.

Pix

Pix is supported via Adyen component and API.

Other alternative payment methods

Supported via Adyen Checkout.

Usage with OCC

The plugin supports the following OCC v2 compatible methods via com.adyen.v6.facades.AdyenCheckoutFacade:

  1. PaymentDetailsListWsDTO getPaymentDetails(String userId) throws IOException, ApiException;
    OCC controller: UsersController.getPaymentInfos
    Endpoint: GET /{userId}/paymentdetails

This method that will return the stored cards associated to the shopping cart user via Adyen API.

  1. PaymentDetailsWsDTO addPaymentDetails(PaymentDetailsWsDTO paymentDetails, DataMapper dataMapper);
    OCC controller: CartsController.addPaymentDetails
    Endpoint: POST /{cartId}/paymentdetails

This method that will receive the payment method selection and rest of payment details and store them in the Cart.

For Credit Card payments - it expects encrypted card holder data obtained from your frontend implementation using Secured Fields

For Stored Cards payments - selected Adyen recurringReference of the card and encrypted cvc

For Boleto payments - social security number

  1. OrderData authorisePayment(CartData cartData) throws Exception;
    OCC controller: OrdersController.placeOrder
    Endpoint: POST /users/{userId}/orders

This method will place the payment request using the previously stored payment method selection data. Upon successful response from Adyen API, it will register payment response in cart/order level.

It returns an instance of OrderWSDTO obtained from OrderData of the placed order. For Boleto, it will contain the pdf url, the base64 encoded data, expiration date and due date.

3DS2 configuration

By default 3DS2 is enabled (Except for OCC). If you want to disable 3DS2 in your system, please set following property in local.properties file, build your environment and restart the server.

is3DS2allowed = false

POS Timeout configuration

POS timeout (time calculated since initiating a payment) is max time to keep terminal connection open. It is set to 130 seconds by default already. If you want to change it, please add following property in local.properties file, build your environment and restart the server. (Change 130 to your desired time, in seconds).

pos.totaltimeout = 130

Credit card holder name configuration

By default Credit card holder name is a mandatory field, You can disable it by setting following property in local.properties file.

isCardHolderNameRequired = false

Pending Order Timeout configuration

By default, an order remains in PAYMENT_PENDING status in order management for 1 hour and it is configured in dynamic order process defintiion file. Based on which extension you are using (fulfillment or ordermanangement) timeout value can be updated in corresponding order-process.xml file.

For example, following 2 files have 60 mins configuration under waitForAdyenPendingPayment process with delay value=PT60M

Fulfillment extension file - resources/adyenv6fulfilmentprocess/process/order-process.xml

OrderManagement extension file - resources/adyenv6ordermanagement/process/order-process.xml

<wait id="waitForAdyenPendingPayment" then="checkPendingOrder">
        <event>AdyenPaymentResult</event>
        <timeout delay="PT60M" then="checkPendingOrder"/>
    </wait>

PayPal configuration

This plugin uses Adyen's Checkout Component for PayPal payments. To use that in a live environment, a PayPal Merchant Id is required. This id has to be provided when adding your Adyen credentials to the BaseStore via the backoffice (installation step 5).

SameSite Cookie Handler configuration

On Google Chrome browser versions 80 or later, it might occur that an account is logged out after trying to place an order using a credit card that requires 3D Secure authentication or using other redirect payment methods. This is a consequence of how newer versions of Chrome browsers handle the SameSite attribute on cookies, invalidating the user session after a redirect to a third-party page happened.

To avoid those issues, for SAP Commerce versions 6.x or 1905, a cookie handler included in this plugin can be used. To enable it, add the following configuration to the config/local.properties file:

adyen.samesitecookie.handler.enabled=true

For SAP Commerce versions 2005 and above, check how to use SAP's SameSite Cookie Attribute Handler.

Amazon Pay configuration

To be able to complete payments in Amazon Pay, you must add your Amazon Pay private key to the following folder /adyen-hybris/adyenv6core/resources/certificates, and once done, set the correct PEM file name on /adyen-hybris/adyenv6core/src/com/adyen/v6/DefaultAdyenAmazonPayIntegratorService.java in the following line:

payConfiguration = new PayConfiguration()
                    .setPublicKeyId(amazonpayPublicKey)
                    .setRegion(Region.valueOf(amazonpayRegion.getCode()))
--->                .setPrivateKey(new String(Files.readAllBytes(ResourceUtils.getFile("classpath:certificates/amazonpay/YourCertificateName.pem").toPath())).toCharArray())

Multiple merchant configuration

Introduces possibility to select merchant for given transaction based on strategy that could be extended. By default merchant account is one in adyenMerchantAccount on BaseStore.

Example

In /examples/adyenmultiplemerchantexample there is extension that introduces necessary changes to achieve selection of merchant account based on shipping address country selected during checkout process.

Documentation

https://github.com/Adyen/adyen-hybris/wiki

Support

If you have a feature request, or spotted a bug or a technical problem, create a GitHub issue. For other questions, contact our support team.

Contributing

We strongly encourage you to join us in contributing to this repository so everyone can benefit from:

  • New features and functionality
  • Resolved bug fixes and issues
  • Any general improvements

Read our contribution guidelines to find out how.

License

MIT license. For more information, see the LICENSE file.

adyen-hybris's People

Contributors

adyen-gc avatar akaflowskireply avatar akoz-adyen avatar aleffio avatar alexandrosmor avatar alexegidioadyen avatar charles-moreel avatar eci99 avatar jluisalias-e2y avatar joaosantosadyen avatar kpieloch avatar lancergr avatar leandromagnabosco avatar lukasz756 avatar maciek-marcinkowski avatar martinsrenato avatar momberg avatar pjaneta avatar rikterbeek avatar rkewlani avatar saquibsayyad avatar scottpowell14 avatar tompalfreyman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adyen-hybris's Issues

AdyenCaptureCommand doesnt work for orders with custom Order Code generator

Describe the bug

The adyen capture command depends on the order code to work, however with custom order code generator this code can be everything basically making all capture transactions to fail.

To Reproduce
Steps to reproduce the behavior:

  1. Configure order code generator (read bellow)
  2. Place an order
  3. Check the AdyenCaptureCommand will not find any order.
  4. See the capture doesnt happen

Expected behavior
The capture to happen :)

Additional context
Happens on ALL hybris versions ( I am aware of this order code functionality since Hybris 4 in 2009.)

In order to read more about this Hybris functionality you can read here https://hybrisarchitect.com/how-to-configure-the-order-number-range-in-sap-hybris-commerce-using-groovy/

99% of the Merchants using hybris have existing website, so they want to at least start not from 1000 but from other big number.
How to do that in short story :

Add this properties to your local.properties :

keygen.order.code.digits=10

keygen.order.code.start=0055000000

keygen.order.code.numeric=true

numberseries.cache.size.order_code=1

This are just an example.

Then start Hybris and reset the orderCodeGenerator. Easiest is to open HAC and execute a groovy script with this line : spring.getBean("orderCodeGenerator").reset();

Then the orders will start from 0055000000 but you can do many things even have a non numeric codes. You can even override and generate whatever you want, so you cannot depend on the CART code.

Long story:

In hybris when a CART becomes an ORDER it doesnt use the card code anymore, but instead it can have ANY code. So you should NOT depend on the cart code in the AdyenCaptureCommand line 67.

Bug is for Plugin version 6.4.0 and tested on Hybris 6.6

No alert shown when no payment method selected

We're not seeing an error when no payment method is selected. It doesn't actually submit the form because the undefined paymentMethod variable causes an exception further down at

I'm not a JS developer but shouldn't this be if (!paymentMethod) instead?
I don't know if this is browser specific i.e. do some browser return an empty string for an unselected radio button and some return undefined? I'm using Vivaldi 3.8.2259.40 UA is Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.95 Safari/537.36

Customer first name and last name not set in order when checkout as guest

Hello Adyen Team.

During payment process for not logged user user first name and last name is not saved in order (username is Guest) however it is provided during checkout process.
This becomes an issue if we want to use it further (send to external system etc.) and is inconsistent with Hybris process.

Regards
Maciek

Payment transaction entry without amount for cancel request

Describe the bug
When a cancel request is processed the payment transaction entry saved for this request is missing the amount and the currency.
In AdyenVoidCommand class, the totalAmount and currency are not set in the VoidResult.

Expected behavior
To have a payment transaction entry with amount and currency for a cancel request

Adyen Report Available Notification Merchant Reference is null

We can successfully get an notification when report available notification is available. But merchantReference field is null
on NotificationItemModel object.That's why we encounter problems during new notification check.

To Reproduce
Steps to reproduce the behavior:
1.Get report available notification
2.Check merchantReference field on NotificationItemModel
3.Run adyenProcessNotificationCronJob
4.check isNewerNotificationExists merhod İf merchantReference is null

**My workaround is set as empty string merchantReference field when running cronjob.

Null pointer thrown due to underlying adyen-java-api-library

I'm in the processing of upgrading our version of this plugin to the latest released (11.2.0) and I've come across this issue when the fraud report is stored to hybris.

Describe the bug
After processing a payment, the plugin is creating FraudReportModel instances using the PaymentsResponse in DefaultAdyenOrderService:createFraudReportFromPaymentsResponse. A null pointer exception is thrown on line 78 because all instances of FraudCheckResult are null.

java.lang.NullPointerException: Cannot invoke "com.adyen.model.FraudCheckResult.getAccountScore()" because "fraudCheckResult" is null at com.adyen.v6.service.DefaultAdyenOrderService.createFraudReportFromPaymentsResponse(DefaultAdyenOrderService.java:78) ~[classes/:?] at com.adyen.v6.service.DefaultAdyenOrderService.storeFraudReportFromPaymentsResponse(DefaultAdyenOrderService.java:121) ~[classes/:?] at com.adyen.v6.service.DefaultAdyenOrderService.lambda$updateOrderFromPaymentsResponse$1(DefaultAdyenOrderService.java:182) ~[classes/:?] at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) ~[spring-tx-5.3.27.jar:5.3.27] at com.adyen.v6.service.DefaultAdyenOrderService.updateOrderFromPaymentsResponse(DefaultAdyenOrderService.java:180) ~[classes/:?] at com.adyen.v6.facades.impl.DefaultAdyenCheckoutFacade.createOrderFromPaymentsResponse(DefaultAdyenCheckoutFacade.java:590) ~[classes/:?] at com.adyen.v6.facades.impl.DefaultAdyenCheckoutFacade.createAuthorizedOrder(DefaultAdyenCheckoutFacade.java:570) ~[classes/:?] at com.adyen.v6.facades.impl.DefaultAdyenCheckoutFacade.componentPayment(DefaultAdyenCheckoutFacade.java:499) ~[classes/:?]

I have traced this back to the fact that the Java modelling (utilising jackson) in the recommended adyen-java-api-library (v18.1.3) doesn't reflect the version of the Adyen API that is being used.

For instance check version 67:
https://docs.adyen.com/api-explorer/Checkout/67/post/payments/details

In the 'results' property of 'fraudResult' there is a 'FraudCheckResult' object.

Screenshot 2023-10-19 at 12 58 50

Then check version 69 which is used in the v18.1.3 adyen-java-api-library:

Screenshot 2023-10-19 at 12 59 14

The 'FraudCheckResult' object is now gone.

The problem is that in the Java the FraudCheckResultContainer class is still expecting this structure, and therefore the data is not loaded in correctly. This results in the above null pointer issue, where the FraudCheckResult objects are all null.

I guess the problem is in the version of adyen-java-api-library that is recommended for use in this plugin. I haven't tried later versions yet, but I suspect it won't be a drop in change without refactoring.

To Reproduce
Steps to reproduce the behavior:

  1. Attempt to complete a card payment with fraud reporting turned on for the account
  2. Exception is thrown storing the fraud report

Expected behavior
No null pointer exception is thrown.

Payment method "Blik" needed

We need to have "BLIK" as a payment method in the Hybris/SAP add-on.

When I requested Adyen support I got the information, the BLIK payment is not supported

For a webshop rollout to Pland in Q2 2023 we need to have "BLIK" as a payment option, as this is the most used payment option in POLAND.

Here: https://docs.adyen.com/plugins/hybris/supported-payment-methods I've seen, that this is currently not supported.
I need a quick answer if this is possible and how long the implementation would take.

Are there other possibilities to integrate it into an SAP web shop beside the currently used Drop-in?
https://docs.adyen.com/online-payments/web-drop-in
https://docs.adyen.com/payment-methods/blik/web-drop-in

Cart duplication in 3D secure redirection

Hybris version: 1905
Plugin version: 6.2.0
Description
When using 3dS cards The lockSessionCart() method creates another empty cart for registered users while locking the cart. this is causing two problems :

  • while the restoreSessionCart() has no operation to remove the additional cart, the card persists in the DB and in the Backoffice.

  • after redirection to the 3dS link and going back using the browser back button, the user found himself losing his cart because it's not restored in this case.

here is the code responsible of creating additional carts :
//Refresh session for registered users if (!getCheckoutCustomerStrategy().isAnonymousCheckout()) { getCartService().getSessionCart(); }

Thanks in advance

Function include on Array, not available for Internet Explorer 11

On Browser IE 11, the javascript instruction include is not available.
On adyen.checkout.js in the module accelatoraddon
I think that it would be necessary to change the function include by an indexOf on the array

['eps','ideal'].includes(paymentMethod) --> ['eps','ideal'].indexOf(paymentMethod) >= 0

AdyenSummaryCheckoutStepController should't use a yacceleratorstorefront class

Currently AdyenSummaryCheckoutStepController is extending de.hybris.platform.yacceleratorstorefront.controllers.pages.checkout.steps.SummaryCheckoutStepController which blocks a possibility to use an addon in case of custom created accelerators (where packages are named differently). It should extend de.hybris.platform.acceleratorstorefrontcommons.controllers.pages.checkout.steps.AbstractCheckoutStepController in order to avoid such a problems

ConfigurationService in DefaultAdyenCheckoutFacade has no getter

Is your feature request related to a problem? Please describe.
I cannot use configurationService from DefaultAdyenCheckoutFacade in my derived class.

Describe the solution you'd like
Could you add getter for ConfigurationService?

Describe alternatives you've considered
No alternatives

Additional context

NullPointerException when the PaymentResult doesn't contain a fraud report

How the error is triggered:

  1. Test card details are entered into the Hybris cart
  2. The user places an order and the method com.adyen.v6.facades.AdyenCheckoutFacade#authoriseCardPayment is called
  3. The payment is successfully authorized and com.adyen.v6.facades.AdyenCheckoutFacade#createAuthorizedOrder is called
  4. Then com.adyen.v6.service.AdyenOrderService#createFraudReportFromPaymentResult returns null because there isn't any fraud report on the payment result.
  5. The method com.adyen.v6.service.AdyenOrderService#storeFraudReportFromPaymentResult expects a non-null result and there is a NPE on line 76.

Test credit card used: 2223 0000 4841 0010 - 08/2018 - 737
Sourcecode: Rev. 3877962

Returned payment Result:
class PaymentResult {
authCode: 74886
paRequest: null
issuerUrl: null
md: null
dccAmount: null
dccSignature: null
pspReference: 8824950126110927
resultCode: Authorised
additionalData: {paymentMethod=mc}
refusalReason: null
fraudResult: null
}

stacktrace.txt

The Card Type is not populated and not send to the server

Describe the bug
The CardType field is not populated properly and not send to the server

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'select payment step'
  2. Fill some credit card details
  3. Open Networking Manager (f12)
  4. Submit
  5. Check the card type value

Expected behavior
The card type to be filled e.g. visa

Hybris Plugin version 6.4.0

Note:
The problem happens because of this method :
getCardType: function () {
return $( '#adyen_combo_card_type' ).val();
},

Which is inside adyen.checkout.js

As you can see it depends on a combo box for the type but the form no longer have combo box.. :) the credit card is an svg shown inside the card number, this combo doesn't exist and returns 'undefined'

The API key column cannot hold an API key.

Hybris version: 6.6.0
Plugin version: 6.4.0
Description
The API key column model definition cannot hold an API key.

Currently the api key column is defined as just String which results to varchar/char/varchar2 of a size of 200, the API key is quite bigger, so in order to use the plugin right now you have to make change in the model or alter the table which is less then ideal.

Going back from 3DS page leads to an empty card in case of GUEST checkout

Describe the bug
When you hit BROWSER back from the 3DS page you land on an empty card if anonymous.

To Reproduce
Steps to reproduce the behavior:

  1. Start order and select card payment with guest/anonymous user.
  2. Enter 3DS (1) card details
  3. Wait to be redirected to the 3DS page.
  4. An empty cart is displayed (the cart is lost)

Expected behavior

The cart to not be lost and to be returned to the summary page so maybe you can select other payment method.

Additional context
This is not related to any browsers or OS.

Plugin version is 6.4.0 , Hybris version we use is 6.6

Apple pay amount mismatch.

Hybris version:6.5.0
Plugin version: 6.1.0
MerchantAccount: LornaJaneUAT
Description
We are trying to integrate applepay. We have followed all the steps mentioned given in the following documentation:
https://docs.adyen.com/payment-methods/apple-pay/web-component

We are successfully able to retrieve the apple pay token and use it to make a call to /payments endpoint. But we get API exception. On further inquiring with Adyen support they told us they can see the following error in their logs whee it says the following :
Amount mismatch, received AUD 129.54 expected USD 129.54
We were told that the currency being different may be the issue. Later on we were told that currency can be different.
But i can assure you we are passing currency as AUD. In line with the adyen documentation we pass the amount and currency only in the following scenarios:

  1. When we have to create the apple checkout component in the js.
  2. When we have to make a call to /payments after we pass it the token.

The only call that we make to apple from our servers is to get the apple session.

I am attaching a sample request.

This is the final hurdle we are facing in integrating applepay. Any help would be much appreciated.
P.S: Please don't get confused with the amount in the request we are passing 6599 as the amount.
Thanks,
Saurabh
Request (1).txt
image

Notifications are not filtered by PSP reference in NotificationItemRepository#isNewerNotificationExists

When a failed payment is immediately followed by a successful payment (maybe because the customer has input a wrong CVC the first time) we receive 3 notifications in SAP Commerce from Adyen: two are notifications for the declined payment and one is for the successful one.
However, the notifications are ordered by event date, and it can be seen in the attached screenshot that the successful notification is in between the two failed ones.
The screenshot shows the result of the query:
select * from {NotificationItem} where {merchantReference}='A21587156'

Screenshot 2022-10-11 at 14 56 45

When the cron job AdyenProcessNotificationCronJob processes the notifications, it checks if a newer notification exists, and in that case it skips the older ones, but, and here’s the problem, the notifications are filtered only by merchantReference and merchantAccountCode which means the 3rd failed notification is seen as a newer one, even if the PSP reference is different, and the successful notification, being older, is skipped. This logic is in NotificationItemRepository#isNewerNotificationExists.

I think the query in NotificationItemRepository#isNewerNotificationExists should take into account also the PSP reference of the notification when determining if a newer version exists.

It wouldn't be a problem if we only received 1 notification for the failed payment followed by 1 notification for the successful payment, but we do get a second notification for the failed payment.

Payment method "MobilePay" needed

We need to have "MobilePay" as a payment method in the hybris/SAP add on.

For a web shop rollout to Denmark in Q1 2023 we need to have "MobilePay" as a payment option, as this is the most used pay option in Denmark.

Here: https://docs.adyen.com/plugins/hybris/supported-payment-methods I've seen, that this is currently not supported.
I need a quick answer if this is possible and how long the implementation would take.

Are there other possibilities to integrate it into a SAP web shop beside the currently used add on?

Thanks, Mathias

Upgrade to the latest JS/JavaAPI and Rest API endpoints

Is your feature request related to a problem? Please describe.
Many functionalities and new payment methods are MISSING like Co-branded cards, PayPal Express and so on.

Describe the solution you'd like
To keep the adyen hybris plugin up2date with every release of adyen APIs and changes so third parties can have a secure, updated solution

Describe alternatives you've considered
Currently the only alternative is to not use the adyen-hybris plugin if we want to use the newest apis, the upgrade from older versions to the newer ones is impossible without rewriting huge chunks of the code.

Additional context
The Adyen Hybris extension is quite old. This release is from 24 Feb 2022

It is using some very old Java libraries and JS libraries and API levels from Adyen

adyen-java-api-library (v14.0.0)

adyen-web (v4.3.1)

Adyen Checkout API (v67)
The latest as of now are :

adyen-java-api-library 18.1.13

adyen web version v5.28.1

Checkout API v69

We are currently waiting for PayPal Express with delivery options with different prices which will be released in Q1 2023 I have been told with the current speed of adyen hybris upgrades if this is indeed released in the JS/API level in Q1 2023 maybe this plugin will catch up with it in 2025.. which is less then ideal.

AdyenCaptureCommand equals

On class AdyenCaptureCommand:96 in extension adyenv6core modification result is a string and is being compared with "==" instead of .equals...

Not working.

Integration with SAP to automate Adyen batch payment versus individual e-com invoices reconciliation

From Adyen we receive a weekly batch payment for all our e-commerce sales of the week. We have to download the settlement detail report to understand which invoices (e-com invoices to our end customers) in our ERP system have to be closed whit this and then manually close them one by one. Because of the high volumes this is a time consuming and error prone activity.

The solution is an integration between Adyen and SAP so that the settlement information is transferred (automatically) to the ERP system and invoices can be closed automatically consequently.

Integration between SAP and Adyen is already existing (https://www.adyen.com/nl_NL/partners/sap-cx). Adding this integration described above would mean a huge improvement for all companies using Adyen in combination with SAP.

Use Flexsearch API instead of hard-coded LIMIT SQL

This line:

+ " WHERE {" + NotificationItemModel.PROCESSEDAT + "} IS NULL ORDER BY {pk} ASC LIMIT 1000"

causes issues because the Flexible search API is not being used, but rather a hardcoded limit sql instruction:

de.hybris.platform.servicelayer.search.exceptions.FlexibleSearchException: SQL search error - ORA-00933: SQL command not properly ended
 query = 'SELECT  item_t0.PK  FROM adyennotificationitem item_t0 WHERE ( item_t0.p_processedat  IS NULL) AND (item_t0.TypePkString=? ) order by  item_t0.PK  ASC LIMIT 1000', values = [8796130672722]
	at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService$2.execute(DefaultFlexibleSearchService.java:416)
	at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService$2.execute(DefaultFlexibleSearchService.java:1)
	at de.hybris.platform.servicelayer.session.impl.DefaultSessionService.executeInLocalView(DefaultSessionService.java:89)
	at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.getJaloResult(DefaultFlexibleSearchService.java:395)
	at de.hybris.platform.servicelayer.search.impl.DefaultFlexibleSearchService.search(DefaultFlexibleSearchService.java:167)
	at com.adyen.v6.repository.NotificationItemRepository.getNonProcessedNotifications(NotificationItemRepository.java:46)
	at com.adyen.v6.cronjob.AdyenProcessNotificationCronJob.perform(AdyenProcessNotificationCronJob.java:50)
	at de.hybris.platform.servicelayer.internal.jalo.ServicelayerJob.performCronJob(ServicelayerJob.java:38)
	at de.hybris.platform.cronjob.jalo.Job.execute(Job.java:1358)
	at de.hybris.platform.cronjob.jalo.Job.performImpl(Job.java:814)
	at de.hybris.platform.cronjob.jalo.Job.access$1(Job.java:767)
	at de.hybris.platform.cronjob.jalo.Job$JobRunable.run(Job.java:686)
	at de.hybris.platform.util.threadpool.PoolableThread.run(PoolableThread.java:195)

IE 11 - problems with Arrow function

Describe the bug
In IE 11
image

a syntax error occurs in the adyen.checkout.js line: 319 column: 46.

onChange: (state, component) => { if (!state.isValid) { this.enablePlaceOrder(label); } }

The checkout can not be finished.

Used plugin version: 9.0

To Reproduce
Steps to reproduce the behavior:

  1. Use an IE 11 browser in SAP Commerce
  2. At least go through the checkout
  3. Check in DEV tools (F12) and see the syntax error

Expected behavior
Checkout gets finished

Desktop (please complete the following information):

  • Browser IE 11

createOrderFromPaymentsResponse throws nullPointer when nu additionalData in PaymentsResponse

Hybris version: 18.11
Plugin version: 6.2.0
When a payment for eg Visa is done and the result is authorized the DefaultAdyenCheckoutFacade.createOrderFromPaymentsResponse will create an order from the paymentsResponse. However it will set the PosReceipt (even if not Pos payment) based of the PaymentsResponse.additionalData.
In my response this is null, causing a nullPointerException. Shouldn't this check for Null?

Example of response I got
class PaymentsResponse { additionalData: null details: null fraudResult: null paymentData: null pspReference: 883572010021095C redirect: null refusalReason: null refusalReasonCode: null resultCode: Authorised serviceError: null authResponse: null merchantReference: 000000112013 outputDetails: null authentication: null threeDS2Result: null action: null }

HPP in version 6.2.1

Hybris version: 1811
Plugin version: 6.2.1
Description
Can we still use HPP? Cause I don't see it anywhere in the code except for PayPal?

Parameter redirect_result does not exists for illicado_prosody payment

Adyen response with a prosodie_illicado payment
is not "redirect_result" but "payload".
I modified the code to make it work.

Here is my modification.

private static final String PAYLOAD = "payload";
` public String handleAdyenResponse(final HttpServletRequest request, final RedirectAttributes redirectModel) {
final String redirectResult = request.getParameter(REDIRECT_RESULT);
final HashMap<String, String> details = new HashMap<>();

    if (redirectResult != null && !redirectResult.isEmpty()) {
        details.put(REDIRECT_RESULT, redirectResult);
    } else {
        **details.put(REDIRECT_RESULT, request.getParameter(PAYLOAD));**
    }`

Can you take this modification into account in a future release?

Thanks.

Checkout issue in Hybris 1811 (on-prem)

Hybris version: 1811 (on-prem)
Plugin version: 4.2.0
Description

I am currently performing testing of Adyen plugin in my local Hybris instance, but I have below issues:

  1. No further payment details prompt during checkout
    image

  2. URL Invalid during server communication setup
    image
    URL entered: https://electronics.local:9002/yacceleratorstorefront/electronics/en/adyen/v6/notification/json

  3. Is it correct by entering below domain for generating origin key?
    https://electronics.local:9002/

Overall, does the Adyen plugin work for Hybrs 1811 on-prem?
Kindly advise.

Thank you!

Going back from 3DS2 page leads to an CONFIRM form resubmission

Describe the bug
The bug is related to #183 but for 3DS2. Please resolve this ones #183 is done otherwise you will hit #183

User should be able to go back from the 3DS2 or 3DS page and select different payment method. Ones the #183 is fixed for 3DS then we have a new issue for 3DS2 related to the fact that the adyen plugin is doing POST.

To Reproduce
Steps to reproduce the behavior:

  1. Start checkout with GUEST user and select a Card Payment
  2. Fill the details with a 3DS2 card
  3. Make browser back
  4. See the screenshot.

Expected behavior
To see the previous page displayed normally with an option to select a different payment method or card details.

Screenshots
Screen Shot 2020-06-01 at 11 10 58

Additional context
The bug is not related to browser or OS. Plugin version 6.4.0 Hybris 6.6

P.S. the bug happens because you are doing POST before the redirect to the 3DS2 page. So when the user hits BACK he is on the POST request.

Null Pointer Exception in AdyenRequestFactory

Describe the bug
When the ConfigurationService is injected in AdyenRequestFactory, it gets injected as null, hence, a NPE is raised.

To Reproduce
Steps to reproduce the behavior:

  1. Pick adyenv6core and import into the workspace
  2. Build and start
  3. When the flow is engaged, a NPE is raised

Expected behavior
ConfigurationService shouldn't be injected as null.

Screenshots

INFO   | jvm 1    | main    | 2021/01/04 13:29:30.989 | java.lang.NullPointerException: null
INFO   | jvm 1    | main    | 2021/01/04 13:29:30.990 |    at com.adyen.v6.factory.AdyenRequestFactory.getPlatformVersion(AdyenRequestFactory.java:949) ~[classes/:?]
INFO   | jvm 1    | main    | 2021/01/04 13:29:30.990 |    at com.adyen.v6.factory.AdyenRequestFactory.updateApplicationInfoPos(AdyenRequestFactory.java:310) ~[classes/:?]
INFO   | jvm 1    | main    | 2021/01/04 13:29:30.990 |    at com.adyen.v6.factory.AdyenRequestFactory.updateApplicationInfoEcom(AdyenRequestFactory.java:295) ~[classes/:?]
INFO   | jvm 1    | main    | 2021/01/04 13:29:30.991 |    at com.adyen.v6.factory.AdyenRequestFactory.createCancelOrRefundRequest(AdyenRequestFactory.java:492) ~[classes/:?]
INFO   | jvm 1    | main    | 2021/01/04 13:29:30.991 |    at com.adyen.v6.service.DefaultAdyenPaymentService.cancelOrRefund(DefaultAdyenPaymentService.java:269) ~[classes/:?]

Additional context
It's not really clear why it get injected as null, since in adyen-spring.xml the property is correctly injected:

<bean id="adyenRequestFactory" class="com.adyen.v6.factory.AdyenRequestFactory">
    <property name="configurationService" ref="configurationService" />
</bean>

It seems that

public void setConfigurationService(ConfigurationService configurationService) {
    this.configurationService = configurationService;
}

is never called.

Altough we do have a solution for the same (actually multiple), I would like to raise (ad as suggested by your support, with ticket #1797512) it even here

3DS2 test page SameSite cookies. (Causes logout)

In the last two days i've been facing a random bug, at the end of the Adyen Checkout, and after going to the challenge site (for 3dS2) and performing the challenge and then returning to hybris, my website performs a random logout before reaching the /3ds2-adyen-response. i was able to reproduce the bug on chrome :
1 - Version 80.0.3987.0 (Developer Build) (64-bit) [default settings]
2 - Version 82.0.4084.0 (Official Build) canary (64-bit) [default settings]
3 - Version 80.0.3987.132 (Official Build) (64-bit) [enable #same-site-by-default-cookies flage and #enable-removing-all-third-party-cookies and #cookies-without-same-site-must-be-secure flags]

After searching on the web I found out that chrome is launching a major update on SameSite cookies, sameSite Update

the new update reached already some versions of Chrome and coming to the rest in the next days, firefox also will do the same thing.

Chrome is providing some debug tools for the new configurations, details here : Tips for testing and debugging SameSite-by-default and “SameSite=None; Secure” cookies

here is a screen of the debug website on my chrome (3 - Version 80.0.3987.132 (Official Build) (64-bit) with flags enabled !!) and it's the same for 1 and 2:
image
As you can see if the Set-Cookie doesn't have a SameSite Configuration it will be excluded by default in a cross-site context!

The Chrome without those flags enabled (where the bug is not reproductive) looks like this :
image

And while Hybris connexion with 3ds2 website is based on cookies it's mostly because of some kind of missing cookies config that lead to this bug.

As you can see in the below example when going back to the returnUrl the JSessionId cookie gets filtred, which is causing hybris to create a new JSessionId and lose the current session.
image

we have already excluded the adyen urls from the crsf checklist as it's mentioned in the documentation, but we don't know how to fix this !

Note : here is the card info for all of the tests
Mastercard | 5454 5454 5454 5454 | 03/2030 | 737

Thanks in advance

Use official adyen-java-api-library

Hybris version: 6.1.0.3
Description
adyen-hybris (tag 3.3.0) contains a patched version of adyen-java-api-library-1.3.0.jar in extension location adyenv6core/lib/adyen-java-api-library-1.3.0.jar (2018-01-31)

Maven Central library at https://repo.maven.apache.org/maven2/com/adyen/adyen-java-api-library/1.3.0/adyen-java-api-library-1.3.0.jar (2017-12-22)
doesn't contain e.g.

  • PaymentRequest.setEncryptedCardNumber(...)
  • PaymentRequest.setCardHolder(...)
  • PaymentRequest.setEncryptedExpiryMonth(...)
  • PaymentRequest.setEncryptedExpiryYear(...)
  • PaymentRequest.setEncryptedSecurityCode(...)

Please release a new version of adyen-java-api-library-1.3.0.jar in Maven central that contains latest changes (v1.3.1 ?)

Thanks in advance!

AdyenRequestFactory is not considering rounding issues on setOpenInvoiceData

Describe the bug
com.adyen.v6.factory.AdyenRequestFactory#setOpenInvoiceData(com.adyen.model.checkout.PaymentsRequest, de.hybris.platform.commercefacades.order.data.CartData)

com.adyen.v6.factory.AdyenRequestFactory#setOpenInvoiceData(com.adyen.model.PaymentRequest, de.hybris.platform.commercefacades.order.data.CartData, de.hybris.platform.core.model.user.CustomerModel)

both call

// Use totalPrice because the basePrice does include tax as well if you have configured this to be calculated in the price
BigDecimal pricePerItem = entry.getTotalPrice().getValue().divide(new BigDecimal(entry.getQuantity()));

without a scale, which leads to

java.lang.ArithmeticException: Non-terminating decimal expansion; no exact representable decimal result.

In cases you have a promotion which gives you a value that needs rounding after division

To Reproduce
Steps to reproduce the behavior:

  1. have a entry with a qty of 3 and an order entry total of 100
  2. try to authorize klarna invoice payment

Expected behavior
Use a scale to avoid rounding issues

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Registering Facade inside AddOn

Describe the bug
Found in version 6.4 In adyenv6b2ccheckoutaddon-spring.xml you are registering / overriding a facade.

<alias name="adyenCheckoutFlowFacade" alias="checkoutFlowFacade"/>
<bean id="adyenCheckoutFlowFacade" class="com.adyen.v6.acceleratorfacades.flow.impl.AdyenCheckoutFlowFacade" parent="defaultCheckoutFlowFacade" />

Since addons are installed on TOP of the storefront accelerator this overrides any client checkoutFlowFacades with yours basically breaking any client flow facade in existence. You should never REGISTER a facades as part of an addon, this is extremely bad from a quality perspective and extremely hard to find.

Expected behavior
To not override client extension facades or storefront facades

Additional context

In Hybris there are 2 facades CheckoutFacade and CheckoutFlowFacade both are overwritten in 99% of the projects, by introducing this in an addon you basically override one of them in an extremely hidden way basically replacing delivery modes and delivery address. It is even worse because in your addon you are overriding getCheckoutCart and calling getCartFacade().getSessionCart() however even this cartFacade is not the client one, you not only break the flow facade but also not use the client override facade to take the session cart instead you are using the default one.

DisableResult evaluation doesn't fit to /disable API

Hi,

we currently use com.adyen.v6.service.DefaultAdyenPaymentService#disableStoredCard from adyenv6core (3.3.0).
Executing disableStoredCard(..) always returns false because there are no details within response.

E.g. {"response":"[detail-successfully-disabled]"} is returned as documented at https://docs.adyen.com/developers/features/recurring-payments/disable-stored-details#response i.e. the evaluation of disable result doesn't fit to /disable API.

Possible solution: DisableResult should check for presence of [detail-successfully-disabled] or [all-details-successfully-disabled] at

return (result.getDetails() != null && ! result.getDetails().isEmpty());

I hope I understand the API correctly.

current base site returns null

Hi,

getCurrentBaseSite() method in hybris service BaseSiteService returns null, it's found in AdyenNotificationAuthenticationProvider line 65 in adyenv6notification extension..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.