if the rejection occurs because of the gateway the reason will be an instance of {@link GatewayError} holding the following information
- subscriptionId
- a reference id to the subscription
- _original
- the original response from the payment gateway
Global
CreditCard
Model representing a credit card
CreditCard.withCreditCardNumber(number)
set the credit card number of the instance
Parameters
number: String, a string for the card number (no blank, no special character)
Returns: CreditCard, returns the instance
CreditCard.withExpirationMonth(month)
set the expiration month of the instance
Parameters
month: string, a two digit string for the expiration month of the credit card
Returns: CreditCard, returns the instance
CreditCard.withExpirationYear(year)
set the expiration year of the instance
Parameters
year: String, a two digit string for the expiration year of the credit card
Returns: CreditCard, returns the instance
CreditCard.withCvv(cvv)
set the cvv/cvv2/etc code of the instance
Parameters
cvv: String, a string for the cvv/cvv2/etc code
Returns: CreditCard, returns the instance
Global
SubscriptionPlan
model for subscription plan
SubscriptionPlan.withStartingDate(date)
set the starting date for the recurring payment
Parameters
date: Date | String, a javascript date or a string resulting to a valid Javascript Date when called with new Date()
Returns: SubscriptionPlan, - returns the instance
SubscriptionPlan.withIterationCount(count)
set the number of payments to be done within the plan duration
Parameters
count: String, the number of payments to be done within the plan duration
Returns: SubscriptionPlan, returns the instance
SubscriptionPlan.withPeriodUnit(unit)
set the interval time unit
Parameters
unit: String, interval unit ['month', 'day', 'week']
Returns: SubscriptionPlan, returns the instance
SubscriptionPlan.withPeriodLength(periodLength)
set the interval time value to be associated with the interval time unit
Parameters
periodLength: Number, an integer
Returns: SubscriptionPlan, returns the instance
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.