Weble / ZohoBooksApi

40 stars 39 forks source link

create a refund #21

Closed ghost closed 4 years ago

ghost commented 4 years ago

Hello, I would like to create a refund from a payment (and put amount_applied to 0 for all the invoice).

What is the syntax?

$zohoBooks->customerpayments->refunds->create($key, $keyvalues); ?

Thanks

Skullbock commented 4 years ago
$zohoBooks->customerpayments->refunds->create([
            'key'  => 'value',
            'key2' => 'value2'
        ]);

On Fri, Oct 18, 2019 at 5:18 PM tsokandbaz notifications@github.com wrote:

Hello, I would like to create a refund from a payment (and put amount_applied to 0 for all the invoice).

What is the syntax?

$zohoBooks->customerpayments->refunds->create($key, $keyvalues); ?

Thanks

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Weble/ZohoBooksApi/issues/21?email_source=notifications&email_token=AAINRU5GLTVJCFDOOUD7QWTQPHHTRA5CNFSM4JCI2WVKYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HSY62OA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINRU26F45SQ2RHX7G57UTQPHHTRANCNFSM4JCI2WVA .

-- [image: Logo Weble] Daniele Rosario

CTO Weble Srl Via Enrico Fermi, 265 36100 Vicenza ufficio: +39 0444 1454934 <003904441454934> mobile: +39 3283017134 <00393283017134> weble.it https://www.weble.it/ https://www.facebook.com/pages/Weble/110077192371908?fref=ts https://twitter.com/Webleit?lang=it https://www.linkedin.com/company/2470613?trk=tyah&trkInfo=clickedVertical%3Acompany%2Cidx%3A2-2-7%2CtarId%3A1432717146425%2Ctas%3Aweble https://www.instagram.com/weble.it/

ghost commented 4 years ago

Sorry to annoy you, but i am not able to create the refund for a payment. Can you please help me?

$payment = $zohoBooks->customerpayments->get($key);

$keyvaluesR = array(); $keyvaluesR['customer_payment_id'] = $key; $keyvaluesR['date'] = '2019-10-01'; $keyvaluesR['amount'] = $payment->amount; $keyvaluesR['from_account_id'] = $payment->account_id; $keyvaluesR['description'] = 'description';

$zohoBooks->customerpayments->refunds->create($keyvaluesR);

==> Fatal error: Uncaught Webleit\ZohoBooksApi\Exceptions\ErrorResponseException: Response from Zoho is not success. Message: Invalid URL Passed in C:\xampp\vendor\webleit\zohobooksapi\src\Client.php:314 Stack trace:

0 C:\xampp\vendor\webleit\zohobooksapi\src\Client.php(193): Webleit\ZohoBooksApi\Client->processResult(Object(GuzzleHttp\Psr7\Response))

1 C:\xampp\vendor\webleit\zohobooksapi\src\Modules\Module.php(97): Webleit\ZohoBooksApi\Client->post('https://books.z...', NULL, Array, Array)

2 C:\xampp\htdocs\gocardless\006_processingEvents.php(86): Webleit\ZohoBooksApi\Modules\Module->create(Array)

3 C:\xampp\htdocs\gocardless\006_processingEvents.php(117): process_payment_event(Object(GoCardlessPro\Resources\Event), Object(Webleit\ZohoBooksApi\ZohoBooks))

4 {main}

thrown in C:\xampp\vendor\webleit\zohobooksapi\src\Client.php on line 314

Skullbock commented 4 years ago

Hi, i'm sorry but i can't debug this right now. My suggestion is to dump what url gets created by this module, and check that against the api docs of zoho books.

If you can also send PR to fix that, would be awesome! Daniele

On Mon, Oct 21, 2019 at 10:44 AM tsokandbaz notifications@github.com wrote:

Sorry to annoy you, but i am not able to create the refund for a payment. Can you please help me?

$payment = $zohoBooks->customerpayments->get($key);

$keyvaluesR = array(); $keyvaluesR['customer_payment_id'] = $key; $keyvaluesR['date'] = '2019-10-01'; $keyvaluesR['amount'] = $payment->amount; $keyvaluesR['from_account_id'] = $payment->account_id; $keyvaluesR['description'] = 'description';

$zohoBooks->customerpayments->refunds->create($keyvaluesR);

==> Fatal error: Uncaught Webleit\ZohoBooksApi\Exceptions\ErrorResponseException: Response from Zoho is not success. Message: Invalid URL Passed in C:\xampp\vendor\webleit\zohobooksapi\src\Client.php:314 Stack trace:

0 C:\xampp\vendor\webleit\zohobooksapi\src\Client.php(193):

Webleit\ZohoBooksApi\Client->processResult(Object(GuzzleHttp\Psr7\Response))

1 https://github.com/Weble/ZohoBooksApi/pull/1

C:\xampp\vendor\webleit\zohobooksapi\src\Modules\Module.php(97): Webleit\ZohoBooksApi\Client->post('https://books.z...', NULL, Array, Array)

2 https://github.com/Weble/ZohoBooksApi/issues/2

C:\xampp\htdocs\gocardless\006_processingEvents.php(86): Webleit\ZohoBooksApi\Modules\Module->create(Array)

3 https://github.com/Weble/ZohoBooksApi/pull/3

C:\xampp\htdocs\gocardless\006_processingEvents.php(117): process_payment_event(Object(GoCardlessPro\Resources\Event), Object(Webleit\ZohoBooksApi\ZohoBooks))

4 https://github.com/Weble/ZohoBooksApi/issues/4 {main}

thrown in C:\xampp\vendor\webleit\zohobooksapi\src\Client.php on line 314

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/Weble/ZohoBooksApi/issues/21?email_source=notifications&email_token=AAINRU4HV5FONTC2KPBJNITQPVTVRA5CNFSM4JCI2WVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBZRM6I#issuecomment-544413305, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAINRU2JQRNZS6D7JEU7X7LQPVTVRANCNFSM4JCI2WVA .

-- [image: Logo Weble] Daniele Rosario

CTO Weble Srl Via Enrico Fermi, 265 36100 Vicenza ufficio: +39 0444 1454934 <003904441454934> mobile: +39 3283017134 <00393283017134> weble.it https://www.weble.it/ https://www.facebook.com/pages/Weble/110077192371908?fref=ts https://twitter.com/Webleit?lang=it https://www.linkedin.com/company/2470613?trk=tyah&trkInfo=clickedVertical%3Acompany%2Cidx%3A2-2-7%2CtarId%3A1432717146425%2Ctas%3Aweble https://www.instagram.com/weble.it/