Pay

Pay

Welcome to the technical documentation of Secrecy Pay, an innovative online payment application that empowers users to fund their digital wallets and make purchases while safeguarding the privacy and confidentiality of their transactions. At Secrecy Pay, we have built our platform on the foundation of the Stripe API, combining seamless payments with the utmost protection of user data.

In today's digital age, privacy and data security have become paramount concerns for users engaging in online transactions. Secrecy Pay is designed to address these concerns by allowing users to load their digital wallets and make payments without exposing the details of their purchases to banks or other financial institutions.

This documentation will provide developers with a comprehensive understanding of the technical aspects of Secrecy Pay and how to integrate it into their applications. You will find detailed information on the API endpoints, authentication methods, and best practices for implementing Secrecy Pay within your projects.

We are excited to have you on board and to help you harness the power of Secrecy Pay in building secure, private, and user-friendly online payment experiences. Let's get started on this journey to provide a seamless and confidential payment solution for your users.

Please refer to the sections below for a deep dive into the technical intricacies of Secrecy Pay. If you have any questions or need further assistance, our support team is here to assist you.

addCardToPaymentIntent()

This method is responsible for associating a card with a specific Payment Intent within Secrecy Pay. By linking a card to a payment intent, you enable the payment process to be executed seamlessly and securely.

client.pay.addCardToPaymentIntent(arg: {
    paymentIntentId: string;
    sellerId: string;
    cardTokenId: string;
}): Promise<{ isAdded: boolean }>

Parameters

ParameterDescription
paymentIntentIdThe ID of the payment intent to which the card should be added.
sellerIdThe ID of the seller or merchant initiating the payment.
cardTokenIdThe token representing the card that the user wishes to add to the payment intent.

Returns

ParameterDescription
isAddedIndicates whether the card has been successfully added to the payment intent.
🔒
Auth: Secrecy

getBalanceTransaction() (TODO)

This method allows you to retrieve a list of transactions about a Secrecy Pay balance. A balance transaction represents a financial event in the system, such as a payment, refund, or fee. The transactions are returned in sorted order, with the most recent transactions appearing first.

client.pay.getBalanceTransaction(arg?: {}): Promise<Record<string, any>>

Parameters

ParameterDescription

Returns

ParameterDescription
🔒
Auth: Secrecy

retreiveBalance() (TODO)

This method allows you to retrieve information about the current balance in your Secrecy Pay account. The balance represents the total amount of funds available to you for transactions and payouts.

client.pay.retreiveBalance(arg?: {}): Promise<Record<string, any>>

Parameters

ParameterDescription

Returns

ParameterDescription
🔒
Auth: Secrecy

cancelPaymentIntent() (TODO:RECURLY)

This method enables you to cancel a payment intent, effectively voiding a payment operation. Use this method when you need to cancel a transaction initiated by a user or seller.

client.pay.cancelPaymentIntent(arg: {
	paymentIntentId: string;
	sellerId: string;
}): Promise<{ isCancelled: boolean }>

Parameters

ParameterDescription
paymentIntentIdThe unique identifier of the payment intent to be canceled.
sellerIdThe ID of the seller or merchant initiating the cancellation.

Returns

ParameterDescription
isCancelledIndicates whether the payment intent has been successfully canceled.
🔒
Auth: Secrecy

cancelPayout()

This method allows you to cancel a payout operation. A previously created payout can be canceled if it has not yet been paid out. Funds will be refunded to your available balance.

client.pay.cancelPayout(arg: {
    payoutId: string;
}): Promise<{ isCancelled: boolean }>

Parameters

ParameterDescription
payoutIdThe unique identifier of the payout to be canceled.

Returns

ParameterDescription
isCancelledIndicates whether the payout has been successfully canceled.
🔒
Auth: Secrecy

getCardIdentification()

This method retrieves information about card identification. It returns a list of card identifications, including details such as the identification string, token ID, and card type.

client.pay.getCardIdentification(arg?: {}): Promise<{
    identification: string;
    tokenId: string;
    type: "card" | "wire_transfer";
}[]>

Parameters

ParameterDescription

Returns

ParameterDescription
identificationCard identification string.
tokenIdUnique token ID for the identification.
typeType of identification (either "card" or "wire_transfer").
🔒
Auth: Secrecy

confirmPaymentIntent()

This method is used to confirm a payment intent. Confirming a payment intent finalizes a payment operation, ensuring that the transaction is completed successfully.

client.pay.confirmPaymentIntent(arg: {
    paymentIntentId: string;
    sellerId: string;
}): Promise<{ isConfirmed: boolean }>

Parameters

ParameterDescription
paymentIntentIdThe unique identifier of the Payment Intent to be confirmed.
sellerIdThe ID of the seller or merchant initiating the confirmation.

Returns

ParameterDescription
isConfirmedIndicates whether the Payment Intent has been successfully confirmed.
🔒
Auth: Secrecy

createCardToken()

This method is used to create a card token. A card token is a secure representation of a user's card information, allowing for safe and convenient payment operations.

client.pay.createCardToken(arg: {
    cardTokenId: string;
    lastFourDigit: string;
}): Promise<{ isCreated: boolean }>

Parameters

ParameterDescription
cardTokenIdThe unique identifier for the card token.
lastFourDigitThe last four digits of the user's card.

Returns

ParameterDescription
isCreatedIndicates whether the card token was successfully created.
🔒
Auth: Secrecy

createPaymentIntent()

This method is used to create a payment intenty. A payment intent represents an intention to make a payment and is the initial step in the payment process.

client.pay.createPaymentIntent(arg: {
    userId: string;
    amount: number;
    currency: string;
}): Promise<{ isCreated: boolean }>

Parameters

ParameterDescription
userIdThe unique identifier of the user initiating the payment.
amountThe payment amount to be processed.
currencyThe currency in which the payment is to be made.

Returns

ParameterDescription
isCreatedIndicates whether the Payment Intent was successfully created.
🔒
Auth: Secrecy

createPayment() (TODO:RECURY)

client.pay. createPayment(arg: {
    planCode: string;
    paymentInput: {
        number: string;
        type: "classic" | "secure";
        token: string;
        firstName: string;
        lastName: string;
        street: string;
        postalCode: string;
        city: string;
        country: string;
        month: string;
        year: string;
        cvv: string;
    };
    autoRenew: boolean | null;
}): Promise<{ isPayed: boolean }>

Parameters

ParameterDescription

Returns

ParameterDescription
🔒
Auth: Secrecy

createPayout()

To send funds to your own bank account, you create a new payout object. Your Secrecy Pay balance must be able to cover the payout amount, or you'll receive an “Insufficient Funds” error.

If your API key is in test mode, money won't actually be sent, though everything else will occur as if in live mode.

If you are creating a manual payout on a Stripe account that uses multiple payment source types, you'll need to specify the source type balance that the payout should draw from. The balance object details available and pending amounts by source type.

client.pay.createPayout(arg: {
    amount: number;
    currency: string;
    description?: string | null | undefined;
}): Promise<{ isCreated: boolean }>

Parameters

ParameterDescription
amountThe amount to be transferred in the payout.
currencyThe currency in which the Payout is to be made.
description(Optional) A description for the Payout.

Returns

ParameterDescription
isCreatedIndicates whether the payout was successfully created.
🔒
Auth: Secrecy

createTransfer()

To send funds from your Secrecy Pay account to a connected account, you create a new transfer object. Your Secrecy Pay balance must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error.

client.pay.createTransfer(arg: {
    amount: number;
    currency: string;
    destUserId: string;
}): Promise<{ isCreated: boolean }>

Parameters

ParameterDescription
amountThe amount to be transferred in the transfer.
currencyThe currency in which the transfer is to be made.
destUserIdThe unique identifier of the destination user or account.

Returns

ParameterDescription
isCreatedIndicates whether the transfer was successfully created.
🔒
Auth: Secrecy

deleteCardToken()

This method is used to delete a card token. Deleting a card token removes the secure representation of a user's card information.

client.pay.deleteCardToken(arg: {
    cardTokenId: string;
}): Promise<{ isDeleted: boolean }>

Parameters

ParameterDescription
cardTokenIdThe unique identifier for the card token to be deleted.

Returns

ParameterDescription
isDeletedIndicates whether the card token was successfully deleted.
🔒
Auth: Secrecy

hasAccount()

This method allows you to check whether the logged user has an SecrecyPay account.

client.pay.hasAccount(arg?: {}): Promise<{ hasAccount: boolean }>

Returns

ParameterDescription
hasAccountIndicates whether the user has an account.
🔒
Auth: Secrecy

getInvoice()

This method is used to retrieve invoice details.

client.pay.getInvoice(arg: {
    appCode: string;
    invoiceId: string;
}): Promise<SecrecyPayInvoice>

See: SecrecyPayInvoice

Parameters

ParameterDescription
appCodeThe application code associated with the invoice.
invoiceIdThe unique identifier of the invoice.

Returns

