chargebee-typescript
Version:
A library in typescript for integrating with Chargebee.
379 lines (378 loc) • 14.5 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChildAccountAccess = exports.ParentAccountAccess = exports.Relationship = exports.TaxProvidersField = exports.EntityIdentifier = exports.Balance = exports.PaymentMethod = exports.Contact = exports.ReferralUrl = exports.BillingAddress = exports.Customer = void 0;
const request_wrapper_1 = require("../request_wrapper");
const model_1 = require("./model");
const chargebee_1 = require("../chargebee");
class Customer extends model_1.Model {
// OPERATIONS
//-----------
static create(params) {
return new request_wrapper_1.RequestWrapper([params], {
'methodName': 'create',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': null,
'hasIdInUrl': false,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {
"exemption_details": 0,
"meta_data": 0,
"additional_information": 1,
"billing_address": 1,
}
}, chargebee_1.ChargeBee._env);
}
static list(params) {
return new request_wrapper_1.RequestWrapper([params], {
'methodName': 'list',
'httpMethod': 'GET',
'urlPrefix': '/customers',
'urlSuffix': null,
'hasIdInUrl': false,
'isListReq': true,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static retrieve(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'retrieve',
'httpMethod': 'GET',
'urlPrefix': '/customers',
'urlSuffix': null,
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static update(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'update',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': null,
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {
"exemption_details": 0,
"meta_data": 0,
}
}, chargebee_1.ChargeBee._env);
}
static update_payment_method(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'update_payment_method',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/update_payment_method',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {
"additional_information": 1,
}
}, chargebee_1.ChargeBee._env);
}
static update_billing_info(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'update_billing_info',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/update_billing_info',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static contacts_for_customer(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'contacts_for_customer',
'httpMethod': 'GET',
'urlPrefix': '/customers',
'urlSuffix': '/contacts',
'hasIdInUrl': true,
'isListReq': true,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static assign_payment_role(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'assign_payment_role',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/assign_payment_role',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static add_contact(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'add_contact',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/add_contact',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static update_contact(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'update_contact',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/update_contact',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static delete_contact(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'delete_contact',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/delete_contact',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static add_promotional_credits(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'add_promotional_credits',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/add_promotional_credits',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static deduct_promotional_credits(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'deduct_promotional_credits',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/deduct_promotional_credits',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static set_promotional_credits(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'set_promotional_credits',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/set_promotional_credits',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static record_excess_payment(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'record_excess_payment',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/record_excess_payment',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static collect_payment(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'collect_payment',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/collect_payment',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {
"additional_information": 1,
}
}, chargebee_1.ChargeBee._env);
}
static delete(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'delete',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/delete',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static move(params) {
return new request_wrapper_1.RequestWrapper([params], {
'methodName': 'move',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/move',
'hasIdInUrl': false,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static change_billing_date(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'change_billing_date',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/change_billing_date',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static merge(params) {
return new request_wrapper_1.RequestWrapper([params], {
'methodName': 'merge',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/merge',
'hasIdInUrl': false,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static clear_personal_data(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'clear_personal_data',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/clear_personal_data',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static relationships(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'relationships',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/relationships',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static delete_relationship(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'delete_relationship',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/delete_relationship',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static hierarchy(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'hierarchy',
'httpMethod': 'GET',
'urlPrefix': '/customers',
'urlSuffix': '/hierarchy',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
static update_hierarchy_settings(customer_id, params) {
return new request_wrapper_1.RequestWrapper([customer_id, params], {
'methodName': 'update_hierarchy_settings',
'httpMethod': 'POST',
'urlPrefix': '/customers',
'urlSuffix': '/update_hierarchy_settings',
'hasIdInUrl': true,
'isListReq': false,
'subDomain': null,
'isOperationNeedsJsonInput': false,
'jsonKeys': {}
}, chargebee_1.ChargeBee._env);
}
} // ~Customer
exports.Customer = Customer;
class BillingAddress extends model_1.Model {
} // ~BillingAddress
exports.BillingAddress = BillingAddress;
class ReferralUrl extends model_1.Model {
} // ~ReferralUrl
exports.ReferralUrl = ReferralUrl;
class Contact extends model_1.Model {
} // ~Contact
exports.Contact = Contact;
class PaymentMethod extends model_1.Model {
} // ~PaymentMethod
exports.PaymentMethod = PaymentMethod;
class Balance extends model_1.Model {
} // ~Balance
exports.Balance = Balance;
class EntityIdentifier extends model_1.Model {
} // ~EntityIdentifier
exports.EntityIdentifier = EntityIdentifier;
class TaxProvidersField extends model_1.Model {
} // ~TaxProvidersField
exports.TaxProvidersField = TaxProvidersField;
class Relationship extends model_1.Model {
} // ~Relationship
exports.Relationship = Relationship;
class ParentAccountAccess extends model_1.Model {
} // ~ParentAccountAccess
exports.ParentAccountAccess = ParentAccountAccess;
class ChildAccountAccess extends model_1.Model {
} // ~ChildAccountAccess
exports.ChildAccountAccess = ChildAccountAccess;
;