diff --git a/src/OffSiteGateway/Gateway/OffSiteCheckoutPageSimulation.php b/src/OffSiteGateway/Gateway/OffSiteCheckoutPageSimulation.php index b167c15..9110f35 100644 --- a/src/OffSiteGateway/Gateway/OffSiteCheckoutPageSimulation.php +++ b/src/OffSiteGateway/Gateway/OffSiteCheckoutPageSimulation.php @@ -66,8 +66,12 @@ private function loadOffSiteGatewaySimulationMarkup()
- Donation amount: + Donation amount: +
++ Description:
diff --git a/src/OffSiteGateway/Gateway/OffSiteGateway.php b/src/OffSiteGateway/Gateway/OffSiteGateway.php index 232e020..d1d51e1 100644 --- a/src/OffSiteGateway/Gateway/OffSiteGateway.php +++ b/src/OffSiteGateway/Gateway/OffSiteGateway.php @@ -126,12 +126,15 @@ public function createPayment(Donation $donation, $gatewayData): RedirectOffsite $donation->gatewayTransactionId = $payment->id; $donation->save(); + /** + * This is necessary to make the off-site checkout page simulation work; + * In real-world integrations, this parameter isn't necessary. + */ $paymentParameters['off-site-gateway-simulation'] = true; $redirectUrl = add_query_arg($paymentParameters, home_url()); return new RedirectOffsite($redirectUrl); - //return new RedirectOffsite(add_query_arg('off-site-gateway-simulation', true, home_url())); } catch (Exception $e) { $donation->status = DonationStatus::FAILED(); $donation->save(); @@ -165,7 +168,7 @@ public function getPaymentParameters(Donation $donation, $gatewayData): array 'value' => $donation->amount->formatToDecimal(), 'currency' => $donation->amount->getCurrency()->getCode(), ], - //'description' => MollieApi::getPaymentDescription($donation), + 'description' => $donation->formTitle, 'returnUrl' => $this->getPaymentsReturnURL($donation, $gatewayData), 'cancelUrl' => $this->getPaymentsCancelURL($donation, $gatewayData), 'webhookUrl' => $this->getPaymentsWebhookUrl($donation),