api-lambda-stripe-charge icon indicating copy to clipboard operation
api-lambda-stripe-charge copied to clipboard

#17 Exposed stripe configuration options

Open SimonEismann opened this issue 4 years ago • 0 comments

Added six new cloud formation parameters:

  • ApiVersion
  • MaxNetworkRetries
  • Timeout
  • Host
  • Port
  • Telemetry

that correspond to the configuration options of the stripe library. The parameters are passed as environment parameters to the lambda functions, which in turn pass them to the stripe library upon initialization.

The following two configuration options are not exposed:

  • httpAgent: This gets passed a JS object which is hard to do in cloud formation, outside of defining a few fixed options.
  • protocol: It seems that this parameter is not supported by the stripe library version we are using. Also, stripe discourages the usage of this parameter.

I've tested that changes in the environment variables for ApiVersion, Host, and Port, are successfully propagated to the underlying library. For MaxNetworkRetries, Timeout, and Telemetry it's hard to figure out if they are successfully propagated to the library, but I don't see why they would not work. Especially, since the stripe library complains if an unknown configuration option is supplied.

I hope that this is the correct way of exposing parameters for SAR applications, I've used ´EnableInstantCapture´ as a guideline.

SimonEismann avatar Apr 07 '21 10:04 SimonEismann