Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes sample #93

Merged
merged 1 commit into from
Apr 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions samples/payByLink/CreateProduct.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const Craftgate = require('../../dist');
const { Currency } = require("../../dist/model");

const craftgate = new Craftgate.Client({
apiKey: 'api-key',
Expand All @@ -11,7 +10,7 @@ const request = {
name: "A new Product",
channel: "API",
price: 10,
currency: Currency.TRY,
currency: Craftgate.Model.Currency.TRY,
enabledInstallments: [1,2,3,6]
};

Expand Down
13 changes: 6 additions & 7 deletions samples/payByLink/DeleteProduct.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const Craftgate = require('../../dist');
const { Currency } = require("../../dist/model");
const Craftgate = require("../../dist");

const craftgate = new Craftgate.Client({
apiKey: 'api-key',
secretKey: 'secret-key',
baseUrl: 'https://sandbox-api.craftgate.io'
apiKey: "api-key",
secretKey: "secret-key",
baseUrl: "https://sandbox-api.craftgate.io"
});

craftgate.payByLink().deleteProduct(1)
.then(result => console.info('Product successfully deleted'))
.catch(err => console.error('Delete product failed', err));
.then(result => console.info("Product successfully deleted"))
.catch(err => console.error("Delete product failed", err));
13 changes: 6 additions & 7 deletions samples/payByLink/RetrieveProduct.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
const Craftgate = require('../../dist');
const { Currency } = require("../../dist/model");
const Craftgate = require("../../dist");

const craftgate = new Craftgate.Client({
apiKey: 'api-key',
secretKey: 'secret-key',
baseUrl: 'https://sandbox-api.craftgate.io'
apiKey: "api-key",
secretKey: "secret-key",
baseUrl: "https://sandbox-api.craftgate.io"
});

craftgate.payByLink().retrieveProduct(1)
.then(result => console.info('Product successfully retrieved', result))
.catch(err => console.error('Retrieve product failed', err));
.then(result => console.info("Product successfully retrieved", result))
.catch(err => console.error("Retrieve product failed", err));
3 changes: 1 addition & 2 deletions samples/payByLink/SearchProducts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const Craftgate = require('../../dist');
const { Currency, Status } = require("../../dist/model");

const craftgate = new Craftgate.Client({
apiKey: 'api-key',
Expand All @@ -10,7 +9,7 @@ const craftgate = new Craftgate.Client({
const request = {
name: "A new Product",
channel: "API",
currency: Currency.TRY
currency: Craftgate.Model.Currency.TRY
};

craftgate.payByLink().searchProducts(request)
Expand Down
5 changes: 2 additions & 3 deletions samples/payByLink/UpdateProduct.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const Craftgate = require('../../dist');
const { Currency, Status } = require("../../dist/model");

const craftgate = new Craftgate.Client({
apiKey: 'api-key',
Expand All @@ -8,11 +7,11 @@ const craftgate = new Craftgate.Client({
});

const request = {
status: Status.Active,
status: Craftgate.Model.Status.Active,
name: "A new Product - Version 2",
channel: "API",
price: 10,
currency: Currency.TRY,
currency: Craftgate.Model.Currency.TRY,
enabledInstallments: [1,2,3]
};

Expand Down