mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Refactor AXO form submission
This commit is contained in:
parent
7a5d61bf2b
commit
0cb26c4457
6 changed files with 55 additions and 28 deletions
|
@ -91,14 +91,14 @@ class CardView {
|
|||
this.group.setData(data);
|
||||
}
|
||||
|
||||
copyDataToForm() {
|
||||
toSubmitData(data) {
|
||||
const name = this.group.dataValue('name');
|
||||
const { firstName, lastName } = this.splitName(name);
|
||||
|
||||
jQuery('#billing_first_name').val(firstName);
|
||||
jQuery('#billing_last_name').val(lastName);
|
||||
data['firstName'] = firstName;
|
||||
data['lastName'] = lastName;
|
||||
|
||||
return this.group.copyDataToForm();
|
||||
return this.group.toSubmitData(data);
|
||||
}
|
||||
|
||||
splitName(fullName) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue