mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Added oauth to braintree gateway. (#43778)
Co-authored-by: matejss <matejss@inova.si>
This commit is contained in:
parent
11eced8634
commit
0fd9f67701
34
types/braintree/index.d.ts
vendored
34
types/braintree/index.d.ts
vendored
@ -44,6 +44,7 @@ declare namespace braintree {
|
||||
discount: DiscountGateway;
|
||||
dispute: DisputeGateway;
|
||||
merchantAccount: MerchantAccountGateway;
|
||||
oauth: OAuthGateway;
|
||||
paymentMethod: PaymentMethodGateway;
|
||||
paymentMethodNonce: PaymentMethodNonceGateway;
|
||||
plan: PlanGateway;
|
||||
@ -150,6 +151,13 @@ declare namespace braintree {
|
||||
find(merchantAccountId: string): Promise<MerchantAccount>;
|
||||
}
|
||||
|
||||
interface OAuthGateway {
|
||||
createTokenFromCode(request: OAuthCreateTokenFromCodeRequest): Promise<ValidatedResponse<OAuthToken>>;
|
||||
createTokenFromRefreshToken(request: OAuthCreateTokenFromRefreshTokenRequest): Promise<ValidatedResponse<OAuthToken>>;
|
||||
revokeAccessToken(accessToken: string): Promise<ValidatedResponse<void>>;
|
||||
connectUrl(urlRequest: OAuthConnectUrlRequest): string;
|
||||
}
|
||||
|
||||
interface PaymentMethodGateway {
|
||||
create(request: PaymentMethodCreateRequest): Promise<ValidatedResponse<PaymentMethod>>;
|
||||
delete(token: string): Promise<void>;
|
||||
@ -719,6 +727,32 @@ declare namespace braintree {
|
||||
|
||||
export type MerchantAccountStatus = 'Pending' | 'Active' | 'Suspended';
|
||||
|
||||
/**
|
||||
* OAuth
|
||||
*/
|
||||
|
||||
export interface OAuthToken {
|
||||
credentials: {
|
||||
accessToken: string;
|
||||
expiresAt: string;
|
||||
refreshToken: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface OAuthCreateTokenFromCodeRequest {
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface OAuthCreateTokenFromRefreshTokenRequest {
|
||||
refreshToken: string;
|
||||
}
|
||||
|
||||
export interface OAuthConnectUrlRequest {
|
||||
redirectUri: string;
|
||||
scope: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Payment Method
|
||||
*/
|
||||
|
||||
Loading…
Reference in New Issue
Block a user