stripe - app info with partner ID
MODIFY
src/integration/billing/stripe/StripeBillingIntegration.ts
src/integration/billing/stripe/StripeBillingIntegration.ts
@@ -4,7 +4,6 @@ import { BillingAccount, BillingDataTransactionStart, BillingDataTransactionStop
import { DimensionType, PricedConsumptionData, PricedDimensionData } from '../../../types/Pricing';
import FeatureToggles, { Feature } from '../../../utils/FeatureToggles';
import StripeHelpers, { StripeChargeOperationResult } from './StripeHelpers';
-import Tenant, { TenantComponents } from '../../../types/Tenant';
import Transaction, { StartTransactionErrorCode } from '../../../types/Transaction';
import AsyncTaskBuilder from '../../../async-task/AsyncTaskBuilder';
@@ -28,6 +27,7 @@ import { Request } from 'express';
import { ServerAction } from '../../../types/Server';
import SettingStorage from '../../../storage/mongodb/SettingStorage';
import Stripe from 'stripe';
+import Tenant from '../../../types/Tenant';
import TransactionStorage from '../../../storage/mongodb/TransactionStorage';
import User from '../../../types/User';
import UserStorage from '../../../storage/mongodb/UserStorage';
@@ -68,7 +68,12 @@ export default class StripeBillingIntegration extends BillingIntegration {
try {
const secretKey = await Cypher.decrypt(this.tenant, this.settings.stripe.secretKey);
this.stripe = new Stripe(secretKey, {
- apiVersion: '2020-08-27',
+ apiVersion: Constants.STRIPE_API_VERSION,
+ });
+ // Set application info to let STRIPE know that the account belongs to our solution
+ this.stripe.setAppInfo({
+ name: Constants.STRIPE_APP_NAME,
+ partner_id: Constants.STRIPE_PARTNER_ID,
});
} catch (error) {
throw new BackendError({

MODIFY
src/utils/Constants.ts
src/utils/Constants.ts
@@ -467,4 +467,9 @@ export default class Constants {
public static readonly AFIREV_MINIMAL_DURATION_THRESHOLD = 120; // Minimal duration - 2 minutes
public static readonly AFIREV_MINIMAL_CONSUMPTION_THRESHOLD = 500; // Minimal consumption - 0.5 kW.h
+
+ /* App Info for STRIPE */
+ public static readonly STRIPE_APP_NAME = 'Open e-Mobility';
+ public static readonly STRIPE_PARTNER_ID = 'TECH-00068';
+ public static readonly STRIPE_API_VERSION = '2020-08-27';
}

stripe - app info with partner ID