v0.1.0
woocommerce_api
WooCommerce API(널 안전)와 상호 작용하기 위한 패키지입니다.
64좋아요 5730일 다운로드110Pub 점수
AndroidiOSmacOSWindowsLinux
WooCommerce REST API와 상호 작용하기 위한 Dart 패키지입니다.
아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A dart package to interact with the WooCommerce API (now with null-safety). It uses OAuth1.0a behind the scenes to generate the signature and URL string for http based websites. It then makes calls and returns the data back to the calling function asynchronously.
Example code and preview
Future getProducts() async {
// Initialize the API
WooCommerceAPI wooCommerceAPI = WooCommerceAPI(
url: "https://www.yourwebsite.com",
consumerKey: "ck_your_consumer_key",
consumerSecret: "cs_your_consumer_secret");
// Get data using the "products" endpoint
var products = await wooCommerceAPI.getAsync("products");
return products;
}
You can find a full example here
Future createCustomer() async {
try {
var response = await wooCommerceAPI.postAsync(
"customers",
{
"email": 's@c.com',
"password": "123",
"billing": {
"first_name": "Samarth",
}
},
);
print(response); // JSON Object with response
} catch (e) {
print(e);
}
}