From 2682f9ef79f1f271d9bfa019374261d30b74337a Mon Sep 17 00:00:00 2001 From: aaronjudd Date: Fri, 13 Feb 2015 19:07:15 -0800 Subject: [PATCH] Updated for package-registry-refactor Issue reactioncommerce/reaction#314 --- common/register.coffee | 21 ---------------- {client => common}/routing.coffee | 0 package.js | 12 +++++---- server/register.coffee | 41 +++++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 26 deletions(-) delete mode 100644 common/register.coffee rename {client => common}/routing.coffee (100%) create mode 100644 server/register.coffee diff --git a/common/register.coffee b/common/register.coffee deleted file mode 100644 index 9b98767..0000000 --- a/common/register.coffee +++ /dev/null @@ -1,21 +0,0 @@ -ReactionCore.registerPackage - name: 'reaction-auth-net' - provides: ['paymentMethod'] - paymentTemplate: "authnetPaymentForm" - label: 'Authorize.net' - description: 'Accept Authorize.net payments' - icon: 'fa fa-credit-card' - settingsRoute: 'authnet' - defaultSettings: - mode: false - client_id: "" - client_secret: "" - priority: '2' - hasWidget: true - shopPermissions: [ - { - label: "Authorize.net" - permission: "dashboard/payments" - group: "Shop Settings" - } - ] diff --git a/client/routing.coffee b/common/routing.coffee similarity index 100% rename from client/routing.coffee rename to common/routing.coffee diff --git a/package.js b/package.js index 3d83065..ea7be4a 100644 --- a/package.js +++ b/package.js @@ -1,7 +1,7 @@ Package.describe({ summary: "Reaction Authorize.net - Authorize.net payments for Reaction Commerce", name: "reactioncommerce:reaction-auth-net", - version: "0.1.0", + version: "0.2.0", git: "https://github.com/taylorsmithgg/reaction-auth-net" }); @@ -12,16 +12,18 @@ Package.onUse(function (api, where) { api.use("meteor-platform@1.2.1"); api.use("coffeescript"); api.use("less"); - api.use("reactioncommerce:core@0.3.0"); + api.use("reactioncommerce:core@0.4.0"); + + api.add_files("server/register.coffee",["server"]); // register as a reaction package + api.add_files("server/authnet.coffee",["server"]); api.add_files([ - "common/register.coffee", + "common/routing.coffee", "common/collections.coffee", "lib/authnet.coffee" ],["client","server"]); - api.add_files("server/authnet.coffee",["server"]); + api.add_files([ - "client/routing.coffee", "client/templates/authnet.html", "client/templates/authnet.less", "client/templates/authnet.coffee", diff --git a/server/register.coffee b/server/register.coffee new file mode 100644 index 0000000..5dad97f --- /dev/null +++ b/server/register.coffee @@ -0,0 +1,41 @@ +ReactionCore.registerPackage + name: 'reaction-auth-net' # usually same as meteor package + autoEnable: false # auto-enable in dashboard + settings: # private package settings config (blackbox) + mode: false + client_id: "" + client_secret: "" + registry: [ + # all options except route and template + # are used to describe the + # dashboard 'app card'. + { + provides: 'dashboard' + label: 'Authorize.net' + description: "Accept Authorize.net Payments" + icon: 'fa fa-credit-card' # glyphicon/fa + cycle: '4' # Core, Stable, Testing (currently testing) + container: 'dashboard' #group this with settings + } + # configures settings link for app card + # use 'group' to link to dashboard card + { + route: 'authnet' + provides: 'settings' + container: 'dashboard' + } + # configures template for checkout + # paymentMethod dynamic template + { + template: 'authnetPaymentForm' + provides: 'paymentMethod' + } + ] + # array of permission objects + permissions: [ + { + label: "Authorize.net" + permission: "dashboard/payments" + group: "Shop Settings" + } + ]