@figuredev/payments-sdk
Advanced tools
Comparing version 0.15.0 to 0.16.0
import { UserContext } from "./utils"; | ||
import { PaymentAuthTokenDTO, PaymentGatewayDTO, PaymentResponseDTO, PaymentRequestDTO, PaymentInitializedResponseDTO } from "./types"; | ||
import { PaymentAuthTokenDTO, PaymentGatewayDTO, PaymentInitializedResponseDTO, PaymentInputDTO, PaymentRequestDTO, PaymentResponseDTO } from "./types"; | ||
declare type PaymentsClientConfig = { | ||
@@ -16,2 +16,3 @@ baseUrl: string; | ||
void(ctx: UserContext, id: string, referenceId: string): Promise<PaymentInitializedResponseDTO>; | ||
tokenize(ctx: UserContext, id: string, gateway: PaymentGatewayDTO, data: PaymentInputDTO): Promise<PaymentInitializedResponseDTO>; | ||
cancel(ctx: UserContext, id: string): Promise<void>; | ||
@@ -18,0 +19,0 @@ getPaymentInfo(ctx: UserContext, id: string): Promise<PaymentResponseDTO>; |
@@ -113,2 +113,19 @@ "use strict"; | ||
} | ||
tokenize(ctx, id, gateway, data) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return yield axios_1.default | ||
.request({ | ||
baseURL: this.config.baseUrl, | ||
method: "POST", | ||
url: `/payment/${id}`, | ||
headers: (0, utils_1.constructHeaders)(this.config.secret, ctx), | ||
data: { | ||
command: types_1.PaymentCommandDTO.Tokenize, | ||
gateway: gateway, | ||
input: data, | ||
}, | ||
}) | ||
.then((r) => r.data); | ||
}); | ||
} | ||
cancel(ctx, id) { | ||
@@ -115,0 +132,0 @@ return __awaiter(this, void 0, void 0, function* () { |
{ | ||
"name": "@figuredev/payments-sdk", | ||
"version": "0.15.0", | ||
"version": "0.16.0", | ||
"license": "ISC", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
22841
397
0