mollie / spree-mollie-gateway

Mollie payments for Spree Commerce.
https://www.mollie.com
16 stars 23 forks source link

Store Spree::LineItem ID within Mollie order line metadata field #55

Open vernondegoede opened 5 years ago

vernondegoede commented 5 years ago

This will allow us to remove this workaround: https://github.com/mollie/spree-mollie-gateway/blob/master/app/models/spree/mollie/order_serializer.rb#L196 and store it within the line's metadata.

More information: https://docs.mollie.com/changelog/v2/changelog#monday-14th

vernondegoede commented 5 years ago

Please make sure this change is backward compatible. When no metadata is present on the order line, fall back to the current implementation ("#{line.id}-#{line.variant.sku}").

Oldharlem commented 5 years ago

Please note that the refunds depend on the #{line.id}-#{line.variant.sku} structure. Need to abstract the line_item mollie identifier in its own method to ensure implementation wide support for the chosen identifier

vernondegoede commented 5 years ago

Agreed. Would be good to reuse this logic.

Oldharlem commented 5 years ago

Fixed by #78