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
@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,
{
"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",
<?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>
@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
{
"dev":"1",
"vendor_id":"2",
"vendor_order_id":"99887766",
"payments":[
{
"payment_id":"8SY073952V231635W",
"payer_id":"LZEDDQ7VW2UF8",
"capture_id":"56N44325TG4714647",
"payer_name":"John Doe",
{
"dev": "1",
"vendor_id": "1",
"vendor_order_id": "123456789",
"vendor_sales_id": "abc123456",
"fullfillment": "AFN",
"payments": [
{
"via": "1",
"payment_id": "0W437861V1116442L",
{
"api_environment": "staging",
"vendor_id": "41",
"vendor_order_id":"d6ce291f-3342-42fc-bafc-922550d0c548",
"payments": [
{
"via": "31",
"payment_id":"e31bff5f-2af0-4015-9aae-48bd89287520",
"payer_id":"4bb5b4d8-f52b-4aec-85b0-16d60db202bc",
"payer_name": "Erika Mustermann",
{
"id": "cs_test_a1oR7Z4E9l66QIIMLfB418FkTGXjI6QVSCmoPgMHgJtlEidZ63g4lrVCkt",
"object": "checkout.session",
"livemode": false,
"payment_intent": "pi_3KBLZqAuGdjHqmqs0hiCMUc5",
"status": "complete",
"after_expiration": null,
"allow_promotion_codes": null,
"amount_subtotal": 5995,
"amount_total": 5995,
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://prod1.vf-usp.spectrum8.io/vodafone/mobile/contract-summary',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,