morukele / paystack-rs

A Rust wrapper for the Paystack API
https://crates.io/crates/paystack-rs
MIT License
14 stars 5 forks source link

Write test for transaction splits endpoint #17

Closed morukele closed 11 months ago

morukele commented 1 year ago

The goal is to write a series of these for the transaction splits endpoint.

The goal is to write tests to check that the proper behavior happens when the right data is sent to the endpoint and when the wrong data is sent to the endpoint.

Lilit0x commented 12 months ago

Hi @morukele , I'll like to work on these. I'll come to outline how I'll accomplish it. Thanks

morukele commented 12 months ago

Hi @Lilit0x Feel free to take on the issue. The goal is to test this route.

Feel free to look at the other tests for inspiration.

Lilit0x commented 12 months ago

Hi @morukele , I couldn't find the bank code for Kuda Bank for testing purposes. And I think it'll be easier if the test .env file be added to the docs or repo since they are test credentials from Paystack

morukele commented 12 months ago

Hi @Lilit0x, So I did not put the .env files because the variables inside are tied to my integration.

I have added a .env.example

I can upload the test key, which is fine but the bank account at the moment is not a test one. I will check the paystack docs for a test bank account and then add it to the .env file and add it to the main

Lilit0x commented 12 months ago

Ohh, okayy. Any test key can be used and I saw that bank is a Kuda bank. I'll just want the Kuda bank code as I couldn't find it in the list of banks API. Thanks

morukele commented 12 months ago

Sure, here is the Kuda Bank Code: 50211.

I have updated the test functions to take note of the bank name in the .env file. This way you don't need to hardcode it. For the BANK_NAME if it is more than one word, put it in quotes.

morukele commented 11 months ago

@Lilit0x

I was able to get some test credentials from the paystack team.

BANK_ACCOUNT=0000000000
BANK_CODE=058
BANK_NAME='Guaranty Trust Bank'

Aside the API key, you can use these for the other fields. I will add them to the .env.example file in the next commit.

morukele commented 11 months ago

Thanks, @Lilit0x for fixing this issue!