Skip to content

Instantly share code, notes, and snippets.

@rakibulislam
Created February 13, 2018 17:09
Show Gist options
  • Save rakibulislam/2e927c956fa322bbd1b970e7c3038caf to your computer and use it in GitHub Desktop.
Save rakibulislam/2e927c956fa322bbd1b970e7c3038caf to your computer and use it in GitHub Desktop.
CURRENT_DATE=`date -Ru | sed 's/+0000/GMT/'`
CHECKSUM=$(echo -n "application/json,,/transactions,$CURRENT_DATE" \
| openssl dgst -sha1 -binary -hmac "your-secret-key" \
| base64)
curl "https://apix.casiregalii.com/transactions" \
-X POST \
-d '{
"account_number": "12345678998",
"amount": "2000.0",
"currency": "USD",
"phone_number": "(714) 202-5081",
"client_number": "805-612-0442",
"first_name": "John",
"last_name": "Doe",
"rpps_biller_id": "12345678-de6b-4d5f-a14b-77df55ae5e55",
"address": {
"street": "123 Fake Street",
"zip_code": "12345",
"city": "Renton West" }
}' \
-H "Accept: application/vnd.regalii.v3.2+json" \
-H "Content-Type: application/json" \
-H "Content-MD5:" \
-H "Date: $CURRENT_DATE" \
-H "Authorization: APIAuth your-secret-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