We need to pass the order number instead of the order ID during the authorization request. The only problem here is that the order number has not yet been generated because the order has not yet been placed.
It seems the only solution is to generate it in advance, like we do here

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

vmarchuk created an issue. See original summary.

vmarchuk’s picture

Title: Pass the order number instead of the order ID during the authorization request » After placing an order, update Affirm payment to use the order number instead of the order ID
Assigned: vmarchuk » Unassigned
Status: Active » Needs review

rszrama made their first commit to this issue’s fork.

  • rszrama committed 421a3af8 on 2.x authored by vmarchuk
    Issue #3529382: After placing an order, update Affirm payment to use the...
rszrama’s picture

Status: Needs review » Fixed

The MR works for me; basically, instead of generating the order number early, this approach just updates the Affirm payment after the fact to use the order number for the Affirm Order ID. I'm going to create a follow-up issue to make this behavior optional as in other modules, so a site that diesn't use order numbers in the default way can retain the numeric order ID.

Status: Fixed » Closed (fixed)

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