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 a400 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 a400 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;
}
?>
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP