Refunding a gift certificate: way to find and invalidate code?

When generating a gift certificate code, is there any way to pass an argument to associate a piece of data (like an email) with a code that is generated? Or is there a better way to handle the following scenario?

  1. Site visitor (not member) purchases a gift certificate without creating an account (set up this way on purpose), and receives the link. Gives it to friend for a present.
  2. Friend does not need a gift certificate because they’re already a member.
  3. Original visitor asks for a refund, which we give them.

There’s no user to delete, because the purchaser didn’t make an account. I would love to invalidate the gift certificate code, though. The wp_options info for the gift certificate codes doesn’t include any information about the purchase, so I can’t tell which code is in question here.

I think I’m stuck in this situation, but for the future:
Is there a way that I can tag the wp_options entries upon generation, so that later I could find a particular gift code and determine its status (to see if we can grant a refund, and then to invalidate it if we do grant a refund). I’m wondering if there’s any flexibility built into those arguments to s2member_pro_redemption_code_generate() that I could take advantage of. I searched the GitHub repo to better understand the generation, but am not coming up with anything.

Thanks very much!
Val

Hi Valerie.

That is not available at the moment…

In the file sc-gif-codes-in.inc.php you can find the code generation. They get stored in usermeta, so you can search for the user’s ID and the meta key that starts with “s2m_gcs_”

You are one of the very few that use the git certificates, and this is the first request I get for that feature. But it makes sense, sounds interesting. I added it to the feature requests with your vote for it.

:slight_smile: