Skip to content

Commit

Permalink
Merge pull request #1 from skuola/patch-1
Browse files Browse the repository at this point in the history
Fix prefisso ns4 in risposta xml
  • Loading branch information
gfabrizi authored Jul 31, 2024
2 parents 05f1abd + ecc1c9b commit d45160c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/PayPal/Service/PayPalAPIInterfaceServiceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,13 @@ public function CreateRecurringPaymentsProfile($createRecurringPaymentsProfileRe
$ret = new CreateRecurringPaymentsProfileResponseType();
$resp = $this->call('PayPalAPIAA', 'CreateRecurringPaymentsProfile', $createRecurringPaymentsProfileReq,
$apiContext, $handlers);
/**
* Dal giorno 28/07/2024 sono iniziati dei problemi con la creazione dei pagamenti ricorrenti su PayPal.
* La risposta xml di PayPal presenta un suffisso aggiuntivo `ns4:` nei tag xml; questo problema si presenta
* solo per le risposte ad alcune API (come ad esempio qui nel `CreateRecurringPaymentsProfile`), non per tutte.
* Il fix consiste nell'aggiunta di una preg_replace per eliminare il prefisso `ns4:` nella risposta xml.
*/
$resp = preg_replace('/<(\/)?ns4:(.*?)>/', '<$1$2>', $resp);
$ret->init(PPUtils::xmlToArray($resp));
return $ret;
}
Expand Down

0 comments on commit d45160c

Please sign in to comment.