@shipengine/js-api 0.22.0 → 0.23.0
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.
- package/funding-sources/api.d.ts +3 -1
- package/funding-sources/types.d.ts +14 -0
- package/index.js +9 -0
- package/index.mjs +9 -0
- package/package.json +1 -1
package/funding-sources/api.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { AxiosInstance } from "axios";
|
|
2
|
-
import {
|
|
2
|
+
import { Money } from "../payments";
|
|
3
|
+
import { AddFundsResponse, CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress } from "./types";
|
|
3
4
|
export declare class FundingSourcesAPI {
|
|
4
5
|
private client;
|
|
5
6
|
constructor(client: AxiosInstance);
|
|
@@ -14,4 +15,5 @@ export declare class FundingSourcesAPI {
|
|
|
14
15
|
fundingSource: FundingSource;
|
|
15
16
|
}, any>>;
|
|
16
17
|
registerCarrier: (carrier: CarrierRegistration) => Promise<import("axios").AxiosResponse<CarrierRegistrationResponse, any>>;
|
|
18
|
+
addFunds: (amount: Money, fundingSourceId: string) => Promise<import("axios").AxiosResponse<AddFundsResponse, any>>;
|
|
17
19
|
}
|
|
@@ -1,7 +1,19 @@
|
|
|
1
|
+
export type AddFundsResponse = {
|
|
2
|
+
balance: {
|
|
3
|
+
amount: number;
|
|
4
|
+
currency: string;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* An encoded device fingerprint string containing information about the end-user's computing device such as OS, browser, etc.
|
|
9
|
+
* Required for carrier registration and US Wallet creation.
|
|
10
|
+
*/
|
|
11
|
+
type IovationBlackBox = string;
|
|
1
12
|
export type CreateFundingSource = {
|
|
2
13
|
acceptedTerms: Term[];
|
|
3
14
|
agreeToTerms: boolean;
|
|
4
15
|
billingInfo: FundingSourceAddress;
|
|
16
|
+
iovationBlackBox: IovationBlackBox;
|
|
5
17
|
paymentMethod: {
|
|
6
18
|
creditCardInfo: CreditCardInfo;
|
|
7
19
|
};
|
|
@@ -25,6 +37,7 @@ export interface CarrierRegistration {
|
|
|
25
37
|
agreeToTerms: boolean;
|
|
26
38
|
carrierCode: "stamps_com" | "ups_walleted" | "dhl_express_worldwide";
|
|
27
39
|
fundingSourceId: string;
|
|
40
|
+
iovationBlackBox: IovationBlackBox;
|
|
28
41
|
pickupAddress?: FundingSourceAddress;
|
|
29
42
|
}
|
|
30
43
|
];
|
|
@@ -64,3 +77,4 @@ export interface CarrierRegistrationResponse {
|
|
|
64
77
|
}
|
|
65
78
|
];
|
|
66
79
|
}
|
|
80
|
+
export {};
|
package/index.js
CHANGED
|
@@ -3231,6 +3231,12 @@ class FundingSourcesAPI {
|
|
|
3231
3231
|
endUserIpAddress
|
|
3232
3232
|
}, carrier));
|
|
3233
3233
|
});
|
|
3234
|
+
this.addFunds = (amount, fundingSourceId) => __async$2(this, null, function* () {
|
|
3235
|
+
return yield this.client.put(
|
|
3236
|
+
`/v1/funding_sources/${fundingSourceId}/add_funds`,
|
|
3237
|
+
amount
|
|
3238
|
+
);
|
|
3239
|
+
});
|
|
3234
3240
|
this.client = client;
|
|
3235
3241
|
}
|
|
3236
3242
|
}
|
|
@@ -3299,6 +3305,9 @@ class RateCardsAPI {
|
|
|
3299
3305
|
};
|
|
3300
3306
|
this.download = (rateCardId) => {
|
|
3301
3307
|
return this.client.get(`/v1/rate_cards/${rateCardId}/rates/download`, {
|
|
3308
|
+
headers: {
|
|
3309
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
3310
|
+
},
|
|
3302
3311
|
responseType: "blob"
|
|
3303
3312
|
});
|
|
3304
3313
|
};
|
package/index.mjs
CHANGED
|
@@ -3227,6 +3227,12 @@ class FundingSourcesAPI {
|
|
|
3227
3227
|
endUserIpAddress
|
|
3228
3228
|
}, carrier));
|
|
3229
3229
|
});
|
|
3230
|
+
this.addFunds = (amount, fundingSourceId) => __async$2(this, null, function* () {
|
|
3231
|
+
return yield this.client.put(
|
|
3232
|
+
`/v1/funding_sources/${fundingSourceId}/add_funds`,
|
|
3233
|
+
amount
|
|
3234
|
+
);
|
|
3235
|
+
});
|
|
3230
3236
|
this.client = client;
|
|
3231
3237
|
}
|
|
3232
3238
|
}
|
|
@@ -3295,6 +3301,9 @@ class RateCardsAPI {
|
|
|
3295
3301
|
};
|
|
3296
3302
|
this.download = (rateCardId) => {
|
|
3297
3303
|
return this.client.get(`/v1/rate_cards/${rateCardId}/rates/download`, {
|
|
3304
|
+
headers: {
|
|
3305
|
+
Accept: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
3306
|
+
},
|
|
3298
3307
|
responseType: "blob"
|
|
3299
3308
|
});
|
|
3300
3309
|
};
|