Skip to content

Instantly share code, notes, and snippets.

View deniszgonjanin's full-sized avatar
😀
🌍

Denis Zgonjanin deniszgonjanin

😀
🌍
  • Hypehound
  • Ottawa, ON, Canada
View GitHub Profile
@deniszgonjanin
deniszgonjanin / paypal_express_multicurrency_selling_plan_checkout.json
Last active April 26, 2024 11:58
Paypal Multicurrency Failure - Fixed Selling Plans. Return payload
{
"data": {
"submitForCompletion": {
"buyerProposal": {
"merchandiseDiscount": {
"__typename": "FilledDiscountTerms",
"acceptUnexpectedDiscounts": true,
"lines": []
},
"deliveryDiscount": {
@deniszgonjanin
deniszgonjanin / downpay_out_of_stock.md
Last active February 28, 2024 15:23
Selling variants with a deposit when out of stock

Selling variants with a deposit only when they are out of stock

Selling back-orders by collecting a deposit is a great strategy to not only secure sales that might have been lost, but also get customer committment before sourcing new inventory.

Using the Downpay API and Shopify Flow, we can create a workflow that will allow out-of-stock variants to be sold with a deposit.

We will do this by listening to variant inventory quantity changes, and adding the variant to a deposit purchase option when the inventory hits zero or below.

A second workflow will remove the variants from the same deposit option when the variant comes back in stock.

@deniszgonjanin
deniszgonjanin / order_tag_collect.md
Last active February 22, 2024 18:22
Flow: Trigger Downpay payment using Order tags

Shopify Flow: Triggering deferred payment collection through Order tags

This workflow will cause the deferred payment on orders made through Downpay to be collected once a specific tag is added to those orders.

The Shopify Flow workflow for this has four steps:

  • Schedule a run
  • Query for orders tagged with a specific tag
  • Split the results of the query into individual orders
  • For each of the orders, call the Downpay API to trigger deferred payment collection
@deniszgonjanin
deniszgonjanin / order_collect_downpay.md
Last active March 8, 2024 15:41
Programatically collecting the remaining order payment in Downpay

Programatically collecting the remaining order payment in Downpay

In order to programatically collec the remaining balance for a Downpay-enabled order, you can use the orderCollectPayment mutation.

Query:

@deniszgonjanin
deniszgonjanin / downpay_add_remove_products.md
Created February 8, 2024 23:45
Adding a removing products from Downpay purchase options

Programatically adding and removing products to Downpay purchase options

Using the Downpay API, you can add or remove products to purchase options with a single API call. For inputs, you will need:

  • The id of the purchase option in the app. You can find this ID by editing the relevant purchase option in the app - it is the last part of the URL of the edit page
  • The ids of the Shopify product(s) you'd like to add to the option.

The API is in GraphQL.

Adding a product to a purchase option:

[
{
"domain_content": true,
"domain_data": true,
"domain_software": false,
"family": "",
"id": "CC-BY-4.0",
"maintainer": "Creative Commons",
"od_conformance": "approved",
"is_okd_compliant": false,
#!/bin/sh
#
# /etc/init.d/tomcat6 -- startup script for the Tomcat 6 servlet engine
#
# Written by Miquel van Smoorenburg <miquels@cistron.nl>.
# Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.ai.mit.edu>.
# Modified for Tomcat by Stefan Gybas <sgybas@debian.org>.
# Modified for Tomcat6 by Thierry Carrez <thierry.carrez@ubuntu.com>.
# Additional improvements by Jason Brittain <jason.brittain@mulesoft.com>.
#
@deniszgonjanin
deniszgonjanin / Pandas Basics.ipynb
Created December 3, 2013 23:28
Pandas Basics - iPython Notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@deniszgonjanin
deniszgonjanin / pyCanLII.py
Created September 3, 2013 19:58
Thin CanLII API wrapper for python (http://developer.canlii.org/docs)
import urllib, urllib2, json
class CanLIIException(Exception):
def __str__(self):
return repr(self.args)
class CanLII(object):
def __init__(self, api_key, language = 'en'):
self.address = "http://api.canlii.org/v1/"