ParameterDescription
amountDueThe amount due on the invoice.
amountPaidThe amount already paid on the invoice.
amountRemainingThe remaining amount to be paid on the invoice.
createdThe timestamp when the invoice was created.
currencyThe currency of the invoice.
idThe unique identifier of the invoice.
paidIndicates whether the invoice has been paid.
accountCountryThe country associated with the account on the invoice (nullable).
accountNameThe name associated with the account on the invoice (nullable).
applicationFeeAmountThe application fee amount on the invoice (nullable).
attemptCountThe number of attempts made for the invoice.
attemptedThe timestamp when the invoice was last attempted.
dueDateThe due date of the invoice.
endingBalanceThe ending balance on the invoice.
hostedInvoiceUrlThe hosted URL of the invoice.
invoicePdfThe URL of the invoice PDF.
receiptNumberThe receipt number of the invoice.
taxThe tax amount on the invoice.
totalThe total amount of the invoice.
🔒
Auth: Secrecy

getInvoices()

This method is used to retrieve a list of logged user invoices.

client.pay.getInvoices(arg?: {}): Promise<SecrecyPayInvoice[]>

See: SecrecyPayInvoice

Returns

ParameterDescription
SecrecyPayInvoice[]An array of invoice objects containing invoice details.
🔒
Auth: Secrecy

isKycCompleted()

This method allows you to check whether the Know Your Customer (KYC) process is completed for a user in Secrecy Pay.

client.pay.isKycCompleted(arg?: {}): Promise<{ isKycCompleted: boolean }>

Returns

ParameterDescription
isKycCompletedIndicates whether the KYC process is completed for the user.
🔒
Auth: Secrecy

isValidPaymentIntent()

This method allows you to check the validity of a payment intent.

client.pay.isValidPaymentIntent(arg: {
    userId: string;
    amount: number;
    currency: string;
    paymentRequestId: string;
}): Promise<{ isValid: boolean }>

Parameters

ParameterDescription
userIdThe ID of the user initiating the payment intent.
amountThe payment amount for the payment intent.
currencyThe currency for the payment intent.
paymentRequestIdThe ID of the payment request associated with the intent.

Returns

ParameterDescription
isValidIndicates whether the payment intent is valid.
🔒
Auth: Secrecy

onBoarding() TODO: ? Exposed ?


getSelfPaymentInfos() TODO: Recurly

🔒
Auth: Secrecy
client.pay.getSelfPaymentInfos(arg?: {}): Promise<unknown>

getPaymentRequestToCollect() TODO: TYPES

This method is used to retrieve a payment request to collect.

client.pay.getPaymentRequestToCollect(arg: {
    paymentRequestId: string;
}): Promise<Record<string, unknown>>

Parameters

ParameterDescription
paymentRequestIdThe ID of the payment request to be collected.

Returns

ParameterDescription
🔒
Auth: Secrecy

getPaymentRequestsToCollect() TODO: TYPES

This method is used to retrieve a list of payment requests to collect for the logger user.

client.pay.getPaymentRequestsToCollect(): Promise<Record<string, unknown>>

Returns

ParameterDescription
🔒
Auth: Secrecy

getPaymentRequestToPay() TODO: TYPES

This method is used to retrieve a payment request for payment.

client.pay.getPaymentRequestToPay({
    sellerId: string;
    paymentRequestId: string;
}): Promise<Record<string, unknown>>

Parameters

ParameterDescription
sellerIdThe ID of the seller or merchant making the payment request.
paymentRequestIdThe ID of the payment request to be paid.

Returns

ParameterDescription
🔒
Auth: Secrecy

getPaymentRequestsToPay() TODO: TYPES

This method is used to retrieve a list of payment requests to pay for the logger user.

client.pay.getPaymentRequestsToPay(): Promise<Record<string, unknown>>

Returns

ParameterDescription
🔒
Auth: Secrecy

getPayout()

This method is used to retrieve details of a payout.

client.pay.getPayout(arg: {
    payoutId: string;
}): Promise<Record<string, unknown>>

Parameters

ParameterDescription
payoutIdThe unique identifier of the payout to be retrieved.

Returns

ParameterDescription
🔒
Auth: Secrecy

getPayouts()

This method is used to retrieve a list of payouts for the logged user.

client.pay.getPayouts(): Promise<Record<string, unknown>[]>

Returns

ParameterDescription
🔒
Auth: Secrecy

getTransaction()

This method is used to retrieve details of a transaction.

client.pay.getTransaction(arg: {
    transactionId: string;
}): Promise<Record<string, unknown>>

Parameters

ParameterDescription
transactionIdThe ID of the transaction to be retrieved.

Returns

ParameterDescription
🔒
Auth: Secrecy

getTransfer()

This method is used to retrieve details of a transfer.

client.pay.getTransfer(arg: {
    transferId: string;
}): Promise<Record<string, unknown>>

Parameters

ParameterDescription
transferIdThe ID of the transfer to be retrieved.

Returns

ParameterDescription
🔒
Auth: Secrecy

getTransfers()

This method is used to retrieve a list of transfers for the logged user.

client.pay.getTransfers(): Promise<Record<string, unknown>[]>