'use strict';

const creators = {};
function paymentDetailsAdd(type, creator) {
  creators[type] = creator;
}
function paymentDetailsCreate(option, cosmetic) {
  const creator = creators[option.type];
  return creator ? creator(option, cosmetic) : undefined;
}

exports.paymentDetailsAdd = paymentDetailsAdd;
exports.paymentDetailsCreate = paymentDetailsCreate;
