@@ -10,40 +10,38 @@ npm install tikkie-checkout
1010```
1111
1212## Usage
13- ``` javascript
13+ ``` typescript
1414import {TikkieCheckoutClient , TikkieCheckoutConfig } from ' tikkie-checkout' ;
1515
16- (async () => {
17- const config = new TikkieCheckoutConfig (' apiKey' , ' merchantToken' );
18- config .loadPrivateKey (' path_to_key' , ' RS256' );
19-
20- const tikkie = new TikkieCheckoutClient (config);
21-
22- try {
23-
24- const createOrderRequest = await tikkie .createOrder ({
25- referenceId: " some reference" ,
26- shippingCostsInCents: 690 ,
27- discountInCents: 500 ,
28- currency: " EUR" ,
29- expiration: 1800 ,
30- redirectUrl: " https://www.yourdomain.nl/finishorder/1234" ,
31- notificationUrl: " https://www.yourdomain.nl/1234" ,
32- items: [
33- {
34- itemName: " Mobile Phone" ,
35- priceInCents: 50000 ,
36- quantity: 1
37- }]
38- });
39- console .log (createOrderRequest);
40-
41- const getOrderRequest = await tikkie .getOrder (createOrderRequest .orderToken );
42- console .log (getOrderRequest);
43- } catch (err) {
44- console .error (err);
45- }
46- })();
16+ const config = new TikkieCheckoutConfig (' apiKey' , ' merchantToken' );
17+ config .loadPrivateKey (' path_to_key' , ' RS256' );
18+
19+ const tikkie = new TikkieCheckoutClient (config );
20+
21+ try {
22+
23+ const createOrderRequest = await tikkie .createOrder ({
24+ referenceId: " some reference" ,
25+ shippingCostsInCents: 690 ,
26+ discountInCents: 500 ,
27+ currency: " EUR" ,
28+ expiration: 1800 ,
29+ redirectUrl: " https://www.yourdomain.nl/finishorder/1234" ,
30+ notificationUrl: " https://www.yourdomain.nl/1234" ,
31+ items: [
32+ {
33+ itemName: " Mobile Phone" ,
34+ priceInCents: 50000 ,
35+ quantity: 1
36+ }]
37+ });
38+ console .log (createOrderRequest );
39+
40+ const getOrderRequest = await tikkie .getOrder (createOrderRequest .orderToken );
41+ console .log (getOrderRequest );
42+ } catch (err ) {
43+ console .error (err );
44+ }
4745```
4846
4947## Inspiration
0 commit comments