#Khan Masroof
1 messages · Page 1 of 1 (latest)
Which email are you referring to?
when someone buys a product through samcart and makes payment through stripe the stripe sends an email to us in which all details related to product must come
Not possible to configure those to include product details I'm afraid
You'd need to implement your own email solution
Yep, if you need that you'll ned to build it yourself
where?
I guess you'd listen for webhook events and trigger the emails using a third-party email service
zapier?
That's not an email service, but you could use Zapier to connect Stripe events to a service like Postmark yes
how would i set up a webhook
$payload = @file_get_contents('php://input');
$event = null;
try {
$event = \Stripe\Event::constructFrom(
json_decode($payload, true)
);
} catch(\UnexpectedValueException $e) {
// Invalid payload
http_response_code(400);
exit();
}
// Handle the event
switch ($event->type) {
case 'payment_intent.succeeded':
$paymentIntent = $event->data->object; // contains a \Stripe\PaymentIntent
// Then define and call a method to handle the successful payment intent.
// handlePaymentIntentSucceeded($paymentIntent);
break;
case 'payment_method.attached':
$paymentMethod = $event->data->object; // contains a \Stripe\PaymentMethod
// Then define and call a method to handle the successful attachment of a PaymentMethod.
// handlePaymentMethodAttached($paymentMethod);
break;
// ... handle other event types
default:
echo 'Received unknown event type ' . $event->type;
}
http_response_code(200);
What are you showing me here?
what will be the url for webhook
That would be the server where you host the endpoint for that code you shared
is ther anu other way to recieve that emails
Hi! I'm taking over this thread.
Can you clarify your question? I'm not sure I follow.
Actually i want to say the email we are recieving from stripe doesn;t came up with all the details regarding purchase
Like ynnoj said, if you want more info in the emails, then you'll need to build/send the emails yourself.
where i should set up
That's completely up to you and unrelated to Stripe.