You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need to download the latest [release](https://github.com/craftgate/craftgate-php-client/releases) and copy to your project. Then, include the bootstrap file as shown below. This file will autoload all the class files into your project.
23
+
You need to download the latest [release](https://github.com/craftgate/craftgate-php-client/releases) and copy to your project. Then, include the autoload file as shown below. This file will autoload all related classes into your project on-demand.
To access the Craftgate API you'll first need to obtain API credentials (e.g. an API key and a secret key). If you don't already have a Craftgate account, you can signup at [https://craftgate.io/](https://craftgate.io)
31
31
32
-
Once you've obtained your API credentials, you can start using Craftgate by instantiating a `Craftgate` with your credentials.
32
+
Once you've obtained your API credentials, you can start using Craftgate by instantiating a `Craftgate\Craftgate` with your credentials.
33
33
34
34
```php
35
-
36
-
$options = new RequestOptions();
37
-
$options->setApiKey('<YOURAPIKEY>');
38
-
$options->setSecretKey('<YOURSECRETKEY>');
39
-
40
-
$craftgate = new Craftgate($options);
41
-
...
42
-
35
+
$craftgate = new \Craftgate\Craftgate(array(
36
+
'apiKey' => '<YOURAPIKEY>',
37
+
'secretKey' => '<YOURSECRETKEY>',
38
+
));
43
39
```
44
40
45
-
By default the Craftgate client connects to the production API servers at `https://api.craftgate.io`. For testing purposes, please use the sandbox URL `https://sandbox-api.craftgate.io` using the .
41
+
By default the Craftgate client connects to the production API servers at `https://api.craftgate.io`. For testing purposes, please use the sandbox URL `https://sandbox-api.craftgate.io`.
In reality, the `Craftgate` class serves as a collection of adapters that integrates with different parts of the API. While the intended usage for most use-cases is to instantiate a `Craftgate` instance (as illustrated in the examples above) and use its adapter accessors (e.g. `payment()`), you can also manually import a certain adapter class and instantiate it.
109
+
In reality, the `Craftgate` class serves as a provider of adapters that integrates with different parts of the API. While the intended usage for most use-cases is to instantiate a `Craftgate` instance (as illustrated in the examples above) and use its adapter initializers (e.g. `payment()`).
119
110
120
111
**Note:** When instantiating an adapter, you can use the same options as you would when instantiating a `Craftgate`
121
112
122
-
For all adapters in the `Craftgate`, their purposes, accessors, as well as direct import paths, refer to the list below:
113
+
All adapters in the `Craftgate` have their purposes and initializers that listed below:
123
114
124
-
| Adapter Name | Purpose |Accessor|
115
+
| Adapter Name | Purpose |Initializer|
125
116
|--------------|---------|----------|
126
117
|`InstallmentAdapter`| Retrieving per-installment pricing information based on installment count or BIN number |`installment()`|
127
118
|`OnboardingAdapter`| Conducting CRUD operations on buyers and sub merchants |`onboarding()`|
0 commit comments