-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from marketinf/develop
added threeds pre auth
- Loading branch information
Showing
5 changed files
with
158 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
'use strict'; | ||
|
||
var BaseRequest = require('./BaseRequest'), | ||
util = require('util'), | ||
Payment = require('./model/Payment'); | ||
|
||
function CreateThreeDSInitializePreAuthRequest(request) { | ||
|
||
var payment = Payment.body(request); | ||
payment['callbackUrl'] = request["callbackUrl"]; | ||
BaseRequest.call(this, payment); | ||
} | ||
|
||
util.inherits(CreateThreeDSInitializePreAuthRequest, BaseRequest); | ||
|
||
module.exports = CreateThreeDSInitializePreAuthRequest; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
var IyzipayResource = require('../IyzipayResource'); | ||
|
||
function PaymentPreAuthThreeDSInitialize() { | ||
this._config = arguments[0]; | ||
this._api = { | ||
create: { | ||
path: '/payment/iyzipos/initialize3ds/preauth/ecom', | ||
method: 'POST', | ||
requestModel: 'CreateThreeDSInitializePreAuthRequest' | ||
} | ||
}; | ||
} | ||
|
||
PaymentPreAuthThreeDSInitialize.prototype = new IyzipayResource(); | ||
|
||
module.exports = PaymentPreAuthThreeDSInitialize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,8 @@ | |
], | ||
"author": "iyzico <[email protected]> (https://iyzico.com/)", | ||
"contributors": [ | ||
"Huseyin Babal <[email protected]>" | ||
"Huseyin Babal <[email protected]>", | ||
"Demircan Celebi <[email protected]>" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1041,6 +1041,95 @@ describe('Iyzipay API Test', function () { | |
}); | ||
}); | ||
|
||
it('should initialize threeds payment creation with physical and virtual items for marketplace', function (done) { | ||
var paymentPreAuthThreeDSInitializeRequest = { | ||
locale: Iyzipay.LOCALE.TR, | ||
conversationId: '123456789', | ||
price: '1.0', | ||
paidPrice: '1.1', | ||
installment: '1', | ||
basketId: 'B67832', | ||
paymentGroup: Iyzipay.PAYMENT_GROUP.PRODUCT, | ||
paymentChannel: Iyzipay.PAYMENT_CHANNEL.WEB, | ||
callbackUrl: 'https://www.merchant.com/callback', | ||
paymentCard: { | ||
cardHolderName: 'John Doe', | ||
cardNumber: '5528790000000008', | ||
expireMonth: '12', | ||
expireYear: '2030', | ||
cvc: '123', | ||
registerCard: '0' | ||
}, | ||
buyer: { | ||
id: 'BY789', | ||
name: 'John', | ||
surname: 'Doe', | ||
gsmNumber: '+905350000000', | ||
email: '[email protected]', | ||
identityNumber: '74300864791', | ||
lastLoginDate: '2015-10-05 12:43:35', | ||
registrationDate: '2013-04-21 15:12:09', | ||
registrationAddress: 'Address', | ||
ip: '85.34.78.112', | ||
city: 'Istanbul', | ||
country: 'Turkey', | ||
zipCode: '34732' | ||
}, | ||
shippingAddress: { | ||
contactName: 'Jane Doe', | ||
city: 'Istanbul', | ||
country: 'Turkey', | ||
address: 'Address', | ||
zipCode: '34742' | ||
}, | ||
billingAddress: { | ||
contactName: 'Jane Doe', | ||
city: 'Istanbul', | ||
country: 'Turkey', | ||
address: 'Address', | ||
zipCode: '34742' | ||
}, | ||
basketItems: [ | ||
{ | ||
id: 'BI101', | ||
name: 'Binocular', | ||
category1: 'Collectibles', | ||
category2: 'Accessories', | ||
itemType: Iyzipay.BASKET_ITEM_TYPE.PHYSICAL, | ||
price: '0.3', | ||
subMerchantKey: 'sub merchant key', | ||
subMerchantPrice: '0.27' | ||
}, | ||
{ | ||
id: 'BI102', | ||
name: 'Game code', | ||
category1: 'Game', | ||
category2: 'Online Game Items', | ||
itemType: Iyzipay.BASKET_ITEM_TYPE.VIRTUAL, | ||
price: '0.5', | ||
subMerchantKey: 'sub merchant key', | ||
subMerchantPrice: '0.42' | ||
}, | ||
{ | ||
id: 'BI103', | ||
name: 'Usb', | ||
category1: 'Electronics', | ||
category2: 'Usb / Cable', | ||
itemType: Iyzipay.BASKET_ITEM_TYPE.PHYSICAL, | ||
price: '0.2', | ||
subMerchantKey: 'sub merchant key', | ||
subMerchantPrice: '0.18' | ||
} | ||
] | ||
}; | ||
|
||
iyzipay.paymentPreAuthThreeDSInitialize.create(paymentPreAuthThreeDSInitializeRequest, function (err, result) { | ||
console.log(err, result); | ||
done(); | ||
}); | ||
}); | ||
|
||
|
||
it('should retrieve payment', function (done) { | ||
iyzipay.paymentPreAuth.retrieve({ | ||
locale: Iyzipay.LOCALE.TR, | ||
|