• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stripe / stripe-ruby / 3644
97%

Build:
DEFAULT BRANCH: master
Ran 24 Apr 2020 05:59PM UTC
Jobs 6
Files 101
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
3644

push

travis-ci

web-flow
Expose `Stripe::Webhook.compute_signature` (#915)

Exposes the `.compute_signature` method, which may be useful when
testing webhook signing in test suites.

I change the API slightly so that a caller isn't forced to do as much
string mangling, and to match the one that we already have in stripe-go:

``` go
func ComputeSignature(t time.Time, payload []byte, secret string) []byte {
```

Add basic documentation and test case. I also change a few things around
so that we send `Time` objects around more often where applicable, and
don't change then to Unix integers until the last moment that we need
to.

The one other alternative API I considered is this one, which would
default the timestamp to the current time to allow the method to be
called with one fewer arg:

``` ruby
def self.compute_signature(payload, secret: timestamp: Time.now)
```

I decided against it in the end though because it does remove some
explicitness, and it's not a big deal to just pass in `Time.now`,
especially given that this is not expected to be a commonly used method.

Fixes #912.

1995 of 2072 relevant lines covered (96.28%)

3022.52 hits per line

Jobs
ID Job ID Ran Files Coverage
1 3644.1 (2.3, STRIPE_MOCK_VERSION=0.88.0) 24 Apr 2020 05:59PM UTC 0
96.38
Travis Job 3644.1
2 3644.2 (2.4, STRIPE_MOCK_VERSION=0.88.0) 24 Apr 2020 05:59PM UTC 0
96.38
Travis Job 3644.2
3 3644.3 (2.5, STRIPE_MOCK_VERSION=0.88.0) 24 Apr 2020 05:59PM UTC 0
96.38
Travis Job 3644.3
4 3644.4 (2.6, STRIPE_MOCK_VERSION=0.88.0) 24 Apr 2020 05:59PM UTC 0
96.36
Travis Job 3644.4
5 3644.5 (2.7, STRIPE_MOCK_VERSION=0.88.0) 24 Apr 2020 05:59PM UTC 0
96.36
Travis Job 3644.5
6 3644.6 (jruby-9.2.7.0, STRIPE_MOCK_VERSION=0.88.0) 24 Apr 2020 06:02PM UTC 0
0.0
Travis Job 3644.6
Source Files on build 3644
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #3644
  • e117c9fb on github
  • Prev Build on master (#3640)
  • Next Build on master (#3645)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc