-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(refactor): unify payments-stripe to use getStripeInstanceForShop, an…
…d pull out a STRIPE_PACKAGE_NAME constant Signed-off-by: Alex Rattray <[email protected]>
- Loading branch information
1 parent
7392603
commit 8347d01
Showing
13 changed files
with
45 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
export const STRIPE_PACKAGE_NAME = "reaction-stripe"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
imports/plugins/included/payments-stripe/server/no-meteor/util/getStripeApiKey.js
This file was deleted.
Oops, something went wrong.
23 changes: 12 additions & 11 deletions
23
imports/plugins/included/payments-stripe/server/no-meteor/util/getStripeInstanceForShop.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
imports/plugins/included/payments-stripe/server/no-meteor/util/getStripePackageForShop.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { PACKAGE_NAME } from "/imports/plugins/included/payments-stripe/lib/constants"; | ||
|
||
/** | ||
* @summary Given a shop ID, gets the Stripe package data for that shop. | ||
* @param {Object} context The context object, with `collections.Packages` on it | ||
* @param {String} shopId The shop ID | ||
* @returns {Object} The Stripe package data. | ||
*/ | ||
export default async function getStripePackageForShop(context, shopId) { | ||
const { Packages } = context.collections; | ||
|
||
return Packages.findOne({ | ||
name: PACKAGE_NAME, | ||
shopId | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters