magento2 – Error when trying to add an order via the API

The url for shipping is:

V1/guest-carts//payment-information

https://store.upc.tax/rest/default/V1/guest-carts/5Shn4DiClYehFeJpq0lzwGy78O4e5I7h/payment-information

I try to add a purchase order with a guest cart, it throws the following error:

{
        "message": ""%fieldName" is required. Enter and try again.",
        "parameters": {
            "fieldName": "email"
        }
    }

The json that I send is composed as follows:

 {
  "paymentMethod": {
    "method": "banktransfer"
  },
  "billing_address": {
    "email": "jdoe@example.com",
    "region": "New York",
    "region_id": 43,
    "region_code": "NY",
    "country_id": "US",
    "street": [
      "123 Oak Ave"
    ],
    "postcode": "10577",
    "city": "Purchase",
    "telephone": "512-555-1111",
    "firstname": "Jane",
    "lastname": "Doe"
  }
}

plugin development – Update File using Settings API init_form_fields

I have an existing plugin(payment gateway for woocommerce) that goes about generating settings as follows:

In the constructor, It does the following:

 $this->init_form_fields();
 $this->init_settings();

// Calls all the fields
    $this->title                = $this->get_option( 'title' );

In the init_form_fields function:

$this->form_fields = array(
                'enabled' => array(
                    'title'       => __( 'Enable/Disable:', 'plugin-name' ),
                    'type'        => 'checkbox',
                    'label'       => __( 'Enable Payment', 'plugin-name' ),
                    'description' => __( 'Enable this if you want to collect payment via example gateway.', 'plugin-name' ),
                    'default'     => 'yes',
                    'desc_tip'    => true,
                ),
                'img' => array(
                    'title'       => __( 'Upload Image:', 'plugin-name' ),
                    'type'        => 'file',
                    'description' => __( 'Please upload your image', 'plugin-name' ),
                    'default'     => '',
                    'desc_tip'    => true,
                ));}

I am able to create fields such as text, textarea etc, however, It does not save any file for the field ‘img’ anywhere.

All the examples I have seen online use custom html via –
settings_fields(“section”);
do_settings_sections(“demo”);

Is there a way I can change my existing code to just have the image field, or will I have to change my approach?

Node js view realtime request and API performance?

I have installed pm2 and check pm2 describe and pm2 monit but not able to view all request in real-time.

Please suggest me.

How can I view real-time request and API performance of node.js express?

menu – Xamarin masterdetail API 17 Compila mas da erro quando direciono pra uma versão Android abaixo da 5.0

Criei um App do zero, direcionei ele pra uma versão do android 4.2.2, o projeto abre normalmente. Ao implementar o menu Hamburger com a masterdatail e a detailpage o mesmo app quebra, retorna o seguinte erro: Java.Lang.NoSuchMethodError: ‘no method with name=’isAttachedToWindow’ signature='()Z’ in class Landroid/view/ViewGroup;’
Quando rodo ele direcionado pra versão 5.0 em diante, funciona perfeitamente. O problema é que tenho alguns app’s em clientes que usam tablets nesta versão 4.2.2 e a versão compilada em Nov/2019 funcionava perfeitamente, agora que precisei fazer uma atualização, não consigo rodar o app no tablet do cliente. Qualquer ajuda é bem vinda, caso haja algum pacote que me sirva pra carregar esse menu, ou uma maneira alternativa de ter esse menu, sem ser por masterdetail, também me serve.

docker – Kong API Gateway : An invalid response was received from the upstream server

im learning how to use Kong API Gateway and i encountered some problem (im using dockerized version).

usually i use this command to get information through terminal (testing.co.id is not real, i changed it for private reason)

curl --silent --header 'X-SDC-APPLICATION-ID:testing.co.id' --header 'Content-Type: application/json' --request GET http://localhost:5000/user/1

while using sshuttle to open connection to the database

sshuttle --verbose --remote admin@101.101.221.171 11.71.1.1/16 --ssh-cmd "ssh -i secret_key.pem"

i followed these steps from the documentation

  1. registering Flask API as a service in Kong
curl -i -X POST 
--url http://localhost:8001/services/ 
--data 'name=testApi' 
--data 'url=http://192.168.0.7:5000'
  1. Register the route to the service
curl -i -X POST 
--url http://192.168.0.7:8001/services/testApi/routes 
--data 'hosts()=192.168.0.7' 
--data 'paths()=/user' 
--data 'strip_path=false' 
--data 'methods()=GET'
  1. Check the response
curl -i -X GET 
--url http://192.168.0.7:8000/api/user/1 
--header 'Host: 192.168.0.7'

and i keep getting this error

An invalid response was received from the upstream server.

where did i went wrong ?

capturar los marcadores de estaciones por la ruta trazada en la busquedad con la api de google maps java script

como identifico las estaciones marcadas por la ruta escogida

como identifico las estaciones marcadas por la ruta escogida

Twitter Introduces New API V2, Released to Early Endpoints

Twitter has released it’s new API V2 initially to “early endpoints,”

react – Erro no useEffect ao acessar dados da API

Eu tenho o seguinte hook que executa as chamadas a API sem problema, retornando as informações e atualizando os componentes normalmente, mas ele traz alguns erros de conexão no console, creio que esses erros acontecem quando executo a aplicação antes de retornarem as respostas da API, mas como estou usando async await não entendo porque os erros estão ocorrendo, alguém consegue me ajudar com isso:

import { useEffect, useContext } from "react";
import FinancesDataService from "../services/FinancesService";
import { AppContext } from "../components/context/AppContext";

export const useDetails = () => {
  const { state, dispatch } = useContext(AppContext);
  const { selectedPeriod, profit, cost } = state;

  useEffect(() => {
    async function countTransactions() {
      const response = await FinancesDataService.countTransactions(
        selectedPeriod
      );
      dispatch({ type: "setCounter", payload: response.data });
    }
    countTransactions();

    async function getProfit() {
      const response = await FinancesDataService.getProfit(selectedPeriod);
      dispatch({ type: "setProfit", payload: response.data });
    }
    getProfit();

    async function getCost() {
      const response = await FinancesDataService.getCost(selectedPeriod);
      dispatch({ type: "setCost", payload: response.data });
    }
    getCost();

    function calcBalance(profit, cost) {
      return profit - cost;
    }
    dispatch({ type: "setBalance", payload: calcBalance(profit, cost) });
  }, (dispatch, selectedPeriod, cost, profit));

  return {
    counter: state.counter,
    profit: state.profit,
    cost: state.cost,
    balance: state.balance,
  };
};

inserir a descrição da imagem aqui