Skip to content

Instantly share code, notes, and snippets.

View chanakaDe's full-sized avatar
Amor vincit omnia.

Chanu De Silva chanakaDe

Amor vincit omnia.
View GitHub Profile
{
"dev": "1",
"vendor_id": "1",
"vendor_order_id": "123456789",
"vendor_sales_id": "abc123456",
"fullfillment": "AFN",
"payments": [
{
"via": "1",
"payment_id": "0W437861V1116442L",
{
"dev":"1",
"vendor_id":"2",
"vendor_order_id":"99887766",
"payments":[
{
"payment_id":"8SY073952V231635W",
"payer_id":"LZEDDQ7VW2UF8",
"capture_id":"56N44325TG4714647",
"payer_name":"John Doe",
@chanakaDe
chanakaDe / orders.sql
Last active March 15, 2021 10:33
Get orders for MS Power BI
select orders.id, orders.external_id, orders.created_at, order_items.article_id, manufacturers.name as manufacturer_name, articles.name as article_name, order_items.tariff_id, providers.name as provider_name, tariffs.name as tariff_name,tariffs.commission as tariff_provision, orders.external_status_order,orders.utm_partner, orders.utm_source, articles.cost_price,
(SELECT value FROM `property_values` WHERE `item_id` = `articles`.`id` AND `property_type_id` = 2 ) as device_storage,
(SELECT value FROM `property_values` WHERE `item_id` = `articles`.`id` AND `property_type_id` = 5 ) as device_color
from `orders` inner join `order_items` on `order_items`.`order_id` = `orders`.`id` inner join `articles` on `articles`.`id` = `order_items`.`article_id` inner join `manufacturers` on `manufacturers`.`id` = `articles`.`manufacturer_id` inner join `tariffs` on `tariffs`.`id` = `order_items`.`tariff_id` inner join `providers` on `providers`.`id` = `tariffs`.`provider_id`
where year(`orders`.`created_at`) = '2021' and m
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
<CstmrDrctDbtInitn>
<GrpHdr>
<MsgId>Proficash-2020-12-03T14:51:52:0026</MsgId>
<CreDtTm>2020-12-03T14:51:52</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>9,99</CtrlSum>
<InitgPty>
<Nm>Chanaka De Silva</Nm>
<?xml version="1.0" encoding="UTF-8"?>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
<CstmrDrctDbtInitn>
<GrpHdr>
<MsgId>Proficash-2020-12-03T14:51:52:0026</MsgId>
<CreDtTm>2020-12-03T14:51:52</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>9,99</CtrlSum>
<InitgPty>
<Nm>Chanaka De Silva</Nm>
{
"type": "error",
"code": 403,
"data": null,
"error": {
"raw": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such subscription: 'sub_I6zh3R7vOeO31z1'",
"param": "id",
@chanakaDe
chanakaDe / success.json
Created October 21, 2020 19:57
success.json
{
"type": "success",
"code": 200,
"error": null,
"subscription": {
"id": "sub_I6zh3R7vOeO31z",
"object": "subscription",
"application_fee_percent": null,
"billing_cycle_anchor": 1605987291,
"billing_thresholds": null,
#not_null_order_count
select count(*) not_null_order_count, DATE_FORMAT(orders.created_at, "%Y-%m-%d") as order_date from `orders` inner join `order_items` on `order_items`.`order_id` = `orders`.`id` where exists (select * from `order_items` where `orders`.`id` = `order_items`.`order_id` and exists (select * from `articles` where `order_items`.`article_id` = `articles`.`id` and `manufacturer_id` = ?)) and `order_items`.`tariff_id` is not null and `orders`.`created_at` between ? and ? group by `order_date` order by `order_date` asc
#null_order_count
select count(*) null_order_count, DATE_FORMAT(orders.created_at, "%Y-%m-%d") as order_date from `orders` inner join `order_items` on `order_items`.`order_id` = `orders`.`id` where exists (select * from `order_items` where `orders`.`id` = `order_items`.`order_id` and exists (select * from `articles` where `order_items`.`article_id` = `articles`.`id` and `manufacturer_id` = ?)) and `order_items`.`tariff_id` is null and `orders`.`created_at` between ? and ? group by
@extends ('layout')
@section('content')
<style>
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
{
"type": "error",
"code": 500,
"msg": "Your card's security code is incorrect.",
"body": {
"raw": {
"code": "incorrect_cvc",
"doc_url": "https://stripe.com/docs/error-codes/incorrect-cvc",
"message": "Your card's security code is incorrect.",
"param": "cvc",