paybridge 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -120,16 +120,14 @@ class SoftyCompProvider extends base_1.PaymentProvider {
120
120
  }
121
121
  async createSubscription(params) {
122
122
  this.validateCurrency(params.currency);
123
- // Map interval to SoftyComp frequency: 2=monthly, 6=yearly (valid range is 1-6)
124
- let frequencyTypeID;
125
- if (params.interval === 'monthly') {
126
- frequencyTypeID = 2;
127
- }
128
- else if (params.interval === 'yearly') {
129
- frequencyTypeID = 6;
130
- }
131
- else {
132
- throw new Error(`SoftyComp does not support ${params.interval} subscriptions. Use monthly or yearly.`);
123
+ // Map interval to SoftyComp frequency from official docs:
124
+ // 1=Once Off, 2=Monthly, 3=Weekly, 4=Yearly, 5=To Collect Amount, 6=Subscription
125
+ const frequencyMap = {
126
+ 'weekly': 3, 'monthly': 2, 'yearly': 4
127
+ };
128
+ const frequencyTypeID = frequencyMap[params.interval];
129
+ if (!frequencyTypeID) {
130
+ throw new Error(`SoftyComp does not support ${params.interval} subscriptions. Use weekly, monthly, or yearly.`);
133
131
  }
134
132
  // Parse and validate start date
135
133
  let startDate;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "paybridge",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "One API, every payment provider. Unified payment SDK for Node.js — SoftyComp, Yoco, Ozow, and more.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",