Observed since 20 Oct, 19:59 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
42-cent-base
structural interface for 42-cent adaptors
Node.js API abstraction for payment gateways.
Used by supported gateways listed in 42-cent.
It is important to note that the BaseGateway API will follow the semantic versioning rules so that:
basegateway()basegateway#submitTransaction()basegateway#authorizeTransaction()basegateway#getSettledBatchList()basegateway#refundTransaction()basegateway#voidTransaction()basegateway#createSubscription()basegateway#createCustomerProfile()basegateway#getCustomerProfile()basegateway#chargeCustomer()Authorize and capture a transaction.
parametersorder (object)
'amount' (string): The amount of the transaction.'creditCard' (object)
'creditCardNumber' (string): The credit card (PAN) number.'expirationMonth' (string): The month of credit card expiration date.'expirationYear' (string): The year of credit card expiration date (2 or 4 digits).'cvv' (string): The credit card security code (3 or 4 digits).prospect (object)
'customerFirstName' (string): First name of the customer (also used for the billing).'customerLastName' (string): Last name of the customer (also used for the billing).'customerEmail' (string): Email of the customer.'billingAddress' (string): Billing address.'billingCity' (string): Billing City'billingState' (string): Billing State'billingZip' (string): Billing Zip'billingCountry' (string): Billing Country'shippingFirstName' (string):'shippingLastName' (string):'shippingAddress' (string):'shippingCity' (string):'shippingState' (string):'shippingZip' (string):'shippingCountry' (string):other (object)
Other fields specific to a gateway SDK implementation.
Refer to specific SDK for more details.
return valueReturns a Promise with the following object as a result:
'transactionId' (string): A unique identifier of the transaction.'authCode' (string): Authorization code from the banking institution.'_original': The original response from the gateway.If the promise gets rejected because of the gateway, the reason will be an object instance of GatewayError holding the following attributes:
'message' (string): The error message from the gateway.'_original': The original response from the specific sdk implementation.Otherwise it will be an instance of Error.
Auhtorize a transaction.
parametersSee basegateway#submitTransaction().
get a batch list of settled transaction within the window of time
parametersfrom (Date): Lower limit.
to (Date, default: Date.now()): Upper limit.
return valueReturns a Promise with the following object as a result:
'batchList' (Array): An array of batch where a batch will have the following fields.
'batchId': The id the batch is referenced by in the gateway internal system.'settlementDate' (string): A string for the settlement date time (UTC).'chargeAmount' (string): The total amount from the charged transactions during the window of time.'chargeCount' (string): The total count of charged transactions during the window of time.'refundAmount' (string): The total amount from the refunded transactions during the window of time.'refundCount' (string): The total count of refund transactions during the window of time.'voidCount' (string): The total count of voided transactions during the window of time.'declineCount' (string): The total count of voided transactions during the window of time.'errorCount' (string): The total count of voided transactions during the window of time.Refund (or credit) a settled transaction.
parameterstransactionId (string): The id referencing the transaction to refund at the gateway.
options (object): Set of optional fields.
'amount': The amount to be refunded (useful for partial refund).return valueReturns a Promise with the following object as a result:
'_original': The original response from the gateway.If the promise gets rejected because of the gateway, the reason will be an object instance of GatewayError holding the following attributes:
'message' (string): The error message from the gateway.'_original': The original response from the specific sdk implementation.Otherwise it will be an instance of Error.
Void a non-settled transaction.
parameterstransactionId (string): The id referencing the transaction to void at the gateway.
options (object): Set of optional fields.
return valueReturns a Promise with the following object as a result:
'_original': The original response from the gateway.If the promise gets rejected because of the gateway, the reason will be an object instance of GatewayError holding the following attributes:
'message' (string): The error message from the gateway.'_original': The original response from the specific sdk implementation.Otherwise it will be an instance of Error.
Create a recurring payment.
parameterscreditCard: CreditCard | Object, the credit card associated to the payment
prospect: Prospect | Object, the prospect/customer linked to the subscription
subscriptionPlan: SubscriptionPlan | Object, a subscription plan Note that the tuple [periodUnit , periodLength] must result in a period supported by the gateway implementation otherwise periodUnit should take priority
other: Object, a set of options to be used by specific implementations
return valueReturns a Promise with the following object as a result:
'subscriptionId': An id referencing to the subscription at the gateway.'_original': The original response from the gateway.Create a customer profile in the gateway, useful to charge a customer without having to provide his payment method information again.
parameterspayment: CreditCard | Object, payment info to associate with the customer
billing: Object, billing info to associate with the customer
shipping: Object, shipping info to associate with the customer
other: Object, optional info related to a specific gateway implementation
return valueReturns a Promise with the following object as a result:
'profileId': A reference id to the customer profile.'_original': The original response from the payment gateway.Get a previously saved customer profile.
parametersprofileId (string): The id referencing to the customer profile in the gateway.
return valueReturns a Promise with the following object as a result:
if resolved the promise will have the same field than a Prospect instance plus a field payment holding a CreditCard
Submit a transaction (authorization and capture) using a customer profile.
parametersorder: Object, order information
prospect: Prospect, the prospect profile to charge, note that the prospect must have the field profileId set
other: Object, optional info related to a specific gateway implementation
return valueDownload counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
bluebirdEnvironment{
"local_name": "bluebird",
"alias": false,
"peer_metadata": null
} | ^2.3.2 | runtime |
lodashEnvironment{
"local_name": "lodash",
"alias": false,
"peer_metadata": null
} | ^2.4.1 | runtime |
gulpEnvironment{
"local_name": "gulp",
"alias": false,
"peer_metadata": null
} | ^3.8.8 | development |
gulp-concatEnvironment{
"local_name": "gulp-concat",
"alias": false,
"peer_metadata": null
} | ^2.4.0 | development |
jsdoxEnvironment{
"local_name": "jsdox",
"alias": false,
"peer_metadata": null
} | ^0.4.2 | development |
Source distribution
{
"shasum": "6572a89b47a72af19c67c3401b5c1dd30aa9b8bb",
"tarball": "https://registry.npmjs.org/42-cent-base/-/42-cent-base-0.8.0.tgz",
"integrity": "sha512-oH8xC9kIpWNtuMWdiA6bB67eQ7MeSM2R8HIfEvbBKebdwX6oMOy+Dfu2blzvr/nZv7L03yfrfARsj29Fa/QTJA==",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIQD5QaNU5BDdNqVv/34FOog4Dttnt2hXrJo0p5a/BAzV+AIgWthB5pUj6HP7rPyd3apROuZN/D4sOuPxYrafsFElRBQ="
}
]
}Shared repository data · GitHub
Observed since 20 Oct, 19:59 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:fbb2ebbb9e38bc2183fa346aaf2f3cdba40802f0fa8d19e5e63af42d7af237bb