Update README.md
This commit is contained in:
parent
9732f236ef
commit
2548979f0e
18
README.md
18
README.md
@ -15,12 +15,12 @@ Please note that files are still being moved around - the project should be stab
|
|||||||
Step 1. Add the JitPack repository to your build file
|
Step 1. Add the JitPack repository to your build file
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<repositories>
|
<repositories>
|
||||||
<repository>
|
<repository>
|
||||||
<id>jitpack.io</id>
|
<id>jitpack.io</id>
|
||||||
<url>https://jitpack.io</url>
|
<url>https://jitpack.io</url>
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
```
|
```
|
||||||
|
|
||||||
Step 2. Add the dependency
|
Step 2. Add the dependency
|
||||||
@ -29,26 +29,26 @@ Step 2. Add the dependency
|
|||||||
<groupId>com.github.gilokimu</groupId>
|
<groupId>com.github.gilokimu</groupId>
|
||||||
<artifactId>woodroid</artifactId>
|
<artifactId>woodroid</artifactId>
|
||||||
<version>0.1.0</version>
|
<version>0.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Gradle dependency:
|
### Gradle dependency:
|
||||||
Step 1. Add the JitPack repository to your build file
|
Step 1. Add the JitPack repository to your build file
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
allprojects {
|
allprojects {
|
||||||
repositories {
|
repositories {
|
||||||
...
|
...
|
||||||
maven { url 'https://jitpack.io' }
|
maven { url 'https://jitpack.io' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Step 2. Add the dependency
|
Step 2. Add the dependency
|
||||||
```xml
|
```xml
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'com.github.gilokimu:woodroid:0.1.0'
|
implementation 'com.github.gilokimu:woodroid:0.1.0'
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
## Getting started
|
## Getting started
|
||||||
@ -63,7 +63,7 @@ Check out the WooCommerce API endpoints and data that can be manipulated in <htt
|
|||||||
Setup for the new WP REST API integration (WooCommerce 2.6 or later):
|
Setup for the new WP REST API integration (WooCommerce 2.6 or later):
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
val woocommerce = Woocommerce.Builder()
|
val woocommerce = Woocommerce.Builder()
|
||||||
.setSiteUrl("http://example.com")
|
.setSiteUrl("http://example.com")
|
||||||
.setApiVersion(Woocommerce.API_V2)
|
.setApiVersion(Woocommerce.API_V2)
|
||||||
.setConsumerKey("ck_XXXXX")
|
.setConsumerKey("ck_XXXXX")
|
||||||
@ -75,7 +75,7 @@ Setup for the new WP REST API integration (WooCommerce 2.6 or later):
|
|||||||
Getting products example
|
Getting products example
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
woocommerce.ProductRepository().products().enqueue(object : Callback<List<Product>> {
|
woocommerce.ProductRepository().products().enqueue(object : Callback<List<Product>> {
|
||||||
override fun onResponse(call: Call<List<Product>>, response: Response<List<Product>>) {
|
override fun onResponse(call: Call<List<Product>>, response: Response<List<Product>>) {
|
||||||
val productsResponse = response.body()
|
val productsResponse = response.body()
|
||||||
for (product in productsResponse!!) {
|
for (product in productsResponse!!) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user