-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:Automattic/woocommerce-payments …
…into add/duplicates-detection
- Loading branch information
Showing
232 changed files
with
2,200 additions
and
1,100 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Add an instructive error message when customer tries to use 2 different currencies for Stripe Billing subscriptions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix JS error when clicking GPay button on blocks checkout with subscription (w/sign up fee) in cart. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Add BNPL messaging to cart page. |
4 changes: 4 additions & 0 deletions
4
changelog/add-8167-remove-tos-links-that-are-not-needed-anymore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: update | ||
|
||
Remove ToS acceptance copy from all entrypoints in MOX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: add | ||
|
||
Not user-facing: hidden behind feature flag. Add an empty state view for the Payments Activity widget. This is shown when the merchant is yet to have any transactions over WooPayments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: dev | ||
|
||
Payments Activity - add scaffolding for Total Payment Volume. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix Decline button state for Accept loading on ToS modal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix collision between WooPayments header and Woo Express survey banner. |
4 changes: 4 additions & 0 deletions
4
changelog/fix-8134-update-ip-ruleset-after-core-country-change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Change IP country rule after country settings are changed in WC settings page |
4 changes: 4 additions & 0 deletions
4
changelog/fix-8301-fatal-error-when-connecting-jetpack-to-locqlhost
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix Fatal Error showing when connect to Jetpack on localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Remove incorrect "UTC" label from the time column of Transactions page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Fixed phpcs errors |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fix payment icons on connect page (Klarna, Afterpay) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: fix | ||
Comment: Not user-facing: hidden behind feature flag. Fixes payment activity visual bug in safari. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fixed Afterpay logo size on settings page |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Ignore alternative function WordPress PHPCS sniffs in the GH workflows and tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Significance: patch | ||
Type: dev | ||
Comment: Complete WooPay Tracks event migration and cleanup migration related code | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: fix | ||
|
||
Fixed optional billing field validation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: update | ||
|
||
Remove unwanted css overrides on the Payment activity widget wrapper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
refactor: reduce wp-data dependency on shortcode checkout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: update | ||
|
||
Replace deprecated filter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: patch | ||
Type: dev | ||
|
||
Updated PHPCS and sniffs used for static analysis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Significance: minor | ||
Type: update | ||
|
||
Updated Link by Stripe logo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Internal dependencies | ||
*/ | ||
import { renderBNPLCartMessaging } from './product-details'; | ||
|
||
const { registerPlugin } = window.wp.plugins; | ||
|
||
// Register BNPL site messaging on the cart block. | ||
registerPlugin( 'bnpl-site-messaging', { | ||
render: renderBNPLCartMessaging, | ||
scope: 'woocommerce-checkout', | ||
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { | ||
Elements, | ||
PaymentMethodMessagingElement, | ||
} from '@stripe/react-stripe-js'; | ||
import { select } from '@wordpress/data'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { getAppearance, getFontRulesFromPage } from 'wcpay/checkout/upe-styles'; | ||
import { getUPEConfig } from 'utils/checkout'; | ||
import WCPayAPI from '../../checkout/api'; | ||
import request from '../../checkout/utils/request'; | ||
import { useEffect, useState } from 'react'; | ||
|
||
// Create an API object, which will be used throughout the checkout. | ||
const api = new WCPayAPI( | ||
{ | ||
publishableKey: getUPEConfig( 'publishableKey' ), | ||
accountId: getUPEConfig( 'accountId' ), | ||
forceNetworkSavedCards: getUPEConfig( 'forceNetworkSavedCards' ), | ||
locale: getUPEConfig( 'locale' ), | ||
}, | ||
request | ||
); | ||
|
||
const isInEditor = () => { | ||
const editorStore = select( 'core/editor' ); | ||
|
||
return !! editorStore; | ||
}; | ||
|
||
// BNPL only supports 2 decimal places. | ||
const normalizeAmount = ( amount, decimalPlaces = 2 ) => { | ||
return amount * Math.pow( 10, 2 - decimalPlaces ); | ||
}; | ||
|
||
const { ExperimentalOrderMeta } = window.wc.blocksCheckout; | ||
|
||
const ProductDetail = ( { cart, context } ) => { | ||
const [ appearance, setAppearance ] = useState( | ||
getUPEConfig( 'upeBnplCartBlockAppearance' ) || {} | ||
); | ||
|
||
const [ fontRules ] = useState( getFontRulesFromPage() ); | ||
|
||
useEffect( () => { | ||
async function generateUPEAppearance() { | ||
// Generate UPE input styles. | ||
let upeAppearance = getAppearance( 'bnpl_cart_block' ); | ||
upeAppearance = await api.saveUPEAppearance( | ||
upeAppearance, | ||
'bnpl_cart_block' | ||
); | ||
setAppearance( upeAppearance ); | ||
} | ||
|
||
if ( Object.keys( appearance ).length === 0 ) { | ||
generateUPEAppearance(); | ||
} | ||
}, [ appearance ] ); | ||
|
||
if ( Object.keys( appearance ).length === 0 ) { | ||
return null; | ||
} | ||
|
||
if ( context !== 'woocommerce/cart' ) { | ||
return null; | ||
} | ||
|
||
const cartTotal = normalizeAmount( | ||
cart.cartTotals.total_price, | ||
wcSettings.currency.precision | ||
); | ||
|
||
const { | ||
country, | ||
paymentMethods, | ||
currencyCode, | ||
} = window.wcpayStripeSiteMessaging; | ||
|
||
const amount = parseInt( cartTotal, 10 ) || 0; | ||
|
||
const options = { | ||
amount: amount, | ||
currency: currencyCode || 'USD', | ||
paymentMethodTypes: paymentMethods || [], | ||
countryCode: country, // Customer's country or base country of the store. | ||
}; | ||
|
||
const stripe = api.getStripe(); | ||
|
||
return ( | ||
<div className="wc-block-components-bnpl-wrapper"> | ||
<Elements | ||
stripe={ stripe } | ||
options={ { appearance, fonts: fontRules } } | ||
> | ||
<PaymentMethodMessagingElement options={ options } /> | ||
</Elements> | ||
</div> | ||
); | ||
}; | ||
|
||
export const renderBNPLCartMessaging = () => { | ||
if ( isInEditor() ) { | ||
return null; | ||
} | ||
return ( | ||
<ExperimentalOrderMeta> | ||
<ProductDetail /> | ||
</ExperimentalOrderMeta> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.