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
Issue fork commerce_affirm-3529382
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
Comment #3
vmarchukComment #6
rszrama commentedThe 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.