mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Implement AXO order processing
Implement AXO settings
This commit is contained in:
parent
fe03215799
commit
c71c56973a
20 changed files with 546 additions and 136 deletions
|
@ -47,9 +47,13 @@ class AxoManager {
|
|||
this.billingView = new BillingView(this.el.billingAddressContainer.selector, this.el);
|
||||
this.cardView = new CardView(this.el.paymentContainer.selector + '-details', this.el, this);
|
||||
|
||||
document.testAxoStatus = (key, value) => {
|
||||
document.axoDebugSetStatus = (key, value) => {
|
||||
this.setStatus(key, value);
|
||||
}
|
||||
|
||||
document.axoDebugObject = (key, value) => {
|
||||
console.log(this);
|
||||
}
|
||||
}
|
||||
|
||||
registerEventHandlers() {
|
||||
|
@ -549,7 +553,8 @@ class AxoManager {
|
|||
onClickSubmitButton() {
|
||||
if (this.data.card) { // Ryan flow
|
||||
log('Ryan flow.');
|
||||
this.submit(this.data.card.getPaymentToken());
|
||||
console.log('this.data.card', this.data.card);
|
||||
this.submit(this.data.card.id);
|
||||
|
||||
} else { // Gary flow
|
||||
log('Gary flow.');
|
||||
|
|
|
@ -99,9 +99,19 @@ class FormFieldGroup {
|
|||
}
|
||||
|
||||
inputValue(name) {
|
||||
console.log('inputValue:name', this.fields[name].selector);
|
||||
const baseSelector = this.fields[name].selector;
|
||||
|
||||
return document.querySelector(this.fields[name].selector).value;
|
||||
const select = document.querySelector(baseSelector + ' input');
|
||||
if (select) {
|
||||
return select.value;
|
||||
}
|
||||
|
||||
const input = document.querySelector(baseSelector + ' input');
|
||||
if (input) {
|
||||
return input.value;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
|
||||
class MockData {
|
||||
|
||||
static cardComponent() {
|
||||
return {
|
||||
fields: {
|
||||
phoneNumber: {
|
||||
prefill: "1234567890"
|
||||
},
|
||||
cardholderName: {} // optionally pass this to show the card holder name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static cardComponentTokenize() {
|
||||
return {
|
||||
name: {
|
||||
fullName: "John Doe"
|
||||
},
|
||||
billingAddress: {
|
||||
addressLine1: "2211 North 1st St",
|
||||
adminArea1: "San Jose",
|
||||
adminArea2: "CA",
|
||||
postalCode: "95131",
|
||||
countryCode: "US"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export default MockData;
|
Loading…
Add table
Add a link
Reference in a new issue