UNPKG

@commercelayer/sdk

Version:
56 lines (53 loc) 2.63 kB
'use strict'; var chunkVRRJS3ZM_cjs = require('./chunk-VRRJS3ZM.cjs'); // src/resources/braintree_gateways.ts var BraintreeGateways = class _BraintreeGateways extends chunkVRRJS3ZM_cjs.ApiResource { static TYPE = "braintree_gateways"; async create(resource, params, options) { return this.resources.create({ ...resource, type: _BraintreeGateways.TYPE }, params, options); } async update(resource, params, options) { return this.resources.update({ ...resource, type: _BraintreeGateways.TYPE }, params, options); } async delete(id, options) { await this.resources.delete(typeof id === "string" ? { id, type: _BraintreeGateways.TYPE } : id, options); } async payment_methods(braintreeGatewayId, params, options) { const _braintreeGatewayId = braintreeGatewayId.id || braintreeGatewayId; return this.resources.fetch({ type: "payment_methods" }, `braintree_gateways/${_braintreeGatewayId}/payment_methods`, params, options); } async event_stores(braintreeGatewayId, params, options) { const _braintreeGatewayId = braintreeGatewayId.id || braintreeGatewayId; return this.resources.fetch({ type: "event_stores" }, `braintree_gateways/${_braintreeGatewayId}/event_stores`, params, options); } async braintree_payments(braintreeGatewayId, params, options) { const _braintreeGatewayId = braintreeGatewayId.id || braintreeGatewayId; return this.resources.fetch({ type: "braintree_payments" }, `braintree_gateways/${_braintreeGatewayId}/braintree_payments`, params, options); } async _disable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _BraintreeGateways.TYPE, _disable: true }, params, options); } async _enable(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _BraintreeGateways.TYPE, _enable: true }, params, options); } async _check(id, params, options) { return this.resources.update({ id: typeof id === "string" ? id : id.id, type: _BraintreeGateways.TYPE, _check: true }, params, options); } isBraintreeGateway(resource) { return resource.type && resource.type === _BraintreeGateways.TYPE; } relationship(id) { return super.relationshipOneToOne(id); } relationshipToMany(...ids) { return super.relationshipOneToMany(...ids); } type() { return _BraintreeGateways.TYPE; } }; var instance = new BraintreeGateways(); var braintree_gateways_default = instance; exports.braintree_gateways_default = braintree_gateways_default; //# sourceMappingURL=chunk-UW6CNKMD.cjs.map //# sourceMappingURL=chunk-UW6CNKMD.cjs.map