amabnl / amadeus-ws-client

PHP Amadeus SOAP Web Service client library
Apache License 2.0
178 stars 191 forks source link

Add support for multiple pax types in MasterPricerTravelBoard #432

Closed therealartz closed 3 years ago

therealartz commented 3 years ago

Need an ability to define several pax types at once:

<ns1:paxReference>
    <ns1:ptc>ADT</ns1:ptc>
    <ns1:ptc>IIT</ns1:ptc>
    <ns1:traveller>
        <ns1:ref>1</ns1:ref>
    </ns1:traveller>
    <ns1:traveller>
        <ns1:ref>2</ns1:ref>
    </ns1:traveller>
</ns1:paxReference>

Tested with PRD env.

coveralls commented 3 years ago

Coverage Status

Coverage increased (+9.0e-05%) to 99.851% when pulling d4fcc66ff1a332d99c45be1f99b5d33cca6215ec on therealartz:master into 2ea2952bddf91aa80ff402e6a72f2eba9538919f on amabnl:master.

DerMika commented 3 years ago

So how does this work? In your test, you add "count = 1" and 2 pax types, and then it adds one pax type of each? Then the "count" property is no longer named very appropriately.

It's not very intuitive to me, but ok. If you add a sample to the docs and explain how to use it, we can merge it.

therealartz commented 3 years ago

@DerMika Amadeus returns us some specific private fares which is not getting returned by just asking unifares.

Of course I don't know how it will behave if ask to return ADT and CHD at once but when asking for this combination it works as expected.

However I don't see it strange since $ptc property already is mapped as an array. $this->ptc[] = $passengerType; it always was. Now we can pass not only one item there.

Added the sample.

DerMika commented 3 years ago

Allright, as long as it's in the docs, I'm fine with this change :)