Skip to content

Instantly share code, notes, and snippets.

View ziyadparekh's full-sized avatar

Ziyad Parekh ziyadparekh

View GitHub Profile
<!-- Add this script tag to the <head> of the Checkout demo page !-->
<script type="text/javascript" src="https://storage.googleapis.com/safepayobjects/api/safepay-checkout.min.js"></script>
<!-- Add this script tag to the <head> of the Checkout demo page !-->
<!-- Add this script tag to the end of the <body> of the Checkout demo page !-->
<script type="text/javascript">
safepay.Button.render({
env: 'production',
amount: 100,
client: {
@ziyadparekh
ziyadparekh / safepay.py
Created June 30, 2020 17:39
Safepay Python Code samples
# Create your views here.
import hashlib
import base64
import os
import hmac
import urllib
from datetime import datetime
import random
from django.shortcuts import redirect
from django.http import HttpResponse
@ziyadparekh
ziyadparekh / safepay-integration.md
Last active April 4, 2022 18:24
Safepay custom integration

To integrate with Safepay, you will need a production account and a sandbox account.

Production accounts can be created by visiting this link https://getsafepay.com

Sandbox accounts can be created by visiting this link https://sandbox.api.getsafepay.com

Please take a note of your:

  1. Production API Key
  2. Production Secret Key
  3. Sandbox API Key
@ziyadparekh
ziyadparekh / gist:39062a21b8b83e69adb067a7b7076d03
Created January 17, 2020 07:46
Safepay Shopify Plugin Flow Description

The plugin will work as follows:

  1. Ability to install the plugin through composer (or through any php package manager)
  2. Once installed, the user can configure the plugin with the following core settings: a) Enable/Disable b) Enable/Disable Sandbox Mode c) Enter Sandbox API Key d) Enter Sandbox Secret Key (with instructions on where to find it on the dashboard) e) Enter Production API Key f) Enter Production Secret Key (with instructions on where to find it on the dashboard)
curl --location --request POST 'https://sandbox.api.getsafepay.com/order/v1/init' \
--header 'Content-Type: application/json' \
--data-raw '{
  "client": "sec_c18b707b-bd0f-41fe-947a-e894adf81e20",
  "amount": 1000.00,
  "currency": "PKR",
  "environment": "sandbox"
}'
@ziyadparekh
ziyadparekh / safepay-angular.js
Created July 15, 2019 02:20
Safepay Checkout Angular Demo
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.9/angular.js"></script>
<script src="https://storage.googleapis.com/safepayobjects/api/safepay-checkout.min.js"></script>
<script>
window.safepay.Button.driver('angular', window.angular);
window.angular.module('app', ['safepay-button']).controller('appController', function($scope) {
$scope.opts = {
// Either sandbox or production
env: 'production',
@ziyadparekh
ziyadparekh / safepay.js
Last active September 16, 2020 06:33
Safepay Integration
safepay.Button.render({
env: 'sandbox',
amount: 6800.57,
client: {
"sandbox": "sec_4f84abd2-0bae-4476-be6b-22c8c9e35133"
"production": "<YOUR_CLIENT_KEY>"
},
payment: function (data, actions) {
return actions.payment.create({
0x9f5b24b6D79fdC88eaee20586EF920Fe362fB2e2

Keybase proof

I hereby claim:

  • I am ziyadparekh on github.
  • I am zp (https://keybase.io/zp) on keybase.
  • I have a public key whose fingerprint is 9283 4673 AF6C 8C96 E07C 19EE 24CE 5B41 8581 0D8F

To claim this, I am signing this object: