Skip to content

Commit

Permalink
Merge branch 'refs/heads/master' into added-iwallet-apm
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/model/PaymentProvider.ts
  • Loading branch information
beratallahverdi committed Jan 28, 2025
2 parents 1fb3820 + 2cd8037 commit ed2cc44
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
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 = 'PAYCELL_DCB',
Paymob = 'PAYMOB'
}

Expand Down
4 changes: 3 additions & 1 deletion src/model/PaymentMethod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ enum PaymentMethod {
InstantTransfer = 'INSTANT_TRANSFER',
Stripe = 'STRIPE',
Multinet = 'MULTINET',
MultinetGift = 'MULTINET_GIFT'
MultinetGift = 'MULTINET_GIFT',
Bizum = 'BIZUM',
PaycellDCB = 'PAYCELL_DCB'
}

export default PaymentMethod;
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 = 'PAYCELL_DCB',
IWallet = 'IWALLET',
Offline = 'OFFLINE'
}
Expand Down

0 comments on commit ed2cc44

Please sign in to comment.