42-cent-base
Interface to implement by 42-cent adaptor. See documentation for more information.
Global
submitTransaction(order, creditCard, prospect, other)
authorize and capture a transaction.
all values must be Strings
Parameters
order: Object, the fields related to the order
- amount
- the amount of the transaction
creditCard: Object, object holding credit card information
- creditCardNumber
- the credit card number used for the transaction - a string with card number digit, no blank, no dash, etc
- expirationMonth - two digit string : 01 -> 12
- The month of credit card expiration date
- expirationYear
- The year of credit card expiration date - four or two digits string 2016 or 16
- cvv
- the credit card cvv number
prospect: Object, the fields related to the prospect
- customerFirstName
- first name of the customer (also used for the billing)
- customerLastName(also used for the billing)
- last name of the customer
- customerEmail(also used for the billing)
- email of the customer
- billingAddress
- the billing address
- billingCity
- the billing city
- billingState
- the billing state
- billingZip
- billing zip code
- billingCountry
- the billing country
- shippingFirstName
- the shipping first name
- shippingLastName
- the shipping last name
- shippingAddress
- the shipping address
- shippingCity
- the shipping city
- shippingState
- the shipping state
- shippingZip
- shipping zip code
- shippingCountry
- the shipping country
other: Object, other field specific to a gateway sdk implementation. refer to specific sdk for more details
Returns: Promise, - the promise will have these different fields
if resolved
- transactionId
- A unique identifier of the transaction.
- authCode
- authorization code from the banking institution
- _original
-
- the original response from the specific sdk implementation
-
if rejected
if the rejection occurs because of the gateway the reason will be an instance of {@link GatewayError} holding the following information
- message
- The error message from the gateway
- _original
- The original response from the specific sdk implementation
otherwise it will be an instance of standard javascript Error
getSettledBatchList(from, to)
get a batch list of settled transaction within the window of time
Parameters
from: String | Date, Lower limit. If String, it must be a valid date string: a string which will result in a valid Javascript Date object if passed as argument of the Date constructor
to: String | Date, Upper limit (or today if not provided). If String, it must be a valid date string: a string which will result in a valid Javascript Date object if passed as argument of the Date constructor
Returns: Promise, - The promise should resolve with the following fields
- batchList
- 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
- A string for the settlement date time (UTC)
- chargeAmount
- the total amount from the charged transactions during the window of time
- chargeCount
- the total count of charged transactions during the window of time
- refundAmount
- the total amount from the refunded transactions during the window of time
- refundCount
- the total count of refund transactions during the window of time
- voidCount
- the total count of voided transactions during the window of time
- declineCount
- the total count of voided transactions during the window of time
- errorCount
- the total count of voided transactions during the window of time
license
42-cent-base module is under MIT license:
Copyright (C) 2014 Laurent Renard.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
(the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.