<|start_filename|>lib/requests/CreateSubscriptionCheckoutFormInitRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    SubscriptionCustomer = require('./model/SubscriptionCustomer');

function CreateSubscriptionCheckoutFormInitRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        callbackUrl: request['callbackUrl'],
        customer: SubscriptionCustomer.body(request["customer"]),
        pricingPlanReferenceCode: request['pricingPlanReferenceCode'],
        subscriptionInitialStatus: request['subscriptionInitialStatus']
    });
}

util.inherits(CreateSubscriptionCheckoutFormInitRequest, BaseRequest);

module.exports = CreateSubscriptionCheckoutFormInitRequest;


<|start_filename|>lib/requests/SearchSubscriptionRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function SearchSubscriptionRequest(request) {
    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        page: request["page"],
        count: request["count"],
        subscriptionReferenceCode: request['subscriptionReferenceCode'],
        parentReferenceCode: request['parentReferenceCode'],
        customerReferenceCode: request['customerReferenceCode'],
        pricingPlanReferenceCode: request['pricingPlanReferenceCode'],
        subscriptionStatus: request['subscriptionStatus'],
        startDate: request['startDate'],
        endDate: request['endDate']
    });
}

util.inherits(SearchSubscriptionRequest, BaseRequest);

module.exports = SearchSubscriptionRequest;


<|start_filename|>lib/resources/BouncedBankTransferList.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function BouncedBankTransferList() {
    this._config = arguments[0];
    this._api = {
        retrieve: {
            path: '/reporting/settlement/bounced',
            method: 'POST',
            requestModel: 'RetrieveTransactionsRequest'
        }
    };
}

BouncedBankTransferList.prototype = new IyzipayResource();

module.exports = BouncedBankTransferList;

<|start_filename|>lib/requests/model/BasicPayment.js<|end_filename|>
'use strict';

var PaymentCard = require('./PaymentCard'),
    utils = require('../../utils');

function BasicPayment() {
}

BasicPayment.body = function (data) {

    return typeof data !== 'undefined' ? {
        locale: data['locale'],
        conversationId: data['conversationId'],
        price: utils.formatPrice(data['price']),
        paidPrice: utils.formatPrice(data['paidPrice']),
        installment: data['installment'],
        buyerEmail: data['buyerEmail'],
        buyerId: data['buyerId'],
        buyerIp: data['buyerIp'],
        posOrderId: data['posOrderId'],
        paymentCard: PaymentCard.body(data['paymentCard']),
        currency: data["currency"],
        connectorName: data['connectorName'],
        callbackUrl: data['callbackUrl']
    } : undefined
};

module.exports = BasicPayment;

<|start_filename|>lib/requests/RetrievePaymentRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrievePaymentRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        paymentId: request['paymentId'],
        paymentConversationId: request['paymentConversationId']
    });
}

util.inherits(RetrievePaymentRequest, BaseRequest);

module.exports = RetrievePaymentRequest;

<|start_filename|>lib/resources/SubscriptionExistingCustomer.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

var SubscriptionApiMethod = {
    INITIALIZE: 'initialize'
};

function SubscriptionExistingCustomer() {
    this._config = arguments[0];
    this._api = {
        initialize: {
            path: '/v2/subscription/initialize/with-customer',
            method: 'POST',
            requestModel: 'CreateSubscriptionInitExistingCustomerRequest'
        }
    };
}

SubscriptionExistingCustomer.prototype = new IyzipayResource();

SubscriptionExistingCustomer.prototype.initialize = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.INITIALIZE, function (err, res, body) {
        cb(err, body);
    });
};

module.exports = SubscriptionExistingCustomer;


<|start_filename|>lib/resources/CheckoutForm.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function CheckoutForm() {
    this._config = arguments[0];
    this._api = {
        retrieve: {
            path: '/payment/iyzipos/checkoutform/auth/ecom/detail',
            method: 'POST',
            requestModel: 'RetrieveCheckoutFormRequest'
        }
    };
}

CheckoutForm.prototype = new IyzipayResource();

module.exports = CheckoutForm;

<|start_filename|>lib/resources/SubscriptionPricingPlan.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function SubscriptionPricingPlan() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/v2/subscription/products/{productReferenceCode}/pricing-plans',
            method: 'POST',
            pathVariables: 'CreateSubscriptionPricingPlanPathRequest',
            requestModel: 'CreateSubscriptionPricingPlanRequest'
        },
        update: {
            path: '/v2/subscription/pricing-plans/{pricingPlanReferenceCode}',
            method: 'POST',
            pathVariables: 'UpdateSubscriptionPricingPlanPathRequest',
            requestModel: 'UpdateSubscriptionPricingPlanRequest'
        },
        delete: {
            path: '/v2/subscription/pricing-plans/{pricingPlanReferenceCode}',
            method: 'DELETE',
            pathVariables: 'DeleteSubscriptionPricingPlanPathRequest'
        },
        retrieveList: {
            path: '/v2/subscription/products/{productReferenceCode}/pricing-plans',
            method: 'GET',
            pathVariables: 'RetrieveSubscriptionPricingPlanListPathRequest',
            queryString: 'RetrieveSubscriptionPricingPlanListRequest'
        },
        retrieve: {
            path: '/v2/subscription/pricing-plans/{pricingPlanReferenceCode}',
            method: 'GET',
            pathVariables: 'RetrieveSubscriptionPricingPlanPathRequest'
        }
    };
}

SubscriptionPricingPlan.prototype = new IyzipayResource();

module.exports = SubscriptionPricingPlan;


<|start_filename|>lib/resources/ThreedsInitialize.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function ThreedsInitializ() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/3dsecure/initialize',
            method: 'POST',
            requestModel: 'CreatePaymentRequest'
        }
    };
}

ThreedsInitializ.prototype = new IyzipayResource();

module.exports = ThreedsInitializ;


<|start_filename|>lib/requests/RetrieveSubscriptionPricingPlanListRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    Pagination = require('./model/Pagination');

function RetrieveSubscriptionPricingPlanListRequest(request) {
    BaseRequest.call(this, Pagination.body(request));
}

util.inherits(RetrieveSubscriptionPricingPlanListRequest, BaseRequest);

module.exports = RetrieveSubscriptionPricingPlanListRequest;


<|start_filename|>lib/requests/UpdateSubMerchantPaymentItemRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    PaymentItem = require('./model/PaymentItem');

function UpdateSubMerchantPaymentItemRequest(request) {
    BaseRequest.call(this, PaymentItem.body(request));
}

util.inherits(UpdateSubMerchantPaymentItemRequest, BaseRequest);

module.exports = UpdateSubMerchantPaymentItemRequest;


<|start_filename|>lib/requests/CreateSubscriptionInitExistingCustomerRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function CreateSubscriptionInitExistingCustomerRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        pricingPlanReferenceCode: request['pricingPlanReferenceCode'],
        customerReferenceCode: request['customerReferenceCode']
    });
}

util.inherits(CreateSubscriptionInitExistingCustomerRequest, BaseRequest);

module.exports = CreateSubscriptionInitExistingCustomerRequest;


<|start_filename|>lib/resources/SubscriptionPayment.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

var SubscriptionApiMethod = {
    RETRY: 'retry'
};

function SubscriptionPayment() {
    this._config = arguments[0];
    this._api = {
        retry: {
            path: '/v2/subscription/operation/retry',
            method: 'POST',
            requestModel: 'CreateSubscriptionPaymentRetryRequest'
        }
    };
}

SubscriptionPayment.prototype = new IyzipayResource();

SubscriptionPayment.prototype.retry = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.RETRY, function (err, res, body) {
        cb(err, body);
    });
};

module.exports = SubscriptionPayment;


<|start_filename|>lib/requests/CreatePaymentRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    Payment = require('./model/Payment');

function CreatePaymentRequest(request) {

    BaseRequest.call(this, Payment.body(request));
}

util.inherits(CreatePaymentRequest, BaseRequest);

module.exports = CreatePaymentRequest;

<|start_filename|>lib/resources/PaymentItem.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function PaymentItem() {
    this._config = arguments[0];
    this._api = {
        update: {
            path: '/payment/item',
            method: 'PUT',
            requestModel: 'UpdateSubMerchantPaymentItemRequest'
        }
    };
}

PaymentItem.prototype = new IyzipayResource();

module.exports = PaymentItem;

<|start_filename|>lib/requests/CreateCrossBookingRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    utils = require('../utils');

function CreateCrossBookingRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        subMerchantKey: request['subMerchantKey'],
        price: utils.formatPrice(request['price']),
        reason: request['reason'],
        currency: request["currency"]
    });
}

util.inherits(CreateCrossBookingRequest, BaseRequest);

module.exports = CreateCrossBookingRequest;

<|start_filename|>lib/resources/CrossBookingFromSubMerchant.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function CrossBookingFromSubMerchant() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/crossbooking/receive',
            method: 'POST',
            requestModel: 'CreateCrossBookingRequest'
        }
    };
}

CrossBookingFromSubMerchant.prototype = new IyzipayResource();

module.exports = CrossBookingFromSubMerchant;

<|start_filename|>lib/requests/CreateApmInitializeRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    Apm = require('./model/Apm');

function CreateApmInitializeRequest(request) {

    BaseRequest.call(this, Apm.body(request));
}

util.inherits(CreateApmInitializeRequest, BaseRequest);

module.exports = CreateApmInitializeRequest;

<|start_filename|>lib/requests/CreateBasicPaymentRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    BasicPayment = require('./model/BasicPayment');

function CreateBasicPaymentRequest(request) {

    BaseRequest.call(this, BasicPayment.body(request));
}

util.inherits(CreateBasicPaymentRequest, BaseRequest);

module.exports = CreateBasicPaymentRequest;

<|start_filename|>lib/requests/model/SubscriptionProduct.js<|end_filename|>
'use strict';

function SubscriptionProduct() {
}

SubscriptionProduct.body = function (data) {
    return typeof data !== 'undefined' ? {
        locale: data['locale'],
        conversationId: data['conversationId'],
        name: data["name"],
        description: data["description"]
    } : undefined;
};

module.exports = SubscriptionProduct;


<|start_filename|>lib/resources/CheckoutFormInitialize.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function CheckoutFormInitialize() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/iyzipos/checkoutform/initialize/auth/ecom',
            method: 'POST',
            requestModel: 'CreateCheckoutFormInitializeRequest'
        }
    };
}

CheckoutFormInitialize.prototype = new IyzipayResource();

module.exports = CheckoutFormInitialize;

<|start_filename|>lib/requests/RetrieveInstallmentInfoRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    utils = require('../utils');

function RetrieveInstallmentInfoRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        binNumber: request['binNumber'],
        price: utils.formatPrice(request['price']),
        currency: request["currency"]
    });
}

util.inherits(RetrieveInstallmentInfoRequest, BaseRequest);

module.exports = RetrieveInstallmentInfoRequest;

<|start_filename|>lib/resources/BkmInitialize.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function BkmInitialize() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/bkm/initialize',
            method: 'POST',
            requestModel: 'CreateBkmInitializeRequest'
        }
    };
}

BkmInitialize.prototype = new IyzipayResource();

module.exports = BkmInitialize;

<|start_filename|>lib/requests/CreateCardRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    CardInformation = require('./model/CardInformation');

function CreateCardRequest(request) {

    BaseRequest.call(this, {
        locale: request["locale"],
        conversationId: request["conversationId"],
        externalId: request["externalId"],
        email: request["email"],
        cardUserKey: request["cardUserKey"],
        card: CardInformation.body(request["card"])
    });
}

util.inherits(CreateCardRequest, BaseRequest);

module.exports = CreateCardRequest;

<|start_filename|>lib/resources/Cancel.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function Cancel() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/cancel',
            method: 'POST',
            requestModel: 'CreateCancelRequest'
        }
    };
}

Cancel.prototype = new IyzipayResource();

module.exports = Cancel;

<|start_filename|>lib/requests/CreateSubscriptionCustomerRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    iyzicoUtils = require('../utils'),
    SubscriptionCustomer = require('./model/SubscriptionCustomer');

function CreateSubscriptionCustomerRequest(request) {
    BaseRequest.call(this, iyzicoUtils.mergeObjects({
        locale: request['locale'],
        conversationId: request['conversationId']
    }, SubscriptionCustomer.body(request)));
}

util.inherits(CreateSubscriptionCustomerRequest, BaseRequest);

module.exports = CreateSubscriptionCustomerRequest;


<|start_filename|>lib/resources/Subscription.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

var SubscriptionApiMethod = {
    INITIALIZE: 'initialize',
    CANCEL: 'cancel',
    RETRY: 'retry',
    ACTIVATE: 'activate',
    UPGRADE: 'upgrade',
    SEARCH: 'search'
};

function Subscription() {
    this._config = arguments[0];
    this._api = {
        initialize: {
            path: '/v2/subscription/initialize',
            method: 'POST',
            requestModel: 'CreateSubscriptionInitRequest'
        },
        cancel: {
            path: '/v2/subscription/subscriptions/{subscriptionReferenceCode}/cancel',
            method: 'POST',
            pathVariables: 'SubscriptionPathRequest'
        },
        activate: {
            path: '/v2/subscription/subscriptions/{subscriptionReferenceCode}/activate',
            method: 'POST',
            pathVariables: 'SubscriptionPathRequest'
        },
        upgrade: {
            path: '/v2/subscription/subscriptions/{subscriptionReferenceCode}/upgrade',
            method: 'POST',
            pathVariables: 'SubscriptionPathRequest',
            requestModel: 'UpgradeSubscriptionRequest'
        },
        retrieve: {
            path: '/v2/subscription/subscriptions/{subscriptionReferenceCode}',
            method: 'GET',
            pathVariables: 'SubscriptionPathRequest'
        },
        search: {
            path: '/v2/subscription/subscriptions',
            method: 'GET',
            queryString: 'SearchSubscriptionRequest'
        }
    };
}

Subscription.prototype = new IyzipayResource();

Subscription.prototype.initialize = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.INITIALIZE, function (err, res, body) {
        cb(err, body);
    });
};

Subscription.prototype.cancel = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.CANCEL, function (err, res, body) {
        cb(err, body);
    });
};

Subscription.prototype.activate = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.ACTIVATE, function (err, res, body) {
        cb(err, body);
    });
};

Subscription.prototype.upgrade = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.UPGRADE, function (err, res, body) {
        cb(err, body);
    });
};

Subscription.prototype.search = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.SEARCH, function (err, res, body) {
        cb(err, body);
    });
};

module.exports = Subscription;


<|start_filename|>lib/requests/UpdateSubscriptionCustomerRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    SubscriptionCustomer = require('./model/SubscriptionCustomer');

function UpdateSubscriptionCustomerRequest(request) {
    BaseRequest.call(this, SubscriptionCustomer.body(request));
}

util.inherits(UpdateSubscriptionCustomerRequest, BaseRequest);

module.exports = UpdateSubscriptionCustomerRequest;


<|start_filename|>lib/requests/UpdateSubscriptionPricingPlanPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function UpdateSubscriptionPricingPlanPathRequest(request) {

    BaseRequest.call(this, {
        pricingPlanReferenceCode: request["pricingPlanReferenceCode"]
    });
}

util.inherits(UpdateSubscriptionPricingPlanPathRequest, BaseRequest);

module.exports = UpdateSubscriptionPricingPlanPathRequest;


<|start_filename|>lib/resources/CardList.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function CardList() {
    this._config = arguments[0];
    this._api = {
        retrieve: {
            path: '/cardstorage/cards',
            method: 'POST',
            requestModel: 'RetrieveCardListRequest'
        }
    };
}

CardList.prototype = new IyzipayResource();

module.exports = CardList;

<|start_filename|>lib/requests/CreateSubscriptionInitRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    SubscriptionCard = require('./model/SubscriptionCard'),
    SubscriptionCustomer = require('./model/SubscriptionCustomer');

function CreateSubscriptionInitRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        paymentCard: SubscriptionCard.body(request['paymentCard']),
        customer: SubscriptionCustomer.body(request['customer']),
        pricingPlanReferenceCode: request['pricingPlanReferenceCode'],
        subscriptionInitialStatus: request['subscriptionInitialStatus']
    });
}

util.inherits(CreateSubscriptionInitRequest, BaseRequest);

module.exports = CreateSubscriptionInitRequest;


<|start_filename|>lib/requests/UpgradeSubscriptionRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function UpgradeSubscriptionRequest(request) {
    BaseRequest.call(this, {
        locale: request["locale"],
        conversationId: request["conversationId"],
        newPricingPlanReferenceCode: request["newPricingPlanReferenceCode"],
        upgradePeriod: request["upgradePeriod"],
        useTrial: request["useTrial"]
    });
}

util.inherits(UpgradeSubscriptionRequest, BaseRequest);

module.exports = UpgradeSubscriptionRequest;


<|start_filename|>lib/resources/ThreedsPayment.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function ThreedsPayment() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/3dsecure/auth',
            method: 'POST',
            requestModel: 'CreateThreedsPaymentRequest'
        },
        retrieve: {
            path: '/payment/detail',
            method: 'POST',
            requestModel: 'RetrievePaymentRequest'
        }
    };
}

ThreedsPayment.prototype = new IyzipayResource();

module.exports = ThreedsPayment;


<|start_filename|>lib/requests/SubscriptionPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function SubscriptionPathRequest(request) {

    BaseRequest.call(this, {
        subscriptionReferenceCode: request["subscriptionReferenceCode"]
    });
}

util.inherits(SubscriptionPathRequest, BaseRequest);

module.exports = SubscriptionPathRequest;


<|start_filename|>lib/requests/CreateSubscriptionPricingPlanRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    SubscriptionPricingPlan = require('./model/SubscriptionPricingPlan');

function CreateSubscriptionPricingPlanRequest(request) {
    BaseRequest.call(this, SubscriptionPricingPlan.body(request));
}

util.inherits(CreateSubscriptionPricingPlanRequest, BaseRequest);

module.exports = CreateSubscriptionPricingPlanRequest;


<|start_filename|>lib/requests/CreatePaymentPostAuthRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    utils = require('../utils');

function CreatePaymentPostAuthRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        paymentId: request['paymentId'],
        ip: request['ip'],
        paidPrice: utils.formatPrice(request['paidPrice']),
        currency: request["currency"]
    });
}

util.inherits(CreatePaymentPostAuthRequest, BaseRequest);

module.exports = CreatePaymentPostAuthRequest;

<|start_filename|>lib/requests/UpdateSubscriptionPricingPlanRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function UpdateSubscriptionPricingPlanRequest(request) {
    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        name: request["name"],
        trialPeriodDays: request["trialPeriodDays"]
    });
}

util.inherits(UpdateSubscriptionPricingPlanRequest, BaseRequest);

module.exports = UpdateSubscriptionPricingPlanRequest;


<|start_filename|>lib/requests/model/Address.js<|end_filename|>
'use strict';

function Address() {
}

Address.body = function (data) {

    return typeof data !== 'undefined' ? {
        address: data["address"],
        zipCode: data["zipCode"],
        contactName: data["contactName"],
        city: data["city"],
        country: data["country"]
    } : undefined
};

module.exports = Address;

<|start_filename|>lib/requests/RetrieveSubscriptionPricingPlanListPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveSubscriptionPricingPlanListPathRequest(request) {

    BaseRequest.call(this, {
        productReferenceCode: request["productReferenceCode"]
    });
}

util.inherits(RetrieveSubscriptionPricingPlanListPathRequest, BaseRequest);

module.exports = RetrieveSubscriptionPricingPlanListPathRequest;


<|start_filename|>lib/resources/BasicPaymentPreAuth.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function BasicPaymentPreAuth() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/preauth/basic',
            method: 'POST',
            requestModel: 'CreateBasicPaymentRequest'
        }
    };
}

BasicPaymentPreAuth.prototype = new IyzipayResource();

module.exports = BasicPaymentPreAuth;

<|start_filename|>lib/requests/CreateSubscriptionPricingPlanPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function CreateSubscriptionPricingPlanPathRequest(request) {

    BaseRequest.call(this, {
        productReferenceCode: request["productReferenceCode"]
    });
}

util.inherits(CreateSubscriptionPricingPlanPathRequest, BaseRequest);

module.exports = CreateSubscriptionPricingPlanPathRequest;


<|start_filename|>lib/requests/model/Apm.js<|end_filename|>
'use strict';

var Buyer = require('./Buyer'),
    Address = require('./Address'),
    BasketItem = require('./BasketItem'),
    utils = require('../../utils');

function Apm() {
}

Apm.body = function (data) {

    return typeof data !== 'undefined' ? {
        locale: data['locale'],
        conversationId: data['conversationId'],
        price: utils.formatPrice(data['price']),
        paidPrice: utils.formatPrice(data['paidPrice']),
        paymentChannel: data['paymentChannel'],
        paymentGroup: data['paymentGroup'],
        paymentSource: data['paymentSource'],
        currency: data['currency'],
        merchantOrderId: data['merchantOrderId'],
        countryCode: data['countryCode'],
        accountHolderName: data['accountHolderName'],
        merchantCallbackUrl: data['merchantCallbackUrl'],
        merchantErrorUrl: data['merchantErrorUrl'],
        merchantNotificationUrl: data['merchantNotificationUrl'],
        apmType: data['apmType'],
        basketId: data['basketId'],
        buyer: Buyer.body(data['buyer']),
        shippingAddress: Address.body(data['shippingAddress']),
        billingAddress: Address.body(data['billingAddress']),
        basketItems: data['basketItems'].map(function (basketItem) {
            return BasketItem.body(basketItem);
        })
    } : undefined
};

module.exports = Apm;

<|start_filename|>lib/resources/RefundToBalance.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function RefundToBalance() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/refund-to-balance/init',
            method: 'POST',
            requestModel: 'CreateRefundToBalanceInitRequest'
        }
    };
}

