mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 10:31:59 -04:00
Update payment process script to work around FA additions
This commit is contained in:
parent
c4d7fbeaf4
commit
6ec1669308
1 changed files with 5 additions and 1 deletions
|
@ -151,11 +151,15 @@ try{
|
|||
}
|
||||
|
||||
$payment->Created = DateTime::createFromFormat('n/j/Y', trim($detailsRow->findElement(WebDriverBy::xpath('//td[preceding-sibling::td[normalize-space(.) = "Created On"]]'))->getText()));
|
||||
$payment->TransactionId = trim(str_replace('View on Finance', '', $detailsRow->findElement(WebDriverBy::xpath('//td[preceding-sibling::td[normalize-space(.) = "ID"]]'))->getText()));
|
||||
$payment->IsRecurring = sizeof($headerRow->findElements(WebDriverBy::xpath('//td[contains(., "Recurring")]'))) > 0;
|
||||
$payment->Amount = floatval(str_replace('$', '', trim($detailsRow->findElement(WebDriverBy::xpath('//td[preceding-sibling::td[normalize-space(.) = "Total Amount"]]'))->getText())));
|
||||
$payment->Fee = floatval(str_replace('$', '', trim($detailsRow->findElement(WebDriverBy::xpath('//td[preceding-sibling::td[normalize-space(.) = "Fee"]]'))->getText())));
|
||||
|
||||
$transactionId = $detailsRow->findElement(WebDriverBy::xpath('//td[preceding-sibling::td[normalize-space(.) = "ID"]]'))->getText();
|
||||
$transactionId = str_replace('View on FS', '', $transactionId);
|
||||
$transactionId = str_replace('View on Finance', '', $transactionId);
|
||||
$payment->TransactionId = trim($transactionId);
|
||||
|
||||
// We might also get a case where the donation is on behalf of a company match, but there's not really a way to distinguish that. Do a rough check.
|
||||
// See donation 00b60a22-eafa-44cb-9850-54bef9763e8d
|
||||
if($payment->User !== null && preg_match('/\b(L\.?L\.?C\.?|Foundation|President|Fund|Charitable)\b/ius', $payment->User->Name)){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue