Coder Social home page Coder Social logo

php-sdk's Issues

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);
    }

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
                }
            ]
        }
    ]
}

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"
    }
}

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.