-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(authorizenet): add state config for accept retry backoff (#2541)
- Loading branch information
Showing
7 changed files
with
68 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { DaffAuthorizeNetStateConfig } from './type'; | ||
|
||
export const daffAuthorizeNetStateDefaultConfig: DaffAuthorizeNetStateConfig = { | ||
acceptMaxRetries: 5, | ||
acceptBackoffTiming: 30, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export { daffAuthorizeNetStateDefaultConfig } from './default'; | ||
export { | ||
DAFF_AUTHORIZE_NET_STATE_CONFIG, | ||
provideDaffAuthorizeNetStateConfig, | ||
} from './token'; | ||
export { DaffAuthorizeNetStateConfig } from './type'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { | ||
InjectionToken, | ||
ValueProvider, | ||
} from '@angular/core'; | ||
|
||
import { daffAuthorizeNetStateDefaultConfig } from './default'; | ||
import { DaffAuthorizeNetStateConfig } from './type'; | ||
|
||
export const DAFF_AUTHORIZE_NET_STATE_CONFIG = new InjectionToken('DAFF_AUTHORIZE_NET_STATE_CONFIG', { factory: () => daffAuthorizeNetStateDefaultConfig }); | ||
|
||
export const provideDaffAuthorizeNetStateConfig = (config: DaffAuthorizeNetStateConfig): ValueProvider => ({ | ||
provide: DAFF_AUTHORIZE_NET_STATE_CONFIG, | ||
useValue: config, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface DaffAuthorizeNetStateConfig { | ||
/** | ||
* How many times Daffodil will retry the Accept.js load. | ||
* Defaults to 5. | ||
*/ | ||
acceptMaxRetries: number; | ||
|
||
/** | ||
* The Accept.js loading retry backoff timing in milliseconds. | ||
* Defaults to 30. | ||
*/ | ||
acceptBackoffTiming: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters