mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Added additional gateway config options, fixed returning invalid response for grant API. (#43910)
Co-authored-by: matejss <matejss@inova.si>
This commit is contained in:
parent
f86c9d86ce
commit
537903f44e
24
types/braintree/index.d.ts
vendored
24
types/braintree/index.d.ts
vendored
@ -25,13 +25,24 @@ declare namespace braintree {
|
||||
Sandbox = 'Sandbox',
|
||||
}
|
||||
|
||||
export interface GatewayConfig {
|
||||
export type GatewayConfig = KeyGatewayConfig | ClientGatewayConfig | AccessTokenGatewayConfig;
|
||||
|
||||
export interface KeyGatewayConfig {
|
||||
environment: Environment;
|
||||
merchantId: string;
|
||||
publicKey: string;
|
||||
privateKey: string;
|
||||
}
|
||||
|
||||
export interface ClientGatewayConfig {
|
||||
clientId: string;
|
||||
clientSecret: string;
|
||||
}
|
||||
|
||||
export interface AccessTokenGatewayConfig {
|
||||
accessToken: string;
|
||||
}
|
||||
|
||||
export class BraintreeGateway {
|
||||
constructor(config: GatewayConfig);
|
||||
config: any;
|
||||
@ -75,6 +86,7 @@ declare namespace braintree {
|
||||
subscription: T extends Subscription ? Subscription : never;
|
||||
transaction: T extends Transaction ? Transaction : never;
|
||||
clientToken: T extends ClientToken ? string : never;
|
||||
credentials: T extends OAuthToken ? OAuthToken : never;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -165,7 +177,7 @@ declare namespace braintree {
|
||||
grant(
|
||||
sharedPaymentMethodToken: string,
|
||||
options: { allowVaulting?: boolean; includeBillingPostalCode?: boolean; revokeAfter?: Date },
|
||||
): Promise<Readonly<string>>;
|
||||
): Promise<ValidatedResponse<PaymentMethodNonce>>;
|
||||
revoke(sharedPaymentMethodToken: string): Promise<void>;
|
||||
update(token: string, updates: PaymentMethodUpdateRequest): Promise<ValidatedResponse<PaymentMethod>>;
|
||||
}
|
||||
@ -732,11 +744,9 @@ declare namespace braintree {
|
||||
*/
|
||||
|
||||
export interface OAuthToken {
|
||||
credentials: {
|
||||
accessToken: string;
|
||||
expiresAt: string;
|
||||
refreshToken: string;
|
||||
};
|
||||
accessToken: string;
|
||||
expiresAt: string;
|
||||
refreshToken: string;
|
||||
}
|
||||
|
||||
export interface OAuthCreateTokenFromCodeRequest {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user