Jump to content

Stripe - eMail Customers


Claudia M

Recommended Posts

I have been using the Stripe gateway and have a question.  I do NOT want Stripe to send my customers ANY emails at all.  I thought I had this set correctly on the dashboard but apparently not as a customer got an email receipt from them and was confused as they rightfully thought they made payment thru my store. Their documentation states they send emails based on the API and customer's emails.  In gateway.class.php can I just comment out the email part or will this mess stuff up? What have others done in this situation?  Thabks for any and all help.

    $customer_id = $this->_basket['billing_address']['customer_id'];

            try {
                $customer = \Stripe\Customer::retrieve($customer_id);
                $customer->description = $this->_basket['billing_address']['first_name'].' '.$this->_basket['billing_address']['last_name'];
                $customer->email = $email;
                $customer->shipping = $shipping;
                $customer->save();
            } catch(Exception $e) {
                 $customer = \Stripe\Customer::create(array(
                      "description" => $this->_basket['billing_address']['first_name'].' '.$this->_basket['billing_address']['last_name'],
                   <!--   "email" => $email, -->
                      "id" => $customer_id,
                      "shipping" => $shipping
                ));
            }
        }

 

    # retrieve json from POST body
        $json_str = file_get_contents('php://input');
        $json_obj = json_decode($json_str);

        $intent = null;
        try {
            if (isset($json_obj->payment_method_id)) {
                # Create the PaymentIntent
                $intent = \Stripe\PaymentIntent::create([
                    "customer" => $customer_id,
                 <!--   "receipt_email" => $email, -->
                    "description" => "Payment for order ".$this->_basket['cart_order_id'],
                    'payment_method' => $json_obj->payment_method_id,
                    'amount' => $this->_basket['total']*100,
                    'currency' => strtolower($GLOBALS['config']->get('config', 'default_currency')),
                    'confirmation_method' => 'manual',
                    'confirm' => true,
                ]);
            }

 

Link to comment
Share on other sites

Thanks Brian ... Do you think this will keep Stripe from sending the customer an email receipt?  In my research I found this ...

receipt_email

The email address to send this charge's receipt to. The receipt will not be sent until the charge is paid. If this charge is for a customer, the email address specified here will override the customer's email address. Receipts will not be sent for test mode charges. If receipt_email is specified for a charge in live mode, a receipt will be sent regardless of your email settings.

So your best option is to not map the Email field under payment settings, and the receipt will not be sent from Stripe.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...