mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
Fix code review ajustments
This commit is contained in:
parent
3b5a4b7f23
commit
25282b9514
3 changed files with 9 additions and 9 deletions
|
@ -74,7 +74,7 @@ class Item {
|
||||||
protected $tax_rate;
|
protected $tax_rate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The tax rate.
|
* The cart item key.
|
||||||
*
|
*
|
||||||
* @var string|null
|
* @var string|null
|
||||||
*/
|
*/
|
||||||
|
@ -192,7 +192,7 @@ class Item {
|
||||||
/**
|
/**
|
||||||
* Returns the cart key for this item.
|
* Returns the cart key for this item.
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function cart_item_key():?string {
|
public function cart_item_key():?string {
|
||||||
return $this->cart_item_key;
|
return $this->cart_item_key;
|
||||||
|
|
|
@ -3,7 +3,7 @@ import BookingProduct from "../Entity/BookingProduct";
|
||||||
import onApprove from '../OnApproveHandler/onApproveForContinue';
|
import onApprove from '../OnApproveHandler/onApproveForContinue';
|
||||||
import {payerData} from "../Helper/PayerData";
|
import {payerData} from "../Helper/PayerData";
|
||||||
import {PaymentMethods} from "../Helper/CheckoutMethodState";
|
import {PaymentMethods} from "../Helper/CheckoutMethodState";
|
||||||
import CartJanitor from "../Helper/CartJanitor";
|
import CartHelper from "../Helper/CartHelper";
|
||||||
import FormHelper from "../Helper/FormHelper";
|
import FormHelper from "../Helper/FormHelper";
|
||||||
|
|
||||||
class SingleProductActionHandler {
|
class SingleProductActionHandler {
|
||||||
|
@ -18,7 +18,7 @@ class SingleProductActionHandler {
|
||||||
this.updateCart = updateCart;
|
this.updateCart = updateCart;
|
||||||
this.formElement = formElement;
|
this.formElement = formElement;
|
||||||
this.errorHandler = errorHandler;
|
this.errorHandler = errorHandler;
|
||||||
this.cartJanitor = null;
|
this.cartHelper = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
subscriptionsConfiguration() {
|
subscriptionsConfiguration() {
|
||||||
|
@ -100,7 +100,7 @@ class SingleProductActionHandler {
|
||||||
|
|
||||||
createOrder()
|
createOrder()
|
||||||
{
|
{
|
||||||
this.cartJanitor = null;
|
this.cartHelper = null;
|
||||||
|
|
||||||
let getProducts = (() => {
|
let getProducts = (() => {
|
||||||
if ( this.isBookingProduct() ) {
|
if ( this.isBookingProduct() ) {
|
||||||
|
@ -139,7 +139,7 @@ class SingleProductActionHandler {
|
||||||
this.errorHandler.clear();
|
this.errorHandler.clear();
|
||||||
|
|
||||||
const onResolve = (purchase_units) => {
|
const onResolve = (purchase_units) => {
|
||||||
this.cartJanitor = (new CartJanitor()).addFromPurchaseUnits(purchase_units);
|
this.cartHelper = (new CartHelper()).addFromPurchaseUnits(purchase_units);
|
||||||
|
|
||||||
const payer = payerData();
|
const payer = payerData();
|
||||||
const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ?
|
const bnCode = typeof this.config.bn_codes[this.config.context] !== 'undefined' ?
|
||||||
|
@ -206,7 +206,7 @@ class SingleProductActionHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
cleanCart() {
|
cleanCart() {
|
||||||
this.cartJanitor.removeFromCart().then(() => {
|
this.cartHelper.removeFromCart().then(() => {
|
||||||
this.refreshMiniCart();
|
this.refreshMiniCart();
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
this.refreshMiniCart();
|
this.refreshMiniCart();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
class CartJanitor {
|
class CartHelper {
|
||||||
|
|
||||||
constructor(cartItemKeys = [])
|
constructor(cartItemKeys = [])
|
||||||
{
|
{
|
||||||
|
@ -62,4 +62,4 @@ class CartJanitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default CartJanitor;
|
export default CartHelper;
|
Loading…
Add table
Add a link
Reference in a new issue