tpay-com / tpay-php

MIT License
24 stars 27 forks source link

Lack of pack ID in mass payment creation response #2

Closed macieklamberski closed 7 years ago

macieklamberski commented 7 years ago

There's a a bug in tpay\TransactionApi class that prevents from reading ID of the pack created in masspaymentCreate(). According to documentation (api-mass-payment_1.1.pdf, page 3), ID of the created package is located under element called pack_id, but in SDK (https://github.com/tpay-com/tpay-php/blob/master/src/_class_tpay/transactionApi.php#L372) <packId> is used instead.

Changing line 374 to below, fixes this problem.

// Before
static::PACK_ID => Util::findSubstring('/<packId>(.*)<\/packId>/', $res),

// After
static::PACK_ID => Util::findSubstring('/<pack_id>(.*)<\/pack_id>/', $res),
piotrjozwiak commented 7 years ago

That was refactoring mistake. Changes have been merged.