templates/Transfer.template.js
function (transfer, cb) {

		Transfer.findOrCreate(transfer.id, transfer)
	    .exec(function (err, foundTransfer){
	      if (err) return cb(err);
	      if (foundTransfer.lastStripeEvent > transfer.lastStripeEvent) return cb(null, foundTransfer);
	      if (foundTransfer.lastStripeEvent == transfer.lastStripeEvent) return Transfer.afterStripeTransferCreated(foundTransfer, function(err, transfer){ return cb(err, transfer)});
	      Transfer.update(foundTransfer.id, transfer)
	      .exec(function(err, updatedTransfers){
	      	if (err) return cb(err);
	      	if(!updatedTransfers) return cb(null, null);
	      	Transfer.afterStripeTransferCreated(updatedTransfers[0], function(err, transfer){
	      		cb(err, transfer);
	      	});
	      });
	    });
	}
function (transfer, cb) {

		Transfer.findOrCreate(transfer.id, transfer)
	    .exec(function (err, foundTransfer){
	      if (err) return cb(err);
	      if (foundTransfer.lastStripeEvent > transfer.lastStripeEvent) return cb(null, foundTransfer);
	      if (foundTransfer.lastStripeEvent == transfer.lastStripeEvent) return Transfer.afterStripeTransferCreated(foundTransfer, function(err, transfer){ return cb(err, transfer)});
	      Transfer.update(foundTransfer.id, transfer)
	      .exec(function(err, updatedTransfers){
	      	if (err) return cb(err);
	      	if(!updatedTransfers) return cb(null, null);
	      	Transfer.afterStripeTransferCreated(updatedTransfers[0], function(err, transfer){
	      		cb(err, transfer);
	      	});
	      });
	    });
	}
function ( transfer , cb ) { Transfer . findOrCreate ( transfer . id , transfer ) . exec ( function ( err , foundTransfer ) { if ( err ) return cb ( err ) ; if ( foundTransfer . lastStripeEvent > transfer . lastStripeEvent ) return cb ( null , foundTransfer ) ; if ( foundTransfer . lastStripeEvent == transfer . lastStripeEvent ) return Transfer . afterStripeTransferCreated ( foundTransfer , function ( err , transfer ) { return cb ( err , transfer ) } ) ; Transfer . update ( foundTransfer . id , transfer ) . exec ( function ( err , updatedTransfers ) { if ( err ) return cb ( err ) ; if ( ! updatedTransfers ) return cb ( null , null ) ; Transfer . afterStripeTransferCreated ( updatedTransfers [ 0 ] , function ( err , transfer ) { cb ( err , transfer ) ; } ) ; } ) ; } ) ; }
Stripe Webhook transfer.created
Stripe Webhook transfer . created