Generate signatures based on the HPP method for the checkout form

Created on 23 January 2025, 5 months ago

To switch to actual account usage, we need to generate a signature based on the prescribed method, not simply use a static signature based on the test docs.

πŸ“Œ Task
Status

Active

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States rszrama

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rszrama
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    I'm failing to get a signature that will be accepted against the test credentials we have. I can't tell if that's because the credentials are not actually valid or the method of generating the signature isn't quite what they expect. The documentation is sparse and shoddy, so I believe we'll need to communicate with someone at SnapPay to get to the bottom of it.

    (Additionally, their examples are all based on JavaScript even though one of the parameters is supposed to be a secret key ... we can't very well be putting that into the DOM for use by a script in that case.)

  • Status changed to Fixed 20 days ago
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    In our specific context, the issue was the inclusion of a customer email address in the signature parameters. That needed to be removed. However, it's now clear that each merchant may have their own configuration for which data points should be incorporated into a signature. As such, this module may be seen more as a starting point that should be customized per merchant.

    • rszrama β†’ committed 6e3230ea on 7.x-1.x
      Issue #3501608 by rszrama: Generate signatures based on the HPP method...
  • πŸ‡ΊπŸ‡ΈUnited States mbnsorg

    Just noting - the fix for signature generation is related to the invocation of hash_hmac. It should return binary.

    $hash = hash_hmac('sha256', $raw_signature, base64_decode($settings['api_authentication_code']), true);

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024