bc-checkout-sdk
Version:
BetterCommerce's Checkout NodeJS SDK enables BC client applications to integrate with Checkout merchant API system. It publishes an interface to interact with [Checkout API](https://api-reference.checkout.com/#operation/getPaymentDetails/) endpoints.
45 lines (44 loc) • 2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ApplePayCertificate = void 0;
// Other Imports
const api_1 = require("../../api");
const RequestMethod_1 = require("../../constants/enums/RequestMethod");
class ApplePayCertificate {
/**
* Generate a certificate signing request. This will allow you to generate a certificate.
*
* API Reference - https://api-reference.checkout.com/#operation/generateApplePaySigningRequest
*
* @returns The result of the request. If the request was successful the result will contain the certificate signing request.
* If the request failed, it will contain an error message.
*/
async generateCSR() {
try {
const generateCSRResult = await api_1.Api.call(`applepay/signing-requests`, RequestMethod_1.RequestMethod.POST);
return generateCSRResult;
}
catch (error) {
return { hasError: true, error: error };
}
}
/**
* Upload an Apple Pay payment processing certificate. This method allows you to start processing payments via Apple Pay.
*
* API Reference - https://api-reference.checkout.com/#operation/uploadApplePayCertificate
*
* @param data {any} The certificate data to upload.
* @returns The result of the upload request. If the request was successful, the result will contain the details of the uploaded certificate.
* If the request failed, it will return an object containing an error message.
*/
async uploadApplePayCertificate(data) {
try {
const certificateUploadResult = await api_1.Api.call(`applepay/certificates`, RequestMethod_1.RequestMethod.POST, { content: data });
return certificateUploadResult;
}
catch (error) {
return { hasError: true, error: error };
}
}
}
exports.ApplePayCertificate = ApplePayCertificate;