-
Notifications
You must be signed in to change notification settings - Fork 1
Add support for prefix productName for paypal item #166
Conversation
Need to add the new property of |
@lojzatran Can you provide me the encrypted application.yml that is being used for travisCI builds? I need to add the new property that I introduced into it. 😁 |
Do you mean this file? https://github.com/commercetools/commercetools-paypal-plus-integration/blob/master/travis-build/configuration/travis-build-settings.sh.enc |
@@ -240,27 +255,22 @@ protected Details getTransactionDetails(@Nonnull CtpPaymentWithCart paymentWithC | |||
protected Stream<Item> mapCustomLineItemToPaypalPlusItem(@Nonnull CustomLineItem customLineItem, @Nonnull List<Locale> locales) { | |||
if (customLineItem.getDiscountedPricePerQuantity().size() > 0) { | |||
return customLineItem.getDiscountedPricePerQuantity().stream() | |||
.map(dlipfq -> createPaypalPlusItem(customLineItem.getName(), locales, dlipfq)); | |||
.map(dlipfq -> createPaypalPlusItem(customLineItem.getName().get(locales), dlipfq)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you pass here not a concrete locale but a list of locales which locale will it take? Also, why do you pass a list here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was the previous implementation to use a List<Locale>
. In this case, the first matching locale will be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it match exactly or it just takes the first available locale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
locales the locale which should be searched, the first exact match wins
This is from LocalizedString implementation. https://github.com/commercetools/commercetools-jvm-sdk/blob/cfa043b25ebec1656311643ca4201ec81a172fe2/commercetools-sdk-base/src/main/java/io/sphere/sdk/models/LocalizedString.java#L197
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should take by default always a language defined as languageCode
custom field on the payment (it is a required field for the integration: https://github.com/commercetools/commercetools-paypal-plus-integration) and only fall back to current behaviour if no values for languageCode
found or languageCode
is not defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/main/java/com/commercetools/helper/mapper/impl/payment/ProductNameMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/commercetools/helper/mapper/impl/payment/ProductNameMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/commercetools/helper/mapper/impl/payment/BasePaymentMapperImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/com/commercetools/helper/mapper/impl/payment/BasePaymentMapperImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/com/commercetools/helper/mapper/impl/payment/BasePaymentMapperImpl.java
Outdated
Show resolved
Hide resolved
src/main/java/com/commercetools/helper/mapper/impl/payment/ProductNameMapper.java
Outdated
Show resolved
Hide resolved
src/main/java/com/commercetools/helper/mapper/impl/payment/ProductNameMapper.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after a quick review, looks OK to me, please double-check the missing things.
Description
New support for prefix the product name in paypal is supported. This can be enabled/disabled from a new attribute introduced in application.yml