From 49c77b01467ea545b5df4c33f7d495e03549a4ba Mon Sep 17 00:00:00 2001 From: williangaspar Date: Wed, 8 May 2019 15:02:23 -0300 Subject: [PATCH] credit card token --- dist/sdk/ecommerce/creditCard.d.ts | 2 ++ dist/sdk/ecommerce/creditCard.js | 13 +++++++++++++ dist/sdk/ecommerce/creditCard.js.map | 2 +- sdk/ecommerce/creditCard.ts | 10 +++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/dist/sdk/ecommerce/creditCard.d.ts b/dist/sdk/ecommerce/creditCard.d.ts index 5ad892e..e294f2d 100644 --- a/dist/sdk/ecommerce/creditCard.d.ts +++ b/dist/sdk/ecommerce/creditCard.d.ts @@ -2,4 +2,6 @@ import { Card } from './card'; import { PaymentType } from './paymentType'; export declare class CreditCard extends Card { protected type: PaymentType; + cardToken: string; + setCardToken(cardToken: string): this; } diff --git a/dist/sdk/ecommerce/creditCard.js b/dist/sdk/ecommerce/creditCard.js index da341ff..58bc95a 100644 --- a/dist/sdk/ecommerce/creditCard.js +++ b/dist/sdk/ecommerce/creditCard.js @@ -5,6 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; Object.defineProperty(exports, "__esModule", { value: true }); const card_1 = require("./card"); const paymentType_1 = require("./paymentType"); @@ -13,8 +16,18 @@ let CreditCard = class CreditCard extends card_1.Card { constructor() { super(...arguments); this.type = paymentType_1.PaymentType.CreditCard; + this.cardToken = undefined; + } + ; + setCardToken(cardToken) { + this.cardToken = cardToken; + return this; } }; +__decorate([ + json2typescript_1.JsonProperty('ardToken', String, true), + __metadata("design:type", String) +], CreditCard.prototype, "cardToken", void 0); CreditCard = __decorate([ json2typescript_1.JsonObject('CreditCard') ], CreditCard); diff --git a/dist/sdk/ecommerce/creditCard.js.map b/dist/sdk/ecommerce/creditCard.js.map index 506b4f5..5397577 100644 --- a/dist/sdk/ecommerce/creditCard.js.map +++ b/dist/sdk/ecommerce/creditCard.js.map @@ -1 +1 @@ -{"version":3,"file":"creditCard.js","sourceRoot":"","sources":["../../../sdk/ecommerce/creditCard.ts"],"names":[],"mappings":";;;;;;;;AAAA,iCAA8B;AAC9B,+CAA4C;AAC5C,qDAA6C;AAG7C,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,WAAI;IADpC;;QAEY,SAAI,GAAgB,yBAAW,CAAC,UAAU,CAAC;IACvD,CAAC;CAAA,CAAA;AAFY,UAAU;IADtB,4BAAU,CAAC,YAAY,CAAC;GACZ,UAAU,CAEtB;AAFY,gCAAU"} \ No newline at end of file +{"version":3,"file":"creditCard.js","sourceRoot":"","sources":["../../../sdk/ecommerce/creditCard.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAA8B;AAC9B,+CAA4C;AAC5C,qDAA2D;AAG3D,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,WAAI;IADpC;;QAEY,SAAI,GAAgB,yBAAW,CAAC,UAAU,CAAC;QAG9C,cAAS,GAAW,SAAS,CAAC;IAMvC,CAAC;IANsC,CAAC;IAE/B,YAAY,CAAC,SAAiB;QACrC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACb,CAAC;CACD,CAAA;AANC;IADC,8BAAY,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC;;6CACF;AAJ1B,UAAU;IADtB,4BAAU,CAAC,YAAY,CAAC;GACZ,UAAU,CAUtB;AAVY,gCAAU"} \ No newline at end of file diff --git a/sdk/ecommerce/creditCard.ts b/sdk/ecommerce/creditCard.ts index 01b1c96..b81329b 100644 --- a/sdk/ecommerce/creditCard.ts +++ b/sdk/ecommerce/creditCard.ts @@ -1,8 +1,16 @@ import { Card } from './card'; import { PaymentType } from './paymentType'; -import { JsonObject } from 'json2typescript'; +import { JsonObject, JsonProperty } from 'json2typescript'; @JsonObject('CreditCard') export class CreditCard extends Card { protected type: PaymentType = PaymentType.CreditCard; + + @JsonProperty('ardToken', String, true) + public cardToken: string = undefined;; + + public setCardToken(cardToken: string) { + this.cardToken = cardToken; + return this; + } }