lemonwaysas / php-client-directkit-xml

PHP example calling DirectKit Xml API with simple HTTP request
http://documentation.lemonway.fr/
6 stars 17 forks source link

GetMoneyInTransDetails : CardType is not returned #25

Closed Guinome closed 7 years ago

Guinome commented 7 years ago

Hi,

I wan't to save the authNumber, cardNumber & cardType when an order is success.

$LWapi = $this->container->get('lemonway_sdk.api');
$res = $LWapi->GetMoneyInTransDetails(array('somearguments'));
//check for errors
...
$current = $res->operations[0];
if ((string)$current->STATUS == Operation::STATUS_SUCCES) {
    $order->setAuthNumber($current->EXTRA->AUTH)
          ->setCardNumber($current->EXTRA->NUM)
          ->setCardType($current->EXTRA->TYPE);
    $em->persist($order);
}
$entityManager->flush();

The authNumber and CardNumber is well saved, but the $current->EXTRA->TYPE is an empty string.

Any clue ?

pham-dat commented 7 years ago

Actually, it has to be EXTRA->TYP instead of TYPE. Thank you. We updated the SDK.

duongphuhiep commented 7 years ago

hi,

it is a little bit out of subject, but just for information

we recommend our new partners to use directkitjson2 instead.

https://github.com/lemonwaysas/php-client-directkit-json2

it will simplify your codes, enhance the network traffic, and keep you away from bugs like this one.

Anyway we keep support, and fix the SDK for old customers.

kind regards