Coder Social home page Coder Social logo

php-sdk's Introduction

Getting Started

##Beginners Guide

All configuration is done via _config.yml file which you will find in your main repo folder.

Basic

  • These configuration in author: is for our blog author's
authors:
  tom:
    name: Tom Canabarro
    image: '/img/authors/tc.jpg'
    bio: Co-founder @ Konduto
    link: http://br.linkedin.com/in/tcanabarro/
  milton:
    name: Milton Tavares Neto
    image: '/img/authors/mt.jpg'
    bio: Co-founder @ Konduto
    link: http://br.linkedin.com/in/miltontavares/
  felipe:
    name: Felipe Held
    image: '/img/authors/fh.jpg'
    bio: "Head of Marketing & Communications @ Konduto"
    link: https://br.linkedin.com/in/felipeheld
  daniel:
    name: Daniel Bento
    image: '/img/authors/db.jpg'
    bio: Co-founder @ Konduto
    link: https://br.linkedin.com/in/danielbento
  • The languages available in our website are in the _config.yml as well
languages: ["pt", "en", "es"]
  • The first language in the array will be the default language, they will be added into separate subfolders.

##To use this template:

  • Run bundle exec jekyll serve to generate site locally
  • View it by going to http://localhost:4000
  • If all is well, upload contents of _site to your server

##Folder structure

  • Our main pages are in _data/language folder. You just need to add the pages for en and es languages with the same pagename (you can see the pagname in the root of the website).
  • The pagename.yml files are written in YAML syntax which caters for a simple grouping of strings
  • Our template for post page is in _layouts/post.html

Adding new post

Our posts are in _i18n folder with sub-folders for each language. You just need to add the new post in _i18n/pt/_posts/ and do this for each language

In _i18n folder there is also pt.yml, es.yml, en.yml. There is a translation for blog and post pages (month, titles, book downloading links and etc.)

Adding new page

Let's say you want to create an about page for the website, you will create an about.html page on the root of the website (same place as index.html), with this:

---
title: About
pagename: about
---

Then, create exactlly the same name file about.md under _data/en with the English content. Repeat this for the other languages (_data/es/about.md ...). When running the website, visit the address http://localhost:4000/about to see the English version, http://localhost:4000/es/about for the Spanish one, etc.

You can use alredy existing parts from _includes/ and _includes/sections folder. You can bulid a new page just like a lego

php-sdk's People

Contributors

andersonba avatar fabioaromanini avatar hiryu85 avatar luisguilhermemsalmeida avatar murilopereirame avatar raphaelsampaio avatar tcanabarro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-sdk's Issues

Payment

boa noite!
Estou tentando setar o Payment para o objeto Order. No entanto, está sendo retornado para sempre a seguinte mensagem: "send orderArray ( [status] => error [message] => stdClass Object ( [where] => /payment [why] => stdClass Object ( [expected] => Array ( [0] => array ) [found] => object ) ) ) "

Estou setando um array no método setPayment da Order. Segue o código:

$orderKonduto = new Models\Order();
$paymentKonduto = array(
"type" => Models\Payment::TYPE_CREDIT,
"bin" => substr($payment["credit_card_number"], 0, 6), // 6 primeiros digitos do cartao de credito
"last4" => substr($payment["credit_card_number"], strlen($payment["credit_card_number"]) - 4, strlen($payment["credit_card_number"])),
"expiration_date" => $ed_month.$ed_year
);
$orderKonduto->setPayment($paymentKonduto);

A mensagem diz que estou setando um objeto, mas estou setando um array mesmo.

Autoload failing because classes are in the same file

Hi guys, I found an issue here.

Class 'Konduto\Models\BusTravelLeg' not found in /var/www/brazil/vendor/konduto/sdk/src/Models/Model.php

When it tries instantiate the BusTravelLeg, it doesn't works, because the autoload is seeking for a BusTravelLeg file to be included.

Regards,

Exception not found

Theres an Exception in file HttpResponse.php that not exist.

file: HttpResponse.php
Line: 36
exception: CommunicationErrorException

Exception file name:
CommunicationError.php

Support for vehicle field

SDK does not support newer vehicle fields in orders API yet.

Example

Here's an example of an order with the vehicle field that can be provided by POST /v1/orders.

{
    "id": "Pedido000001",
    "visitor": "1234567890123456789012345678901234567890",
    "total_amount": 123.45,
    "shipping_amount": 10.01,
    "tax_amount": 0.01,
    "installments": 2,
    "ip": "123.123.123.123",
    "currency": "BRL",
    "customer": {
        "id": "2937593",
        "name": "Fulano's de Tal",
        "tax_id": "283938282893",
        "phone1": "+551112344321",
        "email": "[email protected]",
        "dob": "1970-02-02"
    },
    "payment": [
        {
            "type": "credit",
            "bin": "490172",
            "last4": "1234",
            "expiration_date": "92017"
        }
    ],
    "vehicle": {
        "make": "Fiat",
        "model": "Palio",
        "renavam": "12593696135",
        "registration": "ABC1234",
        "owner": {
            "name": "Alfredo",
            "tax_id": "12345678900"
        },
        "type": "car"
    }
}

Support for events field

SDK does not support newer events fields in orders API yet.

Example

Here's an example of an order with the events field that can be provided using POST /v1/orders.

{
    "id": "Pedido000005",
    "total_amount": 123.45,
    "shipping_amount": 10.01,
    "tax_amount": 0.01,
    "installments": 2,
    "ip": "123.123.123.123",
    "currency": "BRL",
    "payment": [
        {
            "type": "credit",
            "sha1": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
            "bin": "490172",
            "last4": "1234",
            "expiration_date": "92017",
            "cvv_result": "A",
            "avs_result": "X",
            "status": "approved",
            "number_of_retries": 1,
            "amount": 123.45,
            "description": "pagamento via cartão de crédito"
        }
    ],
    "customer": {
        "id": "2937293",
        "name": "Fulano's de Tal",
        "tax_id": "283938282893",
        "phone1": "+551112344321",
        "email": "[email protected]",
        "dob": "1970-02-02"
    },
    "events": [
        {
            "name": "Safadão no Maracanã",
            "date": "2021-01-01T03:00:00Z",
            "type": "show",
            "subtype": "sertanejo",
            "venue": {
                "name": "Estádio do Maracanã",
                "capacity": 80000,
                "address": "Av. Maracanã s/n",
                "city": "Rio de Janeiro",
                "state": "RJ",
                "country": "BR"
            },
            "tickets": [
                {
                    "category": "regular",
                    "premium": true,
                    "section": "Pista Premium",
                    "attendee": {
                        "document": "12345678900",
                        "document_type": "cpf",
                        "dob": "1990-10-28"
                    }
                },
                {
                    "category": "student",
                    "premium": false
                }
            ]
        },
        {
            "name": "Heat @ Knicks",
            "date": "2020-11-21T01:00:00Z",
            "type": "sports",
            "subtype": "NBA",
            "tickets": [
                {
                    "category": "regular",
                    "premium": true,
                    "section": "general"
                },
                {
                    "category": "regular",
                    "section": "general",
                    "premium": true
                }
            ]
        }
    ]
}

Address Model setName

In Address Model the function setName are setting the wrong attribute.

    public function setName($value) {
        $this->set("zip", $value);
    }

Instead

    public function setName($value) {
        $this->set("name", $value);
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.