@commercelayer/sdk
Version:
Commerce Layer Javascript SDK
51 lines (48 loc) • 2.34 kB
JavaScript
var chunkU22VLCMN_cjs = require('./chunk-U22VLCMN.cjs');
// src/resources/braintree_gateways.ts
var BraintreeGateways = class _BraintreeGateways extends chunkU22VLCMN_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 versions(braintreeGatewayId, params, options) {
const _braintreeGatewayId = braintreeGatewayId.id || braintreeGatewayId;
return this.resources.fetch({ type: "versions" }, `braintree_gateways/${_braintreeGatewayId}/versions`, 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);
}
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-RDTIBHZO.cjs.map
//# sourceMappingURL=chunk-RDTIBHZO.cjs.map
;