Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orders are not getting aknowledged #70

Open
eddiedale opened this issue Nov 26, 2021 · 3 comments
Open

Orders are not getting aknowledged #70

eddiedale opened this issue Nov 26, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@eddiedale
Copy link

Currently solving this in a custom module as follows:

use craft\commerce\Plugin as Commerce;

Event::on(Order::class, Order::EVENT_AFTER_COMPLETE_ORDER, function (Event $e) {

  $order = $e->sender;

  $hash = Craft::$app->request->getQueryParam('hash');
  
  $plugin = Commerce::getInstance();
  $last_transaction = $plugin->getTransactions()->getTransactionByHash($hash);
  
  $gateway = $plugin->getGateways()->getGatewayById($last_transaction->gatewayId);
  $klarna_order_id = $last_transaction->reference;
  
  // Acknowledge the order
  $acknowledgement = new Acknowledge($gateway, $klarna_order_id);

}
@jellingsen jellingsen self-assigned this Nov 29, 2021
@jellingsen jellingsen added the bug Something isn't working label Nov 29, 2021
@jellingsen
Copy link
Contributor

Is this with the gateway in "purchase" mode?

Seems like we're only sending the Acknowledge request on gateways in "authorize" mode.

@aelvan
Copy link

aelvan commented Nov 30, 2021

@eddiedale Think maybe I'm seeing the same thing, how does this manifest for you in commerce/klarna?

The issue I'm having is that occasionally (five orders over the last 14 days) I'm getting an order in commerce that is completed, but in the list of transactions I only have the "Authorize - pending" entry, not the "Authorize - success" one. So the order can't be captured, but the customer has gotten a confirmation about the order being completed. Does it sound like the same issue?

@eddiedale
Copy link
Author

@aelvan No, I think that is a different issue. At least I do not have problems with any orders/authorizations pending.

@jellingsen Yes, the gateway is in "purchase" mode, and indeed the acknowledgment works as it should if I change it to "Only authorize", and manually capture thereafter. I do want to keep it in purchase mode though, so it would be great with an update solving that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants