Skip to content

Commit

Permalink
Add Paycell DCB Payment Method
Browse files Browse the repository at this point in the history
  • Loading branch information
Mustafa Özcan committed Jan 8, 2025
1 parent d59b72b commit 668b43a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
34 changes: 34 additions & 0 deletions samples/payment/InitPaycellDCBApmPayment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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.PaycellDCB,
price: 1.0,
paidPrice: 1.0,
currency: Craftgate.Model.Currency.TRY,
paymentGroup: Craftgate.Model.PaymentGroup.ListingOrSubscription,
conversationId: 'conversationId',
callbackUrl: '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'
}
],
additionalParams: {"paycellGsmNumber": "5305289290"}
};

craftgate.payment().initApmPayment(request)
.then(result => console.info('Paycell DCB Apm init payment successful', result))
.catch(err => console.error('Failed to init Paycell DCB 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 @@ -24,6 +24,7 @@ enum ApmType {
IsPay = 'ISPAY',
Chippin = 'CHIPPIN',
Bizum = 'BIZUM',
PaycellDCB = 'PAYCELLDCB',
Paymob = 'PAYMOB'
}

Expand Down
1 change: 1 addition & 0 deletions src/model/PaymentProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ enum PaymentProvider {
Chippin = 'CHIPPIN',
Paymob = 'PAYMOB',
Bizum = 'BIZUM',
PaycellDCB = 'PAYCELLDCB',
Offline = 'OFFLINE'
}

Expand Down

0 comments on commit 668b43a

Please sign in to comment.