DEV Community

Rafael Corrêa Gomes
Rafael Corrêa Gomes

Posted on • Originally published at blog.rafaelcg.com on

Why my Magento 2 is not generating Gifcard's code?

Analyzing some orders workflow to a client we saw that in some orders the gift card code wasn’t generated. Inside the order’s details, it was showing as below.

Gift Card Accounts: N/A

Analyzing the situation it was caused because of one specific payment method, it was set as Authorize only and not Authorize & Capture, the gif card code is generated only when the invoice is created.

So if you did a test order and didn’t have the gift card code, try to invoice it, you will receive a new email with the code.

To check all the Giftcard codes generated you can go to the admin panel in Marketing > Promotions > Gift Card Account.

If you can you might able to fix it by changing the payment method to Authorize & Capture or restricting the payment methods allowed to buy the gift cards.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay