Send Merchant Email Notification by Webhook or use IPN instead?

chrisi_h91
Contributor
Contributor

Hi community!

 

Is the merchant only get notified by email when the transaction is completed by IPN or webhooks too? I actually don't know which to use?

I use the Orders API for transaction handling.

 

Thank you for your help!

 

BR,

Chris

Login to Me Too
5 REPLIES 5

georgyge
Contributor
Contributor

Hi @chrisi_h91 

    Did you get a solution for this?

Login to Me Too

chrisi_h91
Contributor
Contributor

Hi @georgyge ,

 

Sorry, but I didn't get an answer yet.

 

BR,

Chris

Login to Me Too

georgyge
Contributor
Contributor

Hi @chrisi_h91 

    Do you have got any idea regarding, whether a merchant email will be send by default to the payee if a transcation is done via paypal?? or we need to have do some configurations?

 

Login to Me Too

chrisi_h91
Contributor
Contributor

That's a good question! But I don't have an answer for you! 😞

Login to Me Too

JackieDaytona
Contributor
Contributor

I do not use Webhook or IPN, both were a PAIN.  Here the solution that I used:

 

                // Render the PayPal button into #paypal-button-container
               // by David . Nugent - Using PayPal REST V2 API Last update: 05/27/2020
               

               paypal.Buttons({
                         style: {
                                    layout: 'horizontal',
                                    color: 'gold',
                                     shape: 'pill',
                                    label: 'checkout',
                                    size: 'responsive',
                                    tagline: 'true',
                             },

                            // Set up the transaction
                               createOrder: function(data, actions) {
                               $('#paypalmsg').hide();
                               $('#transmsg').show();
                               $('#transmsg').html('<b>'+'WAITING ON AUTHORIZATION...'+'</b>');
                               $('#chkoutmsg').hide()
                               return actions.order.create({
                                       purchase_units: [{
                                                      description: 'GnG Order',
                                                       amount: {
                                                             value: cartTotal
                                                    }
                                             }],
                                             application_context: {
                                                    shipping_preference: 'NO_SHIPPING'
                                            }

                                        });
                                 },
                                // Finalize the transaction
                                onApprove: function(data, actions) {
                                return actions.order.capture().then(function(details) {
                               // Show a success message to the buyer
                                      $('#transmsg').html('<b>' + 'AUTHORIZED...' + '</b>');
                                       $('#transmsg').append('<br>'+'Transaction completed by: ' + details.payer.name.given_name +' '+ details.payer.name.surname     + '<br>' + "Order Id: " + details.id + '<br>' + 'Status: PAID & APPROVED' + '<br>'+ 'Thank You For Your Order'+ '<br>');
                                      if (details.status === "COMPLETED") {
                                             window.setTimeout(function() {}, 500)
                                            $('#transmsg').append('<b>' + 'Sending Order...Please Wait' + '</b>'+'<br>');     
                                             $('#transid').val(details.id);
                                             $('#orderstat').val('APPROVED');
                                             $('#orderform').submit();  <------Here is where I call the submit for the email form for  the merchant
                                                                                                       Here is my HTML in the form (<form id="orderform" data-form-type="order"                                                                                                           data-result-class="rd-mailform-validate" method="post" action="bat/rd-                                                                                                             mailform.php" class="rd-mailform offset-md-top-80 offset-top-30 z-index">                                                                                                        if  you need the Jquery portion of that segment let me know)
                                           }
                                        });


if (details.error === 'INSTRUMENT_DECLINED') {
$('#transmsg').html('<b>' + 'TRANSACTION WAS DECLINED'+'</b>');
$('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() {
$('#paypalmsg').show();
$('#chkoutmsg').show();
$('#transmsg').empty();
});

return actions.restart();
};
},

onCancel: function(data) {
$('#transmsg').html('<b>' + 'YOUR TRANSACTION WAS CANCELLED' + '</b>');
$('#transmsg').fadeIn('slow').delay(3000).fadeOut('slow', function() {
$('#paypalmsg').show();
$('#chkoutmsg').show();
$('#transmsg').empty();
});
}

}).render('#paypal-button-container');

 

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.