| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\FormMigration\Steps; |
| 4 |
|
| 5 |
use Give\FormMigration\Concerns\Blocks\BlockFactory; |
| 6 |
use Give\FormMigration\Contracts\FormMigrationStep; |
| 7 |
|
| 8 |
class OfflineDonations extends FormMigrationStep |
| 9 |
{ |
| 10 |
public function canHandle(): bool |
| 11 |
{ |
| 12 |
return $this->formV2->isOfflineDonationsCustomized(); |
| 13 |
} |
| 14 |
|
| 15 |
public function process() |
| 16 |
{ |
| 17 |
if($this->formV2->isOfflineDonationsBillingFieldEnabled()) { |
| 18 |
$this->fieldBlocks->findParentByChildName('givewp/payment-gateways') |
| 19 |
->innerBlocks->append(BlockFactory::billingAddress()); |
| 20 |
} |
| 21 |
|
| 22 |
// @todo Map donation instructions to v3 form. |
| 23 |
$this->formV3->settings->offlineDonationInstructions = $this->formV2->getOfflineDonationInstructions(); |
| 24 |
} |
| 25 |
} |
| 26 |
|