get_net
package to do payments using api getnet
getting started
this project is a starting point for a dart
package,
a library module containing code that can be shared easily across
multiple flutter or dart projects.
for help getting started with flutter, view the getnet
online documentation, which offers tutorials,
samples, guidance on mobile development, and a full api reference.
usage
you will neede create 3 dart/class files
first
create a constant.dart file to put params that getnet will need
all below params you will find here: https://developers.getnet.com.br/login(create a free account)
const string myurlgetnetapi = “url getnet api”;
const string mysellerid = “your seller id”;
const myclientid = “your client id”;
const myclientsecret = “your client secret”;
const myauthorizationbasic = “concat the client_id, followed by “:” (two dots) plus client_secret, converted to base64″
second
lets create a custom dio that will use a interceptor
class customdiogetnet {
dio dio = dio();
customdiogetnet() {
dio.options = baseoptions(
connecttimeout: 300000,
receivetimeout: 300000,
baseurl: myurlgetnetapi);
dio.interceptors.add(getnetinterceptor());
}
}
last create a interceptor
this interceptor will put the token saved in login in your request.
options.headers["authorization"] = "bearer $accesstoken";
how to use it
in this video i will show you hoe to use this lib(language brazilian portuguese)
link: https://youtu.be/l3vla9l7wsc
Comments are closed.