Unnoficial go version of Rede's API.
This repository contains the basic methods to use the Rede's API.
Add this line to the imports of your project:
import github.com/lusantisuper/api-rede-golang
Edit the login.json file and add your keys or use the method: login.ReadLogin(PV, IntegrationKey)
The payment struct contains all data needed to make the payment request.
struct structs.Payment
Use the method Pay to make the payment:
func Pay(r *structs.Payment, login *login.Login, isRealTransaction bool) (*structs,Response, error)
You need to pass the True value to make a real payment or false if you are only testing. The function returns a error if the payments didn't work, else return nil.
Use the method TestCard to test if a card is valid:
func TestCard(r *structs.Payment, login *login.Login, isRealTransaction bool) (*structs.Response, error)
You need to pass the True value to make a real card test or false if you are only testing. The function returns a error if the test didn't work, else return nil.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.