Skip to content

Instantly share code, notes, and snippets.

@rakibulislam
Created February 13, 2018 23:20
Show Gist options
  • Save rakibulislam/2facbab857840bc3873165daa4ab2ecb to your computer and use it in GitHub Desktop.
Save rakibulislam/2facbab857840bc3873165daa4ab2ecb to your computer and use it in GitHub Desktop.
CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'`
CHECKSUM=$(echo -n "application/json,,/transactions/<ID>,$CURRENT_DATE" \
| openssl dgst -sha1 -binary -hmac "your-secret-key" \
| base64)
curl "https://apix.casiregalii.com/transactions/<ID>" \
-X GET \
-H "Accept: application/vnd.regalii.v3.2+json" \
-H "Content-Type: application/json" \
-H "Content-MD5:" \
-H "Date: $CURRENT_DATE" \
-H "Authorization: APIAuth your-api-key:$CHECKSUM"
# => JSON Response
{
"id": "5969ae86-8e88-4daf-8936-ad84a9d1cc30",
"status": "initialized",
"bill_id": null,
"account_number": "12345678998",
"currency": "USD",
"amount": "2000.0",
"created_at": "2018-01-11T19:42:48.439Z",
"updated_at": "2018-01-11T19:42:48.439Z",
"error_code": null,
"error_message":null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment