killbill / killbill-client-php

PHP client library for Kill Bill
https://killbill.io
25 stars 30 forks source link

Issue in PHP client #69

Open KBbitsP opened 11 months ago

KBbitsP commented 11 months ago

Issue: The endpoint https://killbill.github.io/slate/payment.html#capture-an-existing-authorization-using-paymentid errors out in PHP client, the chargeback reversal is correctly recorded though.

Code Snippet :

$apiInstance = $client->getPaymentApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$paymentId = 'ded80305-5096-44e0-acd1-df97e6323858';
$transactionExternalKey = 'dd7ce7b0-c4a7-4ca2-84b5-80d0ae84c884';

$paymentTransactionBody = new PaymentTransaction();

$paymentTransactionBody->setPaymentId($paymentId);
$paymentTransactionBody->setTransactionExternalKey($transactionExternalKey);

$apiInstance->chargebackReversalPayment($paymentTransactionBody,$xKillbillCreatedBy,$paymentId,$xKillbillReason,$xKillbillComment) ;

Error in the client :

PHP Fatal error:  Uncaught Killbill\Client\Swagger\ApiException: [402] Error connecting to the API (http://localhost:8080/1.0/kb/payments/ded80305-5096-44e0-acd1-df97e6323858/chargebackReversals) in H:\GitHub\killbill\master\killbill-client-php\lib\Api\PaymentApi.php:7965
Stack trace:
#0 H:\GitHub\killbill\master\killbill-client-php\lib\Api\PaymentApi.php(1860): Killbill\Client\Swagger\Api\PaymentApi->handleResponse()
#1 H:\GitHub\killbill\master\killbill-client-php\lib\Api\PaymentApi.php(1821): Killbill\Client\Swagger\Api\PaymentApi->chargebackReversalPaymentWithHttpInfo()
#2 H:\GitHub\killbill\master\killbill-client-php\test\getTenantTest.php(32): Killbill\Client\Swagger\Api\PaymentApi->chargebackReversalPayment()
#3 {main}
  thrown in H:\GitHub\killbill\master\killbill-client-php\lib\Api\PaymentApi.php on line 7965
KBbitsP commented 11 months ago

The same issue exists for this endpoint too : https://killbill.github.io/slate/payment.html#record-a-chargeback-reversal-using-paymentexternalkey

Code Snippet:

$apiInstance = $client->getPaymentApi();

$xKillbillCreatedBy = "user";
$xKillbillReason = "reason";
$xKillbillComment = "comment";

$paymentId = '20ff8016-5ca3-486b-9dab-a7253074a933';
$transactionExternalKey = '7bf3e12a-cf24-4cdc-9ec2-9c0b319cb082';

$paymentTransactionBody = new PaymentTransaction();
$paymentTransactionBody->setPaymentExternalKey('pau8thOctExtKey7');

$paymentTransactionBody->setTransactionExternalKey($transactionExternalKey);

$apiInstance->chargebackReversalPaymentByExternalKey($paymentTransactionBody,$xKillbillCreatedBy,$xKillbillReason,$xKillbillComment) ;