payment
x5engine.cart.payment
Kind: global class
Summary: Describe a payment method. Usually you don't want to directly instantiate this class but rather access to the instances created by WSX5 and stored in `x5engine.cart.manager`.
You may get them using `x5engine.cart.manager.payments()`.
- payment
- new payment(settings)
- .base() ⇒
Object - .id() ⇒
String - .price(totalAmount, vattype) ⇒
Number - .vat(totalAmount) ⇒
Number - .name() ⇒
String - .description() ⇒
String - .html() ⇒
String - .emailHtml() ⇒
String - .email() ⇒
String - .image() ⇒
String
new payment(settings)
Instantiate a new Payment object.
| Param | Type | Description |
|---|---|---|
| settings | Object |
The payment settings |
| settings.id | String |
The payment id |
| settings.name | String |
The shipping name |
| settings.description | String |
The shipping description |
| settings.image | String |
The image url for this payment type |
| settings.email | String |
The section to be sent in the email |
| settings.precision | String |
The numbers precision |
| settings.vat | String |
VAT as % |
| settings.vattype | String |
VAT type ("none", "included", "excluded") |
| settings.pricetype | String |
fixed |
| settings.price | String |
The price |
| settings.html | String |
The payment HTML code |
| settings.emailHtml | String |
.base() ⇒ Object
Return the settings of this payment type
Kind: instance method of payment
.id() ⇒ String
Return the id of this payment type
Kind: instance method of payment
.price(totalAmount, vattype) ⇒ Number
Provide the price of this payment type
Kind: instance method of payment
| Param | Type | Description |
|---|---|---|
| totalAmount | Number |
The total amount in the cart |
| vattype | String |
The type of vat (none |
.vat(totalAmount) ⇒ Number
Return the VAT of this payment type
Kind: instance method of payment
| Param | Type | Description |
|---|---|---|
| totalAmount | Number |
The total amount in the cart |
.name() ⇒ String
Provide the name of this payment type
Kind: instance method of payment
.description() ⇒ String
Return the description
Kind: instance method of payment
.html() ⇒ String
Provide the HTML code to be shown to the user to complete the payment
Kind: instance method of payment
.emailHtml() ⇒ String
Provide the HTML code to be shown in an email message
Kind: instance method of payment
.email() ⇒ String
Provide the description to show in the email section of the payment
Kind: instance method of payment
.image() ⇒ String
Provide the image url for this payment type
Kind: instance method of payment