* - use false to suppress the creation of this field.
* @param string $identifier
*
- * @throws \CRM_Core_Exception
* @noinspection PhpUnhandledExceptionInspection
*/
public function contributionPageQuickConfigCreate(array $contributionPageParameters = [], array $priceSetParameters = [], bool $isSeparatePayment = FALSE, bool $membershipAmountField = TRUE, bool $contributionAmountField = TRUE, bool $otherAmountField = TRUE, string $identifier = 'QuickConfig'): void {
$this->assertFalse($assignedVariables['is_separate_payment']);
}
+ /**
+ * Test that submitting other amount works with non-english currency formatting.
+ *
+ * @dataProvider getThousandSeparators
+ *
+ * @param string $thousandSeparator
+ *
+ * @throws \CRM_Core_Exception
+ */
+ public function testOtherAmountConfirm(string $thousandSeparator) : void {
+ $this->setCurrencySeparators($thousandSeparator);
+ $this->contributionPageQuickConfigCreate([], [], FALSE, TRUE, TRUE, TRUE);
+ $processor = \Civi\Payment\System::singleton()->getById($this->ids['PaymentProcessor']['dummy']);
+ $processor->setDoDirectPaymentResult(['payment_status_id' => 1, 'fee_amount' => .72]);
+ $this->submitOnlineContributionForm([
+ 'payment_processor_id' => $this->ids['PaymentProcessor']['dummy'],
+ 'price_' . $this->ids['PriceField']['other_amount'] => $this->formatMoneyInput(555.00),
+ 'price_' . $this->ids['PriceField']['membership_amount'] => $this->ids['PriceFieldValue']['membership_general'],
+ 'id' => $this->getContributionPageID(),
+ ] + $this->getBillingSubmitValues(), $this->getContributionPageID());
+ $contribution = $this->callAPISuccessGetSingle('Contribution', ['contribution_page_id' => $this->getContributionPageID(), 'version' => 4]);
+ $this->assertEquals(655, $contribution['total_amount']);
+ }
+
/**
* Test the confirm form with a separate membership payment configured.
*/
/**
* @param bool $isSeparateMembershipPayment
*
+ * @deprecated see testSeparatePaymentWithTax for preferred way to get valid config.
+ *
* @return \Civi\Test\FormWrapper|\Civi\Test\FormWrappers\EventFormOnline|\Civi\Test\FormWrappers\EventFormParticipant|null
*/
private function submitFormWithMembershipAndContribution(bool $isSeparateMembershipPayment) {