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

stripe / stripe-ruby / 3644 / 1
97%
master: 97%

Build:
DEFAULT BRANCH: master
Ran 24 Apr 2020 05:59PM UTC
Files 101
Run time 12s
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

24 Apr 2020 05:58PM UTC coverage: 96.383% (+0.003%) from 96.38%
2.3, STRIPE_MOCK_VERSION=0.88.0

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.

2052 of 2129 relevant lines covered (96.38%)

613.7 hits per line

Source Files on job 3644.1 (2.3, STRIPE_MOCK_VERSION=0.88.0)
  • Tree
  • List 0
  • Changed 4
  • Source Changed 1
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 3472
  • Travis Job 3644.1
  • e117c9fb on github
  • Prev Job for 2.3, STRIPE_MOCK_VERSION=0.88.0 on master (#3640.1)
  • Next Job for 2.3, STRIPE_MOCK_VERSION=0.88.0 on master (#3645.1)
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