Email parameter to Stripe via Moltin V2 API

payments

#1

Hello folks,
I’m wondering how to pass the customer email to stripe in order to leverage the automatic email feature ( https://stripe.com/docs/dashboard/receipts#automatically-send-receipts-using-the-api )

from the API docs (and the js-sdk) it doesn’t seem like it’s currently supported


#2

Hi @asarto,

Yes this is possible. You can send an options object with additional fields which we’ll forward on to the payment gateway.

In this case your payment would look like:

Moltin.Orders.Payment('orderId', {
  gateway: "stripe",
  method: "purchase",
  first_name: "John"
  last_name: "Smith",
  number: "4242424242424242",
  month: "10",
  year: "2020",
  verification_value: "123",
  options: {
    receipt_email: 'customer@customer.com'
  }
}).then(() => {
  // Do something
});

Stripe won’t send out email automatically for test payments but you can test it is working by clicking the “send receipt” link on the payment:

This should be automatically populated with the receipt_email you passed when you created the charge:

Hope this helps!
James


#3

thanks @James - this does exactly what we need :slight_smile:


#4