Skip to content

Commit

Permalink
Adds kaspi and KZT currency (#150)
Browse files Browse the repository at this point in the history
* adds pos apm

* refactor
  • Loading branch information
semihshn authored Sep 22, 2023
1 parent 6283a11 commit ddadee1
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 1 deletion.
33 changes: 33 additions & 0 deletions samples/payment/InitKaspiApmPayment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const Craftgate = require('../../dist');

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

const request = {
apmType: Craftgate.Model.ApmType.Kaspi,
price: 1.0,
paidPrice: 1.0,
currency: Craftgate.Model.Currency.KZT,
paymentGroup: Craftgate.Model.PaymentGroup.ListingOrSubscription,
conversationId: '456d1297-908e-4bd6-a13b-4be31a6e47d5',
callbackUrl: 'https://www.your-website.com/craftgate-apm-callback',
items: [
{
name: 'Item 1',
price: 0.4,
externalId: '123d1297-839e-4bd6-a13b-4be31a6e12a8'
},
{
name: 'Item 2',
price: 0.6,
externalId: '789d1297-839e-4bd6-a13b-4be31a6e13f7'
}
]
};

craftgate.payment().initApmPayment(request)
.then(result => console.info('Kaspi Apm init payment successful', result))
.catch(err => console.error('Failed to init Kaspi Apm payment', err));
1 change: 1 addition & 0 deletions src/model/ApmType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum ApmType {
PayPal = 'PAYPAL',
Klarna = 'KLARNA',
Afterpay = 'AFTERPAY',
Kaspi = 'KASPI',
Stripe = 'STRIPE',
FundTransfer = 'FUND_TRANSFER',
CashOnDelivery = 'CASH_ON_DELIVERY'
Expand Down
3 changes: 2 additions & 1 deletion src/model/Currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ enum Currency {
CNY = 'CNY',
AED = 'AED',
IQD = 'IQD',
AZN = 'AZN'
AZN = 'AZN',
KZT = 'KZT'
}

export default Currency;
1 change: 1 addition & 0 deletions src/model/PaymentMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ enum PaymentMethod {
Paypal = 'PAYPAL',
Klarna = 'KLARNA',
Afterpay = 'AFTERPAY',
Kaspi = 'KASPI',
Stripe = 'STRIPE'
}

Expand Down
1 change: 1 addition & 0 deletions src/model/PaymentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ enum PaymentProvider {
Payoneer = 'PAYONEER',
Sodexo = 'SODEXO',
Edenred = 'EDENRED',
Kaspi = 'KASPI',
YkbWorldPay = 'YKB_WORLD_PAY',
ApplePay = 'APPLEPAY',
GooglePay = 'GOOGLEPAY',
Expand Down

0 comments on commit ddadee1

Please sign in to comment.