PHP: Can anyone help me how to create a payment request using wysow repository?
I found this link, but there weren't any solutions. I am am using concrete5's Community Store and am trying to create a PostFinance payment package/addon. I have the following code in /packages/community_store_postfinance/src/CommunityStore/Payment/Methods/CommunityStorePostfinance/CommunityStorePostfinancePaymentMethod.php file (which is a copy of the example in GitHub):
$passphrase = new Passphrase($shaInSecret);
$shaComposer = new AllParametersShaComposer($passphrase);
$ecommercePaymentRequest = new EcommercePaymentRequest($shaComposer);
// Set various params:
$ecommercePaymentRequest->setPspid($postfinancePsid);
$ecommercePaymentRequest->setOrderid($custmerOrder->getOrderId());
$ecommercePaymentRequest->setPostFinanceUri(EcommercePaymentRequest::TEST);
$ecommercePaymentRequest->setAmount((Int)$amount);
$ecommercePaymentRequest->setCurrency('CHF');
$ecommercePaymentRequest->setCustomername($customerName);
$ecommercePaymentRequest->setOwnerAddress($address);
$ecommercePaymentRequest->validate();
$formGenerator = new SimpleFormGenerator;
$paymentForm = $formGenerator->render($ecommercePaymentRequest);
// I then pass this to my redirect view
$this->set('paymentForm', $paymentForm);
I have debugged and the form is being created and looks correct, as is required by PostFinance and I get redirected the the PostFinance payment confirmation page, but none of the details have been passed to PostFinance. I am just wondering whether I missed something or if I should be adding something else in the request for the form to go through automatically? Any insights would be appreciated. Thanks.