-
Notifications
You must be signed in to change notification settings - Fork 57
Customer token #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customer token #12
Conversation
resources/customerToken.ts
Outdated
| } | ||
|
|
||
| // public async createToken(request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> { | ||
| public async createToken(request: CreateTokenRequest) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets keep the method signature
and remove the comment
types/customerToken.ts
Outdated
| /** | ||
| * send a verification code to the customer through one of the following channels sms or call. | ||
| */ | ||
| channel: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use "sms" | "call" (verify with the docs)
| channel: string | |
| channel: "sms" | "call" |
types/customerToken.ts
Outdated
| * string 6 digits code sent to the customer through the desired channel. | ||
| * Required if the scope attribute includes a scope which requires two-factor authentication. | ||
| */ | ||
| verificationCode?: string} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| verificationCode?: string} | |
| verificationCode?: string | |
| } |
types/customerToken.ts
Outdated
| } | ||
|
|
||
| export interface CreateTokenVerificationRequest { | ||
| customerId: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not really part of this request, its the identifier of this route so move it from the request and lets add it as a parameter to createTokenVerification
types/customerToken.ts
Outdated
| import { Phone } from "./common"; | ||
|
|
||
| export interface CreateTokenRequest { | ||
| customerId: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see me comment on:
CreateTokenVerificationRequest
resources/customerToken.ts
Outdated
| super(token,basePath + '/customers') | ||
| } | ||
|
|
||
| public async createToken(request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public async createToken(request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> { | |
| public async createToken(customerId: string, request: CreateTokenRequest) : Promise<UnitResponse<CustomerToken> | UnitError> { |
resources/customerToken.ts
Outdated
| return this.httpPost<UnitResponse<CustomerToken>>(`/${request.customerId}/token`, { data: request.data }) | ||
| } | ||
|
|
||
| public async createTokenVerification(request: CreateTokenVerificationRequest) : Promise<UnitResponse<VerificationToken> | UnitError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public async createTokenVerification(request: CreateTokenVerificationRequest) : Promise<UnitResponse<VerificationToken> | UnitError> { | |
| public async createTokenVerification(customerId:string, request: CreateTokenVerificationRequest) : Promise<UnitResponse<VerificationToken> | UnitError> { |
Update README.md
No description provided.