Skip to content

Commit 35a75e7

Browse files
author
Christopher Eteka
committed
Add some docs
1 parent 38e466c commit 35a75e7

1 file changed

Lines changed: 28 additions & 6 deletions

File tree

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,34 @@ The Client comes in 3 flavors:
3131
<version>${VERSION}</version>
3232
</dependency>
3333
```
34-
35-
- Add the following property to you `applications.properties` file
36-
```properties
37-
paystack-client.secret-key=INPUT_YOUR_PAYSTACK_SECRET_KEY_HERE
38-
paystack-client.definition-type=(REACTIVE|NON_REACTIVE) #This property is optional, it defaults to 'NON_REACTIVE' if not specified
39-
```
34+
- Add the following property to your configuration file:
35+
- `applications.properties` file
36+
```properties
37+
paystack-client.secret-key=INPUT_YOUR_PAYSTACK_SECRET_KEY_HERE
38+
paystack-client.definition-type=(REACTIVE|NON_REACTIVE) #This property is optional, it defaults to 'NON_REACTIVE' if not specified
39+
paystack-client.activate-only-clients=apple_pay, customer, plan, transaction #Used to specify only the clients you want to be initialized
40+
```
41+
42+
- `applications.yaml` file
43+
```yaml
44+
paystack-client:
45+
secret-key: INPUT_YOUR_PAYSTACK_SECRET_KEY_HERE
46+
definition-type: (REACTIVE|NON_REACTIVE) #This property is optional, it defaults to 'NON_REACTIVE' if not specified
47+
activate-only-clients: apple_pay, customer, plan, transaction #This is optional, it is used to specify only the clients you want to be initialized
48+
```
49+
> 1. When the property `paystack-client.activate-only-clients` is set, only the clients listed in this array will be instantiated
50+
during autoconfiguration execution, See full list of possible values
51+
[Here](paystack-clients-spring-boot-starter/src/main/java/com/chrisworks/paystackclient/SupportedClient.java).
52+
This means that only these listed webclient bean(s) are available in the application's
53+
context to be injected. By listing clients you're interested in, you loose the power to inject the
54+
`SimplePaystackClient`/`ReactivePaystackClient` which is an aggregation of all the individual webclient beans in the context.
55+
56+
57+
> 2. The property `paystack-client.definition-type` controls what kind (reactive or non-reactive) of webclient bean will be initialized during autoconfiguration.
58+
Hence, it determines the location of the bean(s) (the packages holding the beans) you can use (inject) within your application logic. When the value is set to `REACTIVE`,
59+
then you can inject clients from the package `com.chrisworks.paystackclient.definitions.reactive.*`, also the aggregate bean
60+
`ReactivePaystackClient` will be available to you. In the case where the property is set to `NON_REACTIVE`, then you can inject
61+
clients from the package `com.chrisworks.paystackclient.definitions.simple.*`, also `SimplePaystackClient` bean will be available.
4062

4163
- Usage
4264
```java

0 commit comments

Comments
 (0)