@@ -153,11 +153,11 @@ public function angelleye_ppcp_multi_account_generate_signup_link($post_id) {
153153 'testmode ' => $ testmode ,
154154 'return_url ' => add_query_arg (array ('testmode ' => $ testmode , 'post_id ' => $ post_id ), WC ()->api_request_url ('AngellEYE_PayPal_PPCP_Seller_Onboarding ' )),
155155 'return_url_description ' => __ (
156- 'Return to your shop. ' , 'paypal-for-woocommerce '
156+ 'Return to your shop. ' , 'paypal-for-woocommerce '
157157 ),
158158 'products ' => array (
159159 $ this ->dcc_applies ->for_country_currency () ? 'PPCP ' : 'EXPRESS_CHECKOUT ' ,
160- ));
160+ ));
161161 $ host_url = $ this ->ppcp_host . 'generate-signup-link ' ;
162162 $ args = array (
163163 'method ' => 'POST ' ,
@@ -220,14 +220,14 @@ private function default_data() {
220220 $ default_data = array (
221221 'testmode ' => $ testmode ,
222222 'return_url ' => admin_url (
223- 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&testmode= ' . $ testmode
223+ 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&testmode= ' . $ testmode
224224 ),
225225 'return_url_description ' => __ (
226- 'Return to your shop. ' , 'paypal-for-woocommerce '
226+ 'Return to your shop. ' , 'paypal-for-woocommerce '
227227 ),
228228 'products ' => array (
229229 $ this ->dcc_applies ->for_country_currency () ? 'PPCP ' : 'EXPRESS_CHECKOUT '
230- ));
230+ ));
231231 $ country = $ this ->dcc_applies ->country ();
232232 if (!empty ($ country )) {
233233 if (in_array ($ this ->dcc_applies ->country (), $ this ->dcc_applies ->apple_google_vault_supported_country )) {
@@ -249,10 +249,10 @@ public function ppcp_apple_pay_data() {
249249 return array (
250250 'testmode ' => $ testmode ,
251251 'return_url ' => admin_url (
252- 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&feature_activated=applepay&testmode= ' . $ testmode
252+ 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&feature_activated=applepay&testmode= ' . $ testmode
253253 ),
254254 'return_url_description ' => __ (
255- 'Return to your shop. ' , 'paypal-for-woocommerce '
255+ 'Return to your shop. ' , 'paypal-for-woocommerce '
256256 ),
257257 'capabilities ' => array (
258258 'APPLE_PAY '
@@ -261,18 +261,18 @@ public function ppcp_apple_pay_data() {
261261 'products ' => array (
262262 $ this ->dcc_applies ->for_country_currency () ? 'PPCP ' : 'EXPRESS_CHECKOUT ' ,
263263 'PAYMENT_METHODS '
264- ));
264+ ));
265265 }
266266
267267 public function ppcp_google_pay_data () {
268268 $ testmode = ($ this ->is_sandbox ) ? 'yes ' : 'no ' ;
269269 return array (
270270 'testmode ' => $ testmode ,
271271 'return_url ' => admin_url (
272- 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&feature_activated=googlepay&testmode= ' . $ testmode
272+ 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&feature_activated=googlepay&testmode= ' . $ testmode
273273 ),
274274 'return_url_description ' => __ (
275- 'Return to your shop. ' , 'paypal-for-woocommerce '
275+ 'Return to your shop. ' , 'paypal-for-woocommerce '
276276 ),
277277 'capabilities ' => array (
278278 'GOOGLE_PAY '
@@ -281,18 +281,18 @@ public function ppcp_google_pay_data() {
281281 'products ' => array (
282282 $ this ->dcc_applies ->for_country_currency () ? 'PPCP ' : 'EXPRESS_CHECKOUT ' ,
283283 'PAYMENT_METHODS '
284- ));
284+ ));
285285 }
286286
287287 public function ppcp_vault_data () {
288288 $ testmode = ($ this ->is_sandbox ) ? 'yes ' : 'no ' ;
289289 return array (
290290 'testmode ' => $ testmode ,
291291 'return_url ' => admin_url (
292- 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&testmode= ' . $ testmode
292+ 'admin.php?page=wc-settings&tab=checkout§ion=angelleye_ppcp&testmode= ' . $ testmode
293293 ),
294294 'return_url_description ' => __ (
295- 'Return to your shop. ' , 'paypal-for-woocommerce '
295+ 'Return to your shop. ' , 'paypal-for-woocommerce '
296296 ),
297297 'capabilities ' => array (
298298 'PAYPAL_WALLET_VAULTING_ADVANCED '
@@ -301,7 +301,7 @@ public function ppcp_vault_data() {
301301 'products ' => array (
302302 $ this ->dcc_applies ->for_country_currency () ? 'PPCP ' : 'EXPRESS_CHECKOUT ' ,
303303 'ADVANCED_VAULTING '
304- ));
304+ ));
305305 }
306306
307307 public function angelleye_ppcp_login_seller () {
@@ -590,6 +590,9 @@ public function angelleye_get_seller_onboarding_status() {
590590 );
591591 $ host_url = $ this ->ppcp_host . 'get-tracking-status ' ;
592592 $ seller_onboarding_status = $ this ->api_request ->request ($ host_url , $ args , 'get_tracking_status ' );
593+ if (!is_array ($ seller_onboarding_status )) {
594+ throw new Exception ('Unable to retrieve the account status, please refresh to try again. ' );
595+ }
593596 if (!isset ($ seller_onboarding_status ['merchant_id ' ])) {
594597 $ seller_onboarding_status ['merchant_id ' ] = sanitize_text_field (wp_unslash ($ _GET ['merchantIdInPayPal ' ]));
595598 }
@@ -667,8 +670,8 @@ public function angelleye_track_seller_onboarding_status_from_cache($merchant_id
667670 try {
668671 $ this ->api_request = new AngellEYE_PayPal_PPCP_Request ();
669672 $ url = trailingslashit ($ this ->host ) .
670- 'v1/customer/partners/ ' . $ partner_merchant_id .
671- '/merchant-integrations/ ' . $ merchant_id ;
673+ 'v1/customer/partners/ ' . $ partner_merchant_id .
674+ '/merchant-integrations/ ' . $ merchant_id ;
672675 $ args = array (
673676 'method ' => 'GET ' ,
674677 'headers ' => array (
@@ -760,22 +763,22 @@ public function angelleye_ppcp_onboard_email_sendy_subscription() {
760763 }
761764 $ url = 'https://sendy.angelleye.com/subscribe ' ;
762765 $ response = wp_remote_post ($ url , array (
763- 'method ' => 'POST ' ,
764- 'timeout ' => 45 ,
765- 'redirection ' => 5 ,
766- 'httpversion ' => '1.0 ' ,
767- 'blocking ' => true ,
768- 'headers ' => array (),
769- 'body ' => array ('list ' => 'oV0I12rDwJdMDL2jYzvwPQ ' ,
770- 'boolean ' => 'true ' ,
771- 'email ' => $ _POST ['email ' ],
772- 'gdpr ' => 'true ' ,
773- 'silent ' => 'true ' ,
774- 'api_key ' => 'qFcoVlU2uG3AMYabNTrC ' ,
775- 'referrer ' => $ current_url
776- ),
777- 'cookies ' => array ()
778- )
766+ 'method ' => 'POST ' ,
767+ 'timeout ' => 45 ,
768+ 'redirection ' => 5 ,
769+ 'httpversion ' => '1.0 ' ,
770+ 'blocking ' => true ,
771+ 'headers ' => array (),
772+ 'body ' => array ('list ' => 'oV0I12rDwJdMDL2jYzvwPQ ' ,
773+ 'boolean ' => 'true ' ,
774+ 'email ' => $ _POST ['email ' ],
775+ 'gdpr ' => 'true ' ,
776+ 'silent ' => 'true ' ,
777+ 'api_key ' => 'qFcoVlU2uG3AMYabNTrC ' ,
778+ 'referrer ' => $ current_url
779+ ),
780+ 'cookies ' => array ()
781+ )
779782 );
780783 if (is_wp_error ($ response )) {
781784 wp_send_json (wp_remote_retrieve_body ($ response ));
0 commit comments