RefundToBalance.prototype = new IyzipayResource();

module.exports = RefundToBalance;

<|start_filename|>lib/requests/model/BkmInstallment.js<|end_filename|>
'use strict';

var BkmInstallmentPrice = require('./BkmInstallmentPrice');

function BkmInstallment() {
}

BkmInstallment.body = function (data) {

    return typeof data !== 'undefined' ? {
        bankId: data["bankId"],
        installmentPrices: data["installmentPrices"].map(function (bkmInstallmentPrice) {
            return BkmInstallmentPrice.body(bkmInstallmentPrice);
        })
    } : undefined
};

module.exports = BkmInstallment;

<|start_filename|>lib/requests/CreateBasicBkmInitializeRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    BkmInstallment = require('./model/BkmInstallment'),
    utils = require('../utils');

function CreateBasicBkmInitializeRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        connectorName: request['connectorName'],
        price: utils.formatPrice(request['price']),
        callbackUrl: request['callbackUrl'],
        buyerEmail: request['buyerEmail'],
        buyerId: request['buyerId'],
        buyerIp: request['buyerIp'],
        posOrderId: request['posOrderId'],
        installmentDetails: request['installmentDetails'].map(function (bkmInstallmentDetail) {
            return BkmInstallment.body(bkmInstallmentDetail);
        })
    });
}

util.inherits(CreateBasicBkmInitializeRequest, BaseRequest);

module.exports = CreateBasicBkmInitializeRequest;

<|start_filename|>lib/requests/RetrieveSubMerchantRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveSubMerchantRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        subMerchantExternalId: request['subMerchantExternalId']
    });
}

util.inherits(RetrieveSubMerchantRequest, BaseRequest);

module.exports = RetrieveSubMerchantRequest;

<|start_filename|>lib/resources/BasicThreedsPayment.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function BasicThreedsPayment() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/3dsecure/auth/basic',
            method: 'POST',
            requestModel: 'CreateThreedsPaymentRequest'
        }
    };
}

BasicThreedsPayment.prototype = new IyzipayResource();

module.exports = BasicThreedsPayment;


<|start_filename|>lib/requests/RetrieveApmRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveApmRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        paymentId: request['paymentId']
    });
}

util.inherits(RetrieveApmRequest, BaseRequest);

module.exports = RetrieveApmRequest;

<|start_filename|>lib/requests/model/Buyer.js<|end_filename|>
'use strict';

function Buyer() {
}

Buyer.body = function (data) {

    return typeof data !== 'undefined' ? {
        id: data["id"],
        name: data["name"],
        surname: data["surname"],
        identityNumber: data["identityNumber"],
        email: data["email"],
        gsmNumber: data["gsmNumber"],
        registrationDate: data["registrationDate"],
        lastLoginDate: data["lastLoginDate"],
        registrationAddress: data["registrationAddress"],
        city: data["city"],
        country: data["country"],
        zipCode: data["zipCode"],
        ip: data["ip"]
    } : undefined
};

module.exports = Buyer;

<|start_filename|>lib/requests/SubscriptionProductPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function SubscriptionProductPathRequest(request) {

    BaseRequest.call(this, {
        productReferenceCode: request["productReferenceCode"]
    });
}

util.inherits(SubscriptionProductPathRequest, BaseRequest);

module.exports = SubscriptionProductPathRequest;


<|start_filename|>lib/requests/model/PaymentItem.js<|end_filename|>
'use strict';

var utils = require('../../utils');

function PaymentItem() {}

PaymentItem.body = function(data) {
    return typeof data !== 'undefined'
        ? {
              subMerchantKey: data['subMerchantKey'],
              paymentTransactionId: data['paymentTransactionId'],
              subMerchantPrice: utils.formatPrice(data['subMerchantPrice'])          }
        : undefined;
};

module.exports = PaymentItem;


<|start_filename|>lib/resources/Apm.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function Apm() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/apm/initialize',
            method: 'POST',
            requestModel: 'CreateApmInitializeRequest'
        },
        retrieve: {
            path: '/payment/apm/retrieve',
            method: 'POST',
            requestModel: 'RetrieveApmRequest'
        }
    };
}

Apm.prototype = new IyzipayResource();

module.exports = Apm;

<|start_filename|>lib/resources/ApiTest.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function ApiTest() {
    this._config = arguments[0];
    this._api = {
        retrieve: {
            path: '/payment/test',
            method: 'GET'
        }
    };
}

ApiTest.prototype = new IyzipayResource();

module.exports = ApiTest;

<|start_filename|>lib/resources/SubscriptionCheckoutForm.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

var SubscriptionApiMethod = {
    INITIALIZE: 'initialize'
};

function SubscriptionCheckoutForm() {
    this._config = arguments[0];
    this._api = {
        initialize: {
            path: '/v2/subscription/checkoutform/initialize',
            method: 'POST',
            requestModel: 'CreateSubscriptionCheckoutFormInitRequest'
        },
        retrieve: {
            path: '/v2/subscription/checkoutform/{checkoutFormToken}',
            method: 'GET',
            pathVariables: 'RetrieveSubscriptionCheckoutFormPathRequest'
        },
    };
}

SubscriptionCheckoutForm.prototype = new IyzipayResource();

SubscriptionCheckoutForm.prototype.initialize = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionApiMethod.INITIALIZE, function (err, res, body) {
        cb(err, body);
    });
};

module.exports = SubscriptionCheckoutForm;


<|start_filename|>lib/requests/CreateSubscriptionProductRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    SubscriptionProduct = require('./model/SubscriptionProduct');

