MCPcopy Create free account
hub / github.com/adearriba/ShopifyCheckoutJS / constructor

Method constructor

src/Methods/PaymentMethod.js:5–17  ·  view source on GitHub ↗
(element)

Source from the content-addressed store, hash-verified

3
4export class PaymentMethod extends SelectionMethod{
5 constructor(element){
6 if(!element.dataset.selectGateway)
7 throw new NotValidFieldException();
8
9 super(element);
10 Object.setPrototypeOf(this, PaymentMethod.prototype);
11
12 this.type = 'payment';
13 this.addEventListener('change', () => {
14 let event = new CustomEvent(`checkout:paymentmethod:changed`, { detail: this });
15 document.dispatchEvent(event);
16 });
17 }
18
19 addDescription(text){
20 let desc = this.nextElementSibling.querySelector('.blank-slate');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected