1. HASH
Sipay API Documentation
EN
  • EN
  • TR
  • Overview
    • Getting Started
    • Test Cards
    • IP Restriction
  • Authentication
    • Token Generation
      POST
  • Installments & Commission
    • Installment Details
      POST
    • Commission
      POST
    • Merchant Installments
      POST
  • HASH
    • Hash Creation
    • Hash Validation
  • Non-3DS Payment
    • Non-3DS Payment Flow
    • Non-3DS Card Payment
      POST
    • Non-3DS Recurring Payment
      POST
    • Non-3DS Insurance Payment
      POST
    • Non-3DS Pre-Authorization Payment
      POST
    • Confirm Payment
      POST
  • 3D Secure Payment
    • 3D Secure Payment Flow
    • 3D Secure Card Payment
      POST
    • 3D Secure Recurring Payment
      POST
    • 3D Secure Pre-Authorization Payment
      POST
    • Complete Payment
      POST
    • Confirm Payment
      POST
    • 3D Secure Agriculture Payment
      POST
  • Non-3DS and 3DS Payment with Sipay
    • Purchase Link Example
    • Non-3DS and 3D Secure Payment with Sipay
      POST
  • DPL
    • DPL
    • Status Codes
    • Options for Creating a DPL
    • Create DPL
    • List Payment Links
    • Payment Link Details
    • Update DPL
    • Remove DPL
  • Check Status
    • Check Status
  • Payment with Saved Card
    • Card Registration
    • 3D Secure Pay by Card Token
    • Non-3DS Pay by Card Token
    • Retrieving Saved Card
    • Edit Saved Card
    • Delete Saved Card
  • Recurring
    • Recurring Query Search
    • Recurring Plan Process
    • Recurring Plan Update
  • Refund
    • Refund
  • Cashout
    • Cashout to Bank
  • Webhook
    • Webhook
  • Status Codes
    • Status Codes
  • Plugin
    • Magento v1
    • Magento v2
    • Opencart
    • Presta
    • Woocommerce
    • Shopify
  • Settings
    • DPL Settings
    • Settings Update
  1. HASH

Hash Creation

For endpoints that require hash_key, generate a Hash v2 signature with the values from the current request. Hash v2 uses HMAC-SHA256 and returns a 64-character hexadecimal string.

Generate the signature#

1.
Find the signed fields and their order in the endpoint’s hash_key description. The request examples show the same order in each available programming language.
2.
Join the field values with | in that order. Keep an empty position for a signed field the endpoint allows to be empty. Use | only as the separator.
3.
Encode the joined message as UTF-8 and calculate HMAC-SHA256 using your merchant app_secret as the key. Keep the secret on your server.
4.
Send the hexadecimal signature in the request’s hash_key field.
Sign values exactly as sent. For amounts, 100.00 and 100 produce different signatures. Follow the endpoint’s JSON type. If it accepts a string for the amount, a string can preserve trailing zeros.

Example for paySmart2D#

The signed fields are total, installments_number, currency_code, merchant_key, and invoice_id, in that order. With the example secret example_app_secret, this Node.js example generates the hash_key shown in Hash Validation.
If verification fails, check the field order, the exact amount text, any empty positions, and the merchant secret. For response, redirect, and webhook verification, see Hash Validation.
Previous
Merchant Installments
Next
Hash Validation
Built with