function CreateSubscriptionProductRequest(request) {
    BaseRequest.call(this, SubscriptionProduct.body(request));
}

util.inherits(CreateSubscriptionProductRequest, BaseRequest);

module.exports = CreateSubscriptionProductRequest;


<|start_filename|>lib/resources/Payment.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function Payment() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/auth',
            method: 'POST',
            requestModel: 'CreatePaymentRequest'
        },
        retrieve: {
            path: '/payment/detail',
            method: 'POST',
            requestModel: 'RetrievePaymentRequest'
        }
    };
}

Payment.prototype = new IyzipayResource();

module.exports = Payment;

<|start_filename|>lib/resources/CheckoutFormInitializePreAuth.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function CheckoutFormInitializePreAuth() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/iyzipos/checkoutform/initialize/preauth/ecom',
            method: 'POST',
            requestModel: 'CreateCheckoutFormInitializeRequest'
        }
    };
}

CheckoutFormInitializePreAuth.prototype = new IyzipayResource();

module.exports = CheckoutFormInitializePreAuth;

<|start_filename|>lib/resources/SubMerchant.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function SubMerchant() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/onboarding/submerchant',
            method: 'POST',
            requestModel: 'CreateSubMerchantRequest'
        },
        update: {
            path: '/onboarding/submerchant',
            method: 'PUT',
            requestModel: 'UpdateSubMerchantRequest'
        },
        retrieve: {
            path: '/onboarding/submerchant/detail',
            method: 'POST',
            requestModel: 'RetrieveSubMerchantRequest'
        }
    };
}

SubMerchant.prototype = new IyzipayResource();

module.exports = SubMerchant;

<|start_filename|>lib/requests/model/BkmInstallmentPrice.js<|end_filename|>
'use strict';

var utils = require('../../utils');

function BkmInstallmentPrice() {
}

BkmInstallmentPrice.body = function (data) {

    return typeof data !== 'undefined' ? {
        installmentNumber: data["installmentNumber"],
        totalPrice: utils.formatPrice(data["totalPrice"])
    } : undefined
};

module.exports = BkmInstallmentPrice;

<|start_filename|>lib/requests/model/BasketItem.js<|end_filename|>
'use strict';

var utils = require('../../utils');

function BasketItem() {
}

BasketItem.body = function (data) {

    return typeof data !== 'undefined' ? {
        id: data["id"],
        price: utils.formatPrice(data["price"]),
        name: data["name"],
        category1: data["category1"],
        category2: data["category2"],
        itemType: data["itemType"],
        subMerchantKey: data["subMerchantKey"],
        subMerchantPrice: utils.formatPrice(data["subMerchantPrice"])
    } : undefined
};

module.exports = BasketItem;

<|start_filename|>lib/requests/UpdateSubscriptionCardWithSubscriptionReferenceCodeRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function UpdateSubscriptionCardWithSubscriptionReferenceCodeRequest(request) {
    BaseRequest.call(this, {
        locale: request["locale"],
        conversationId: request["conversationId"],
        subscriptionReferenceCode: request["subscriptionReferenceCode"],
        callbackUrl: request["callbackUrl"]
    });
}

util.inherits(UpdateSubscriptionCardWithSubscriptionReferenceCodeRequest, BaseRequest);

module.exports = UpdateSubscriptionCardWithSubscriptionReferenceCodeRequest;


<|start_filename|>lib/requests/RetrieveSubscriptionCustomerListRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    Pagination = require('./model/Pagination');

function RetrieveSubscriptionCustomerListRequest(request) {
    BaseRequest.call(this, Pagination.body(request));
}

util.inherits(RetrieveSubscriptionCustomerListRequest, BaseRequest);

module.exports = RetrieveSubscriptionCustomerListRequest;


<|start_filename|>lib/resources/PayoutCompletedTransactionList.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function PayoutCompletedTransactionList() {
    this._config = arguments[0];
    this._api = {
        retrieve: {
            path: '/reporting/settlement/payoutcompleted',
            method: 'POST',
            requestModel: 'RetrieveTransactionsRequest'
        }
    };
}

PayoutCompletedTransactionList.prototype = new IyzipayResource();

module.exports = PayoutCompletedTransactionList;

<|start_filename|>lib/resources/CrossBookingToSubMerchant.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function CrossBookingToSubMerchant() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/crossbooking/send',
            method: 'POST',
            requestModel: 'CreateCrossBookingRequest'
        }
    };
}

CrossBookingToSubMerchant.prototype = new IyzipayResource();

module.exports = CrossBookingToSubMerchant;

<|start_filename|>lib/utils.js<|end_filename|>
'use strict';

var crypto = require('crypto');

