- Issue created by @rubofvil
- 🇨🇦Canada karing 🇨🇦
If you submit a PR for this to the Github? I can ask J to help you out with it.
- 🇪🇸Spain rubofvil
Thx @karing PR, with first version https://github.com/colemanw/webform_civicrm/pull/886
Can't be used paypal express checkout with drupal and webform_civicrm.
- Create a payment express payment processor.
- Set the payment processor paypal express in webform_civicrm
Create a condition if the payment is incoming from paypal express and modify how is handeling the redirect url.
A example of the code:
diff --git a/src/WebformCivicrmConfirmForm.php b/src/WebformCivicrmConfirmForm.php
index b642072..b463628 100644
--- a/src/WebformCivicrmConfirmForm.php
+++ b/src/WebformCivicrmConfirmForm.php
@@ -48,6 +48,14 @@ class WebformCivicrmConfirmForm implements WebformCivicrmConfirmFormInterface {
$paymentProcessor->setCancelUrl($paramsDoPayment['cancelURL']);
}
try {
+ if ($processor_type["class_name"] == "Payment_PayPalImpl") {
+ $result = $paymentProcessor->doPreApproval($paramsDoPayment);
+ if ($result["pre_approval_parameters"]) {
+ $paramsDoPayment["token"] = $result["pre_approval_parameters"]["token"];
+ \CRM_Utils_System::redirect($result['redirect_url']); // Redirect to a new page with the summary of the payment.
+ }
+
+ }
$paymentProcessor->doPayment($paramsDoPayment);
}
Make a new page with summary to confirm the paypal checkout, like in civicrm workflow.
Ref:
- Drupal 7 issue
https://www.drupal.org/project/webform_civicrm/issues/2938155 →
- Drupal 7 Pull https://github.com/colemanw/webform_civicrm/pull/104/commits/691bcdadb8a...
Active
6.2
CiviCRM Data Handling
If you submit a PR for this to the Github? I can ask J to help you out with it.
Thx @karing PR, with first version https://github.com/colemanw/webform_civicrm/pull/886