Problem/Motivation

Unfortunately seems like despite all efforts made by Vipps to ensure conversion from Vipps App back to the website in order to finalise the order, some orders are stuck locked in draft state and never properly placed. Following issue was created to address this scenario - #3082993: Automatically place orders authorised on order balance

Proposed resolution

Move syncing logic from onReturn to commerce_order.place.pre_transition so the data is always synced when order is being placed, despite if it's happening via onReturn or in a programmatic manner.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zaporylie created an issue. See original summary.

zaporylie’s picture

Status: Active » Needs review
FileSize
9.93 KB

Feedback most welcome.

eiriksm’s picture

Status: Needs review » Reviewed & tested by the community

Tested and works like designed!

The patch has some coding standard issues, but so do the rest of the module, so let's not get caught up in that :)

eiriksm’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
10.03 KB
850 bytes

Our tests uncovered a bug in this, namely that you can cause an EntityStorageException if you try to query for remote id without it being set.

Updated patch attached.

zaporylie’s picture

#4 is definitely valid. I updated the patch - only orders paid with vipps_express payment gateway can be subject of further processing.

eiriksm’s picture

Status: Needs review » Reviewed & tested by the community

Tested (in production as well) and works great.

eiriksm’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
905 bytes
10.54 KB

Came across another issue. If the order in question does not have a payment, we will end up calling getPlugin on NULL, which is totally not cool.

zaporylie’s picture

Status: Needs review » Reviewed & tested by the community

Good catch! I'd like to merge in #7 and we can take all uncovered bugs in the follow up issues. Do you agree?

eiriksm’s picture

Agreed. We have been using this in production for a while already ;)

  • eiriksm authored ccebdcc on 8.x-4.x
    Issue #3082997 by eiriksm, zaporylie: Move Vipps Express to Order sync...
zaporylie’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +Amsterdam2019

Committed and pushed to 8.x-4.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.