var utils = module.exports = {
    apiMethod: {
        RETRIEVE: 'retrieve',
        RETRIEVE_LIST: 'retrieveList',
        CREATE: 'create',
        DELETE: 'delete',
        UPDATE: 'update'
    },
    generateAuthorizationHeader: function (iyziWsHeaderName, apiKey, separator, secretKey, body, randomString) {
        return iyziWsHeaderName + ' ' + apiKey + separator + utils.generateHash(apiKey, randomString, secretKey, body);
    },
    generateAuthorizationHeaderV2: function (iyziWsHeaderName, apiKey, separator, secretKey, uri, body, randomString) {
        return iyziWsHeaderName + ' ' + utils.generateHashV2(apiKey, separator, uri, randomString, secretKey, body);
    },
    generateHash: function (apiKey, randomString, secretKey, body) {
        var shaSum = crypto.createHash('sha1');
        shaSum.update(apiKey + randomString + secretKey + body, 'utf8');
        return shaSum.digest('base64');
    },
    generateHashV2: function (apiKey, separator, uri, randomString, secretKey, body) {
        var signature = crypto
            .createHmac('sha256', secretKey)
            .update(randomString + uri + JSON.stringify(body))
            .digest('hex');

        var authorizationParams = [
            'apiKey' + separator + apiKey,
            'randomKey' + separator + randomString,
            'signature' + separator + signature
        ];
        return new Buffer(authorizationParams.join('&')).toString('base64');
    },
    generateRandomString: function (size) {
        return process.hrtime()[0] + Math.random().toString(size).slice(2);
    },
    formatPrice: function (price) {
        if (('number' !== typeof price && 'string' !== typeof price) || !isFinite(price)) {
            return price;
        }
        var resultPrice = parseFloat(price).toString();
        if (-1 === resultPrice.indexOf('.')) {
            return resultPrice + '.0';
        }
        return resultPrice;
    },
    mergeObjects: function (obj1, obj2) {
        var mergedObject = {};
        for (var key in obj1) {
            if (obj1.hasOwnProperty(key)) {
                mergedObject[key] = obj1[key];
            }
        }
        for (var key in obj2) {
            if (obj2.hasOwnProperty(key)) {
                mergedObject[key] = obj2[key];
            }
        }
        return mergedObject;
    }
};


<|start_filename|>lib/requests/UpdateSubMerchantRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function UpdateSubMerchantRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        name: request['name'],
        email: request['email'],
        gsmNumber: request['gsmNumber'],
        address: request['address'],
        iban: request['iban'],
        taxOffice: request['taxOffice'],
        contactName: request['contactName'],
        contactSurname: request['contactSurname'],
        legalCompanyTitle: request['legalCompanyTitle'],
        swiftCode: request["swiftCode"],
        currency: request["currency"],
        subMerchantKey: request['subMerchantKey'],
        identityNumber: request['identityNumber'],
        taxNumber: request['taxNumber']
    });
}

util.inherits(UpdateSubMerchantRequest, BaseRequest);

module.exports = UpdateSubMerchantRequest;

<|start_filename|>lib/requests/model/SubscriptionPricingPlan.js<|end_filename|>
'use strict';

var utils = require('../../utils');

function SubscriptionPricingPlan() {
}

SubscriptionPricingPlan.body = function (data) {
    return typeof data !== 'undefined' ? {
        locale: data['locale'],
        conversationId: data['conversationId'],
        name: data['name'],
        price: utils.formatPrice(data['price']),
        currencyCode: data['currencyCode'],
        paymentInterval: data['paymentInterval'],
        paymentIntervalCount: data['paymentIntervalCount'],
        trialPeriodDays: data['trialPeriodDays'],
        planPaymentType: data['planPaymentType']
    } : undefined;
};

module.exports = SubscriptionPricingPlan;


<|start_filename|>lib/requests/model/CardInformation.js<|end_filename|>
'use strict';

function CardInformation() {
}

CardInformation.body = function (data) {

    return typeof data !== 'undefined' ? {
        cardAlias: data["cardAlias"],
        cardNumber: data["cardNumber"],
        expireYear: data["expireYear"],
        expireMonth: data["expireMonth"],
        cardHolderName: data["cardHolderName"]
    } : undefined
};

module.exports = CardInformation;

<|start_filename|>lib/requests/RetrieveCardListRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveCardListRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        cardUserKey: request['cardUserKey']
    });
}

util.inherits(RetrieveCardListRequest, BaseRequest);

module.exports = RetrieveCardListRequest;

<|start_filename|>lib/resources/RefundChargedFromMerchant.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function RefundChargedFromMerchant() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/iyzipos/refund/merchant/charge',
            method: 'POST',
            requestModel: 'CreateRefundRequest'
        }
    };
}

RefundChargedFromMerchant.prototype = new IyzipayResource();

module.exports = RefundChargedFromMerchant;

<|start_filename|>lib/resources/PaymentPreAuth.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function PaymentPreAuth() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/preauth',
            method: 'POST',
            requestModel: 'CreatePaymentRequest'
        },
        retrieve: {
            path: '/payment/detail',
            method: 'POST',
            requestModel: 'RetrievePaymentRequest'
        }
    };
}

PaymentPreAuth.prototype = new IyzipayResource();

module.exports = PaymentPreAuth;

<|start_filename|>lib/requests/BaseRequest.js<|end_filename|>
'use strict';

function Request(request) {
    this._request = request;
    this.toString();
}

Request.prototype.toJson = function () {
    return this._request;
};

Request.prototype.toPkiString = function () {
    return this._generateRequestString(this._request);
};

Request.prototype._generateRequestString = function (request) {
    var isArray = Array.isArray(request);
    var requestString = '[';
    for (var i in request) {
        var val = request[i];
        if (typeof val !== 'undefined' && typeof val !== 'function') {
            // Eliminate number keys of array elements
            if (!isArray) {
                requestString += i + '=';
            }
            if (typeof val === 'object') {
                requestString += this._generateRequestString(val);
            } else {
                requestString += val;
            }
            requestString += isArray ? ', ' : ',';
        }
    }
    requestString = requestString.slice(0, (isArray ? -2 : -1));
    requestString += ']';
    return requestString;
};

module.exports = Request;



<|start_filename|>lib/requests/RetrieveBinNumberRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveBinNumberRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        binNumber: request['binNumber']
    });
}

util.inherits(RetrieveBinNumberRequest, BaseRequest);

module.exports = RetrieveBinNumberRequest;

<|start_filename|>lib/requests/RetrieveCheckoutFormRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveCheckoutFormRequest(request) {

    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        token: request['token']
    });
}

