Skip to content

Commit

Permalink
Add the default header to lock all endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
dleis612 committed Apr 2, 2024
1 parent c57a4bc commit 8aafe68
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@ internal object OkHttpClientBuilder {
.addHeader(
ForageConstants.Headers.AUTHORIZATION,
"${ForageConstants.Headers.BEARER} $sessionToken"
).run {
)
.run {
chain.request().headers[ForageConstants.Headers.API_VERSION]?.let {
this
}
?: addHeader(
ForageConstants.Headers.API_VERSION,
"default"
)
}
.run {
merchantId?.let {
addHeader(
ForageConstants.Headers.MERCHANT_ACCOUNT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ internal abstract class AbstractVaultSubmitter<VaultResponse>(
.setHeader(ForageConstants.Headers.MERCHANT_ACCOUNT, params.merchantId)
.setHeader(ForageConstants.Headers.IDEMPOTENCY_KEY, params.idempotencyKey)
.setHeader(ForageConstants.Headers.TRACE_ID, logger.getTraceIdValue())
.setHeader(ForageConstants.Headers.API_VERSION, "default")
.setToken(vaultToken)

// PaymentMethod.card.token is in the comma-separated format <vgs-token>,<basis-theory-token>,<forage-token>
Expand Down

0 comments on commit 8aafe68

Please sign in to comment.