Okay
  Public Ticket #2785693
Payment Receipts
Closed

Comments

  •  10
    Brad started the conversation

    Hello,

    I need some help with issuing receipts to customers once they've paid, it seems like it should be an important part of a booking system? At the moment I'm using Stripe checkout and I know it won't automatically send receipts upon payment, the issue I've run into is this ;


          "receipt_email": null,


    I've seen in a previous ticket a possible solution which I've added to Stripeservice.php although it hasn't worked


    if (isset($data['metaData']['email'])) {    $stripeData['receipt_email'] = $data['metaData']['email'];
    }


    I just need to be able to send receipts, is there either a way to get Stripe to handle this correctly (sending manually really isn't an option) or maybe a way to add an extra email trigger to Amelia itself so I can just create an email using the payment shortcodes?

    Thanks

  •  10
    Brad replied

    Update : I think I've resolved the issue. I updated the database amelia_settings so meta data is being sent to Stripe, then used the snippet from my previous comment to feed the user email through to the receipt email in Stripe. I'm only working in test mode currently but previously I was getting a message saying 'no email address for this payment, no receipt sent' where as now I'm getting just 'no receipt sent'. Stripe doesn't send receipts in test mode but because it's no longer displaying 'no email' I believe this has fixed it. 

    I thought that might be useful for anyone else that has the same issue

  • [deleted] replied

    Hi Brad,

    thank you so much for reaching out to us - and for sharing this workaround!smile.png

    Amelia currently does not have receipt option, however, the data that is sent to Stripe should suffice for any kind of outgoing information Stripe further provides, as this setting unfortunately isn't part of Amelia (receipts), but metadata can be sent.

    Thank you again for the advice for our other clients!

  •  8
    Christian replied

    Hey Brad,

    I'm having the same issue. Where do you find the Amelia_settings database, and what exactly do you modify in there?


    Thanks,

    Christian


  •  10
    Brad replied

    Hey Christian,

    You'll need to access the database through your cPanel and initially you are looking for wp_options (your prefix might not be wp_ depending on your setup but it'll always end in _options). Once you found that go in to that and then search for Amelia_settings and this is what you'll need to edit.

    Once you are in to Amelia_settings you'll need to find the lines for 'Stripe' which will look like this 

    3739662011.png

    Where it says description enabled :false and meta description enabled :false you will need to change both to true. Once you've done that you then need to edit the meta description to provide the right information to Stripe. See the screenshot below from my instance to see exactly what I changed, you can just find the same part in your database and update it to what I have below.

    2545836486.png


    Quick word of warning, it did take me a few attempts to get this right, the instances that it wasn't 100% right it reset all of the plugins formatting and integrations so before doing this I would recommend creating a backup of your site that you can restore should you need to. Once this is done, you'll then need to add the line of code from my first post to the Stripeservice.php file

    Good luck!

    Brad

  • [deleted] replied

    Hi Brad,

    thank you so much for sharing that!smile.png

  •  14
    Mark Stubbins replied

    Hi Brad,

    You have done some amazing work here! Amelia is wonderful and made a huge difference in our business, but our only complaint has been the lack of receipt sent out through Stripe.

    I hesitate to try this on our site since it is in production, booking classes, and accepting payments but I am going to set up a test site and try it out there first. I've always thought about hacking this myself, but you just saved me a bunch of time.

    Thank you very much for sharing this info!

    Mark

  •  8
    Christian replied

    Thank you, Brad! Your method worked. Also, as an alternative, you can add the code below to Stripeservice.php. Then provide the metadata (name: email / value: %customer_email%) in the Amelia plugin. They both worked for me. 

    if (isset($data['metaData']['email'])) {    $stripeData['receipt_email'] = $data['metaData']['email'];
    }
    
  •  14
    Mark Stubbins replied

    Hi Christian,

    Would you mind sharing how you provide the metadata (name: email / value: %customer_email%) in the Amelia plugin?

    Thank you!

  •  8
    Christian replied

    Hey Mark,

    See attachment.

    CA

  •  10
    Brad replied

    No problem glad to help. Christian I think your method of adding the metadata is actually much easier so thanks for sharing that also!

  •  14
    Mark Stubbins replied

    OMG, how did I overlook that? Excellent! Thank you very much Christian! This is a much cleaner/safer approach and should be part of the Amelia knowledgebase... but then I think it is now! 

    Thank you to Brad for bringing this up and making it work, and thanks to Christian for refining the approach! Excellent!

  •  14
    Mark Stubbins replied

    Ok, I bet it's staring me right in the face but where is: Stripeservice.php ?

  •  14
    Mark Stubbins replied

    Ok found it referenced in this ticket:

    https://tmsplugins.ticksy.com//ticket/2679509/


  •  14
    Mark Stubbins replied

    Is this actually working for you guys? Have you tested an actual transaction?

    I am getting the metadata and description passed into Stripe which is very nice. I've been needing this for a long time. But I am not getting a receipt email sent from Stripe. In Stripe under Receipt History it says:

    No receipts sent
    No email address for this payment

  •  10
    Brad replied

    Hey Mark,

    Stripe doesn't send receipts whilst in test mode but if you are seeing that message 'no email address for this payment' that means that Stripe isn't picking up the email address for some reason. 

    If you've added the snippet from my first post to Stripeservice.php correctly please make sure that you are specifying 'email' in the 'Metadata' section of amelia_options and NOT 'Description' if you are doing it the way I suggested. If you're doing it the way Christian provided try adding the email into the description box at the bottom instead of how we has it in one of the top boxes.

    Once you've done this try a test transaction and if it's setup correctly, the receipt area in Stripe will actually be blank instead of showing 'no email address' , and yes it's working for me

  •  8
    Christian replied

    Hey Mark,

    Yes, it's been working flawlessly. Send us pictures of Stripeservice.php and metadata.

  •  14
    Mark Stubbins replied

    Ok, found a stupid typo within 2 seconds of looking at it this morning. Made the correction, tested it, and moved the changes to our live site. All of the metadata was loaded into Stripe and a receipt was sent by them to our first customer this morning! First time in nearly 2 years!

    On the one hand, we are doing a happy dance this morning, on the other hand, I am really scratching my head trying to figure out why support has not offered this solution a long time ago. This is HUGE!

    Thank you very much guys!

  •  10
    Brad replied

    Awesome glad you got it sorted Mark.

    Yeah the guys have done a great job with this plugin and they know far more than me so there may well be a good reason for it, but I would think shipping the plugin with these settings as default would make far more sense. Then people can just turn receipts off within Stripe if they don't want them being sent but yeah I'm not really an expert.

    Anyway glad you guys are sorted, all the best!

    Brad

  •  14
    Mark Stubbins replied

    Brad and Christian,

    You guys have been super helpful and don't seem to have a problem getting your hands dirty with code and configuration. I've got one lingering/nagging issue that I'm wondering if you have any experience with and if you would not mind taking a look?

    https://tmsplugins.ticksy.com/ticket/2789248

    Thank you!

  •  14
    Mark Stubbins replied

    Actually I have 2 support tickets that I have made public, here is another:

    https://tmsplugins.ticksy.com/ticket/2789305

    If you have any feedback guys I would appreciate it!