AnswerBun.com

Exception when calling AllApi->salePost

Stack Overflow en español Asked by gonzalovega7 on July 31, 2020

Me pidieron que haga un ejemplo de una Venta con un cliente generado con un contrato Swagger. A la hora de correr mi ejemplo, me sale este error:

  • Description: Se debe realizar una prueba de la realización de una Compra *——————————————————————————————————————————————————————— Exception when calling AllApi->salePost: [400] Client error: POST https://testcodi.multipay.mx:30801/Payments/Authorize/5.3.0/Sale resulted in a 400 Bad Request response: {"CardReadModeResponse":{"ResponseAction":"Refuse","ResponseCode":"4006","ResponseMessage":"Tipo de operacion no soporta (truncated…) Exception when calling PaymentApi->authorizeSalePost: [400] Client error: POST https://testcodi.multipay.mx:30801/Payments/Authorize/5.3.0/AuthorizeSale resulted in a 400 Bad Request response: {"localContextMessageIDResponse":{"ResponseAction":"Refuse","ResponseCode":"4006","ResponseMessage":"Tipo de operacion n (truncated…)

Este es mi código:

<?php 


      require_once('SwaggerClient-php/vendor/autoload.php');
      //require_once('SwaggerClient-php/lib/Model/Sale.php');
      require_once('SwaggerClient-php/lib/Model/SaleResponse.php');

      $apiInstance = new SwaggerClientApiPaymentApi(
      new GuzzleHttpClient()
      );

      $body = new SwaggerClientModelSale();


      $body->setCardReadMode('B');
      $body->setCardNumber('4540245431234563126');
      $body->setCardExp('1120');
      $body->setSecurityCode('333');
      $body->setAmount(5000);
      $body->setCompanyIdentification('2456287');
      $body->setSystemIdentification('0');
      $body->setBranchIdentification('5');
      $body->setPOSIdentification('1');
      $body->setReadingDeviceType('PinpadVx820Terminal');
      $body->setFacilityPayments(12);

      try {
         $result = $apiInstance->salePost($body);
         print_r($result);
      } catch (Exception $e) {
          echo 'Exception when calling AllApi->salePost: ', $e->getMessage(), PHP_EOL;
      }


       $transaction = new SwaggerClientModelSaleResponse();

       $authorize_sale = new SwaggerClientModelAuthorizeSale();
        try {
           $result = $apiInstance->authorizeSalePost($authorize_sale);
           print_r($result);
        } catch (Exception $e) {
           echo 'Exception when calling PaymentApi->authorizeSalePost: ', $e->getMessage(), 
            PHP_EOL;
           }

       ?>

Add your own answers!

Related Questions

Mostrar y ocultar texto en un Button Tkinter

1  Asked on December 27, 2020 by juan-j-mart

     

Detectar si la pagina esta abierta en otras pestañas con js

1  Asked on December 27, 2020 by julian-baltan

       

Codificar string en javascript

0  Asked on December 27, 2020 by juan

 

GIF como fondo de pantalla JFrame Java

2  Asked on December 26, 2020 by ivan-garcia-ballesteros

     

No puedo coencatarme con la bd

1  Asked on December 26, 2020

   

Filtrar coleccion de mongo por datos de un arreglo

1  Asked on December 26, 2020 by alejandro-castellanos

         

Intento ejecutar e programa pero me da error en PRINTF, no se porque

1  Asked on December 26, 2020 by benjamin-veras

   

Error 1822: Failed to Add foreign key constraint Missing index for constraint

2  Asked on December 25, 2020 by adrian-leon-ortega

   

Error con el campo manytomany Django

1  Asked on December 25, 2020 by nicolas-rivera

       

Tabla bidimesional

1  Asked on December 24, 2020 by joan

 

Segfault en struct sockaddr_in c++

0  Asked on December 24, 2020 by frijolito

     

cerrar de un navegador la session si se abrio en otro php js

0  Asked on December 24, 2020 by user161479

       

¿Cómo obtener los días de un timestamp? – Postgresql

1  Asked on December 24, 2020 by leonidas

 

Agrupar y limitar tickets con PHP

0  Asked on December 23, 2020 by sebastian

   

¿Cómo separar un String con una ecuación algebraica?

1  Asked on December 23, 2020 by gerardo-soto

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir