mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-07 19:54:15 +08:00
Do not update button links if response is not successful
This commit is contained in:
parent
24280dda3a
commit
4b85831f52
1 changed files with 5 additions and 0 deletions
|
@ -87,6 +87,11 @@ const ppcp_onboarding = {
|
||||||
}).then((res)=>{
|
}).then((res)=>{
|
||||||
return res.json();
|
return res.json();
|
||||||
}).then((data)=>{
|
}).then((data)=>{
|
||||||
|
if (!data.success) {
|
||||||
|
console.error(data);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
buttons.forEach((element) => {
|
buttons.forEach((element) => {
|
||||||
for (let [key, value] of Object.entries(data.data.signup_links)) {
|
for (let [key, value] of Object.entries(data.data.signup_links)) {
|
||||||
key = 'connect-to' + key.replace(/-/g, '');
|
key = 'connect-to' + key.replace(/-/g, '');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue