templates/Card.template.js
function (card, cb) {

		Card.findOrCreate(card.id, card)
	    .exec(function (err, foundCard){
	      if (err) return cb(err);
	      if (foundCard.lastStripeEvent > card.lastStripeEvent) return cb(null, foundCard);
	      if (foundCard.lastStripeEvent == card.lastStripeEvent) return Card.afterStripeCustomerCardUpdated(foundCard, function(err, card){ return cb(err, card)});
	      Card.update(foundCard.id, card)
	      .exec(function(err, updatedCards){
	      	if (err) return cb(err);
	      	if (!updatedCards) return cb(null, null);
	      	Card.afterStripeCustomerCardUpdated(updatedCards[0], function(err, card){
	      		cb(err, card);
	      	});
	      });
	    });
	}
function (card, cb) {

		Card.findOrCreate(card.id, card)
	    .exec(function (err, foundCard){
	      if (err) return cb(err);
	      if (foundCard.lastStripeEvent > card.lastStripeEvent) return cb(null, foundCard);
	      if (foundCard.lastStripeEvent == card.lastStripeEvent) return Card.afterStripeCustomerCardUpdated(foundCard, function(err, card){ return cb(err, card)});
	      Card.update(foundCard.id, card)
	      .exec(function(err, updatedCards){
	      	if (err) return cb(err);
	      	if (!updatedCards) return cb(null, null);
	      	Card.afterStripeCustomerCardUpdated(updatedCards[0], function(err, card){
	      		cb(err, card);
	      	});
	      });
	    });
	}
function ( card , cb ) { Card . findOrCreate ( card . id , card ) . exec ( function ( err , foundCard ) { if ( err ) return cb ( err ) ; if ( foundCard . lastStripeEvent > card . lastStripeEvent ) return cb ( null , foundCard ) ; if ( foundCard . lastStripeEvent == card . lastStripeEvent ) return Card . afterStripeCustomerCardUpdated ( foundCard , function ( err , card ) { return cb ( err , card ) } ) ; Card . update ( foundCard . id , card ) . exec ( function ( err , updatedCards ) { if ( err ) return cb ( err ) ; if ( ! updatedCards ) return cb ( null , null ) ; Card . afterStripeCustomerCardUpdated ( updatedCards [ 0 ] , function ( err , card ) { cb ( err , card ) ; } ) ; } ) ; } ) ; }
Stripe Webhook customer.card.updated
Stripe Webhook customer . card . updated