@shipengine/js-api 0.15.0 → 0.16.1

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.
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance } from "axios";
2
- import { CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreateFundingSourceResponse, CreditCardInfo, FundingSource, FundingSourceAddress } from "./types";
2
+ import { CarrierRegistration, CarrierRegistrationResponse, CreateFundingSource, CreditCardInfo, FundingSource, FundingSourceAddress } from "./types";
3
3
  export declare class FundingSourcesAPI {
4
4
  private client;
5
5
  constructor(client: AxiosInstance);
@@ -7,7 +7,11 @@ export declare class FundingSourcesAPI {
7
7
  fundingSources: FundingSource[];
8
8
  }, any>>;
9
9
  get: (fundingSourceId: string) => Promise<import("axios").AxiosResponse<FundingSource, any>>;
10
- create: (createFundingSource: CreateFundingSource) => Promise<import("axios").AxiosResponse<CreateFundingSourceResponse, any>>;
11
- update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo, fundingSourceId: string) => Promise<import("axios").AxiosResponse<CreateFundingSourceResponse, any>>;
10
+ create: (createFundingSource: CreateFundingSource) => Promise<import("axios").AxiosResponse<{
11
+ fundingSource: FundingSource;
12
+ }, any>>;
13
+ update: (billingInfo: FundingSourceAddress, creditCardInfo: CreditCardInfo, fundingSourceId: string) => Promise<import("axios").AxiosResponse<{
14
+ fundingSource: FundingSource;
15
+ }, any>>;
12
16
  registerCarrier: (carrier: CarrierRegistration) => Promise<import("axios").AxiosResponse<CarrierRegistrationResponse, any>>;
13
17
  }
@@ -1,18 +1,23 @@
1
- import { CreditCardVendor } from "../payments";
2
1
  export type CreateFundingSource = {
3
2
  acceptedTerms: Term[];
4
3
  agreeToTerms: boolean;
5
4
  billingInfo: FundingSourceAddress;
6
- paymentMethod: PaymentMethod;
5
+ paymentMethod: {
6
+ creditCardInfo: CreditCardInfo;
7
+ };
7
8
  };
8
9
  export type FundingSource = {
9
- billingInfo: FundingSourceAddress;
10
10
  currencyCode: string;
11
11
  fundingSourceId: string;
12
- paymentMethod: PaymentMethod | {
13
- creditCardInfo: null;
12
+ paymentMethod: {
13
+ creditCardInfo: AbbreviatedCreditCardInfo | null;
14
14
  };
15
15
  };
16
+ export type AbbreviatedCreditCardInfo = {
17
+ cardNumberLastFour: string;
18
+ provider: Provider;
19
+ };
20
+ export type Provider = "visa" | "mastercard" | "americaExpress" | "discover";
16
21
  export interface CarrierRegistration {
17
22
  carriers: [
18
23
  {
@@ -42,10 +47,7 @@ export interface CreditCardInfo {
42
47
  expirationMonth: number;
43
48
  expirationYear: number;
44
49
  name: string;
45
- provider: CreditCardVendor;
46
- }
47
- export interface PaymentMethod {
48
- creditCardInfo: CreditCardInfo;
50
+ provider: Provider;
49
51
  }
50
52
  export interface Term {
51
53
  termType: string;
@@ -62,13 +64,3 @@ export interface CarrierRegistrationResponse {
62
64
  }
63
65
  ];
64
66
  }
65
- export interface CreateFundingSourceResponse {
66
- fundingSource: {
67
- billingInfo: FundingSourceAddress;
68
- currencyCode: string;
69
- fundingSourceId: string;
70
- PaymentMethod: PaymentMethod | {
71
- creditCardInfo: null;
72
- };
73
- };
74
- }