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
Parameter | Description |
---|---|
paymentIntentId | The ID of the payment intent to which the card should be added. |
sellerId | The ID of the seller or merchant initiating the payment. |
cardTokenId | The token representing the card that the user wishes to add to the payment intent. |
Returns
Parameter | Description |
---|---|
isAdded | Indicates whether the card has been successfully added to the payment intent. |
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
Parameter | Description |
---|
Returns
Parameter | Description |
---|
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
Parameter | Description |
---|
Returns
Parameter | Description |
---|
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
Parameter | Description |
---|---|
paymentIntentId | The unique identifier of the payment intent to be canceled. |
sellerId | The ID of the seller or merchant initiating the cancellation. |
Returns
Parameter | Description |
---|---|
isCancelled | Indicates whether the payment intent has been successfully canceled. |
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
Parameter | Description |
---|---|
payoutId | The unique identifier of the payout to be canceled. |
Returns
Parameter | Description |
---|---|
isCancelled | Indicates whether the payout has been successfully canceled. |
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
Parameter | Description |
---|
Returns
Parameter | Description |
---|---|
identification | Card identification string. |
tokenId | Unique token ID for the identification. |
type | Type of identification (either "card" or "wire_transfer"). |
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
Parameter | Description |
---|---|
paymentIntentId | The unique identifier of the Payment Intent to be confirmed. |
sellerId | The ID of the seller or merchant initiating the confirmation. |
Returns
Parameter | Description |
---|---|
isConfirmed | Indicates whether the Payment Intent has been successfully confirmed. |
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
Parameter | Description |
---|---|
cardTokenId | The unique identifier for the card token. |
lastFourDigit | The last four digits of the user's card. |
Returns
Parameter | Description |
---|---|
isCreated | Indicates whether the card token was successfully created. |
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
Parameter | Description |
---|---|
userId | The unique identifier of the user initiating the payment. |
amount | The payment amount to be processed. |
currency | The currency in which the payment is to be made. |
Returns
Parameter | Description |
---|---|
isCreated | Indicates whether the Payment Intent was successfully created. |
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
Parameter | Description |
---|
Returns
Parameter | Description |
---|
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
Parameter | Description |
---|---|
amount | The amount to be transferred in the payout. |
currency | The currency in which the Payout is to be made. |
description | (Optional) A description for the Payout. |
Returns
Parameter | Description |
---|---|
isCreated | Indicates whether the payout was successfully created. |
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
Parameter | Description |
---|---|
amount | The amount to be transferred in the transfer. |
currency | The currency in which the transfer is to be made. |
destUserId | The unique identifier of the destination user or account. |
Returns
Parameter | Description |
---|---|
isCreated | Indicates whether the transfer was successfully created. |
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
Parameter | Description |
---|---|
cardTokenId | The unique identifier for the card token to be deleted. |
Returns
Parameter | Description |
---|---|
isDeleted | Indicates whether the card token was successfully deleted. |
hasAccount()
This method allows you to check whether the logged user has an SecrecyPay account.
client.pay.hasAccount(arg?: {}): Promise<{ hasAccount: boolean }>
Returns
Parameter | Description |
---|---|
hasAccount | Indicates whether the user has an account. |
getInvoice()
This method is used to retrieve invoice details.
client.pay.getInvoice(arg: {
appCode: string;
invoiceId: string;
}): Promise<SecrecyPayInvoice>
See: SecrecyPayInvoice
Parameters
Parameter | Description |
---|---|
appCode | The application code associated with the invoice. |
invoiceId | The unique identifier of the invoice. |
Returns
Parameter | Description |
---|---|
amountDue | The amount due on the invoice. |
amountPaid | The amount already paid on the invoice. |
amountRemaining | The remaining amount to be paid on the invoice. |
created | The timestamp when the invoice was created. |
currency | The currency of the invoice. |
id | The unique identifier of the invoice. |
paid | Indicates whether the invoice has been paid. |
accountCountry | The country associated with the account on the invoice (nullable). |
accountName | The name associated with the account on the invoice (nullable). |
applicationFeeAmount | The application fee amount on the invoice (nullable). |
attemptCount | The number of attempts made for the invoice. |
attempted | The timestamp when the invoice was last attempted. |
dueDate | The due date of the invoice. |
endingBalance | The ending balance on the invoice. |
hostedInvoiceUrl | The hosted URL of the invoice. |
invoicePdf | The URL of the invoice PDF. |
receiptNumber | The receipt number of the invoice. |
tax | The tax amount on the invoice. |
total | The total amount of the invoice. |
getInvoices()
This method is used to retrieve a list of logged user invoices.
client.pay.getInvoices(arg?: {}): Promise<SecrecyPayInvoice[]>
See: SecrecyPayInvoice
Returns
Parameter | Description |
---|---|
SecrecyPayInvoice[] | An array of invoice objects containing invoice details. |
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
Parameter | Description |
---|---|
isKycCompleted | Indicates whether the KYC process is completed for the user. |
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
Parameter | Description |
---|---|
userId | The ID of the user initiating the payment intent. |
amount | The payment amount for the payment intent. |
currency | The currency for the payment intent. |
paymentRequestId | The ID of the payment request associated with the intent. |
Returns
Parameter | Description |
---|---|
isValid | Indicates whether the payment intent is valid. |
onBoarding() TODO: ? Exposed ?
getSelfPaymentInfos() TODO: Recurly
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
Parameter | Description |
---|---|
paymentRequestId | The ID of the payment request to be collected. |
Returns
Parameter | Description |
---|
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
Parameter | Description |
---|
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
Parameter | Description |
---|---|
sellerId | The ID of the seller or merchant making the payment request. |
paymentRequestId | The ID of the payment request to be paid. |
Returns
Parameter | Description |
---|
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
Parameter | Description |
---|
getPayout()
This method is used to retrieve details of a payout.
client.pay.getPayout(arg: {
payoutId: string;
}): Promise<Record<string, unknown>>
Parameters
Parameter | Description |
---|---|
payoutId | The unique identifier of the payout to be retrieved. |
Returns
Parameter | Description |
---|
getPayouts()
This method is used to retrieve a list of payouts for the logged user.
client.pay.getPayouts(): Promise<Record<string, unknown>[]>
Returns
Parameter | Description |
---|
getTransaction()
This method is used to retrieve details of a transaction.
client.pay.getTransaction(arg: {
transactionId: string;
}): Promise<Record<string, unknown>>
Parameters
Parameter | Description |
---|---|
transactionId | The ID of the transaction to be retrieved. |
Returns
Parameter | Description |
---|
getTransfer()
This method is used to retrieve details of a transfer.
client.pay.getTransfer(arg: {
transferId: string;
}): Promise<Record<string, unknown>>
Parameters
Parameter | Description |
---|---|
transferId | The ID of the transfer to be retrieved. |
Returns
Parameter | Description |
---|
getTransfers()
This method is used to retrieve a list of transfers for the logged user.
client.pay.getTransfers(): Promise<Record<string, unknown>[]>