CashOut not working using nodejs sdk

Screenshot 2023-09-01 at 11.23.14
Hello, am having an issue while making a cashout request using nodejs sdk, am getting an environment is not defined error yet am passing development as the environment in the request.

Here is my request:
const result = await Paypack.cashout({
number: phone,
amount: amount,
environment: “development”,
});

Hello,
I found the bug causing this and published a new version.
You will need to update the paypack-js package and make sure the version is >= 0.1.4

Noted,Let me try it.

The issue is now fixed, even though the lastest paypack-js package version is 0.1.4 , I could be able to upgrade to 0.1.5

One last thing, @shema can you please guide me on how I can use Webhooks using node sdk am using nest to build my application and I checked the documentation but it does not provide much information for someone who is using Webhooks for the first time.
Any help would be highly appreciated. Thank you.

My bad I meant to update to v0.1.4

1 Like

Currently the SDK doesn’t handle webhooks, you have to process them on your system.

To summarize what is explained in more details here:

You provide an endpoint from your system which paypack call with a payload.

In your system you will need to first check the signature to verify that the webhook is coming from us and then perform your logic like updating the transaction status from your system.

@shema does that means I will have to move from using the SDK and do it the other way for both cashIn and CashOut to be able to handle webhooks? or I can continue my current implementation and only provide an endpoint from my system which paypack will call with a payload?

No you can still use the SDK, but webhook processing is not handled by the SDK you have to implement it yourself.

Ok, Thanks for the help let me try it.