util.inherits(RetrieveCheckoutFormRequest, BaseRequest);

module.exports = RetrieveCheckoutFormRequest;

<|start_filename|>lib/requests/RetrieveSubscriptionCheckoutFormPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveSubscriptionCheckoutFormPathRequest(request) {

    BaseRequest.call(this, {
        checkoutFormToken: request["checkoutFormToken"]
    });
}

util.inherits(RetrieveSubscriptionCheckoutFormPathRequest, BaseRequest);

module.exports = RetrieveSubscriptionCheckoutFormPathRequest;


<|start_filename|>lib/resources/BasicBkmInitialize.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function BasicBkmInitialize() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/bkm/initialize/basic',
            method: 'POST',
            requestModel: 'CreateBasicBkmInitializeRequest'
        }
    };
}

BasicBkmInitialize.prototype = new IyzipayResource();

module.exports = BasicBkmInitialize;

<|start_filename|>lib/resources/Card.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function Card() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/cardstorage/card',
            method: 'POST',
            requestModel: 'CreateCardRequest'
        },
        delete: {
            path: '/cardstorage/card',
            method: 'DELETE',
            requestModel: 'DeleteCardRequest'
        }
    };
}

Card.prototype = new IyzipayResource();

module.exports = Card;

<|start_filename|>lib/resources/SubscriptionCard.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

var SubscriptionUpdateCardApiMethod = {
    UPDATE_WITH_SUBSCRIPTION_REFERENCE_CODE: 'updateWithSubscriptionReferenceCode',
};

function SubscriptionCard() {
    this._config = arguments[0];
    this._api = {
        update: {
            path: '/v2/subscription/card-update/checkoutform/initialize',
            method: 'POST',
            requestModel: 'UpdateSubscriptionCardRequest'
        },
        updateWithSubscriptionReferenceCode: {
            path: '/v2/subscription/card-update/checkoutform/initialize/with-subscription',
            method: 'POST',
            requestModel: 'UpdateSubscriptionCardWithSubscriptionReferenceCodeRequest'
        },
    };
}

SubscriptionCard.prototype = new IyzipayResource();

SubscriptionCard.prototype.updateWithSubscriptionReferenceCode = function (params, cb) {
    this._config.body = params;
    this._request(SubscriptionUpdateCardApiMethod.UPDATE_WITH_SUBSCRIPTION_REFERENCE_CODE, function (err, res, body) {
        cb(err, body);
    });
};

module.exports = SubscriptionCard;


<|start_filename|>lib/resources/BasicPayment.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function BasicPayment() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/auth/basic',
            method: 'POST',
            requestModel: 'CreateBasicPaymentRequest'
        },
    };
}

BasicPayment.prototype = new IyzipayResource();

module.exports = BasicPayment;

<|start_filename|>lib/requests/RetrieveSubscriptionPricingPlanPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function RetrieveSubscriptionPricingPlanPathRequest(request) {

    BaseRequest.call(this, {
        pricingPlanReferenceCode: request["pricingPlanReferenceCode"]
    });
}

util.inherits(RetrieveSubscriptionPricingPlanPathRequest, BaseRequest);

module.exports = RetrieveSubscriptionPricingPlanPathRequest;


<|start_filename|>lib/requests/CreateRefundToBalanceInitRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),

function CreateRefundToBalanceInitRequest(request) {
    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        paymentId: request['paymentId'],
        callbackUrl: request['callbackUrl'],
    });
}

util.inherits(CreateRefundToBalanceInitRequest, BaseRequest);

module.exports = CreateRefundToBalanceInitRequest;

<|start_filename|>lib/resources/SettlementToBalance.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function SettlementToBalance() {
    this._config = arguments[0];
    this._api = {
        create: {
            path: '/payment/settlement-to-balance/init',
            method: 'POST',
            requestModel: 'CreateSettlementToBalanceInitRequest'
        }
    };
}

SettlementToBalance.prototype = new IyzipayResource();

module.exports = SettlementToBalance;

<|start_filename|>lib/resources/BinNumber.js<|end_filename|>
'use strict';

var IyzipayResource = require('../IyzipayResource');

function BinNumber() {
    this._config = arguments[0];
    this._api = {
        retrieve: {
            path: '/payment/bin/check',
            method: 'POST',
            requestModel: 'RetrieveBinNumberRequest'
        }
    };
}

BinNumber.prototype = new IyzipayResource();

module.exports = BinNumber;

<|start_filename|>lib/requests/DeleteSubscriptionPricingPlanPathRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util');

function DeleteSubscriptionPricingPlanPathRequest(request) {

    BaseRequest.call(this, {
        pricingPlanReferenceCode: request["pricingPlanReferenceCode"]
    });
}

util.inherits(DeleteSubscriptionPricingPlanPathRequest, BaseRequest);

module.exports = DeleteSubscriptionPricingPlanPathRequest;


<|start_filename|>lib/requests/CreateSettlementToBalanceInitRequest.js<|end_filename|>
'use strict';

var BaseRequest = require('./BaseRequest'),
    util = require('util'),
    utils = require('../utils');

function CreateSettlementToBalanceInitRequest(request) {
    BaseRequest.call(this, {
        locale: request['locale'],
        conversationId: request['conversationId'],
        subMerchantKey: request['subMerchantKey'],
        callbackUrl: request["callbackUrl"],
        price: utils.formatPrice(request['price'])
    });
}

util.inherits(CreateSettlementToBalanceInitRequest, BaseRequest);

module.exports = CreateSettlementToBalanceInitRequest;