onApprove: function(data, actions) { return actions.order.capture().then(function(details) { alert(\'Transaction completed by \' + details.payer.name.given