Is it possible to preselect payment type and brand in MPAY24 payment service?
This is the documentation: https://docs.mpay24.com/docs/redirect-integration
There are different approaches but other 2 require building a form on merchants side. I would like to keep using "Redirect Integration" with SOAP but I'm not sure if I could set mdxi (Merchant Data Exchange Interface) with the preselected payment method and brand.
When I try that I get the error that according to xml schema "PaymentTypes" doesn't belong to "Order" node. But in MDXI.xsd it is a child of "Order" element: https://www.mpay24.com/schemas/MDXI/v3.0/MDXI.xsd
This is how I set it:
$mdxi = new \Mpay24\Mpay24Order();
$mdxi->Order->Tid = $transactionId;
$mdxi->Order->Price = $amount;
$mdxi->Order->URL->Success = $urlSuccess;
$mdxi->Order->URL->Error = $urlError;
$mdxi->Order->URL->Confirmation = $urlConfirmation;
$mdxi->Order->PaymentTypes->Payment(0)->setType('CC');
$mdxi->Order->PaymentTypes->Payment(0)->setBrand('VISA');
When I remove those 2 last lines for PaymentTypes setting, error is gone and I get redirected to MPAY24 form with all available payment methods which I would like to avoid in my situation.
Any help would be appreciated.
As I got an explanation from MPAY24 technical support team I must answer now by my self.
I was adding a right configuration but it seems that this must be done in a strict order like MDXI.xsd node elements are ordered.
So, my wrong configuration should be done like this (plus some other configuration which is currently commented as a possibility presentation. All elements can be found in provided MDXI.xsd located in MPAY24 library):
$mdxi = new \Mpay24\Mpay24Order();
$mdxi->Order->Tid = $transactionId;
$mdxi->Order->TemplateSet->setLanguage( $language );
$mdxi->Order->PaymentTypes->setEnable('true');
$mdxi->Order->PaymentTypes->Payment(1)->setType( $paymentType );
$mdxi->Order->PaymentTypes->Payment(1)->setBrand( $paymentBrand );
//$mdxi->Order->ShoppingCart ...
$mdxi->Order->Price = $amount;
$mdxi->Order->Currency = $currency;
//$mdxi->Order->Customer ...
//$mdxi->Order->BillingAddr ...
//$mdxi->Order->ShippingAddr ...
$mdxi->Order->URL->Success = $urlSuccess;
$mdxi->Order->URL->Error = $urlError;
$mdxi->Order->URL->Confirmation = $urlConfirmation;
//$mdxi->Order->URL->Cancel ...
Also, pay attention to "setEnable('true')" method added!
So, "PaymentTypes" must come after "TemplateSet" and before "ShoppingCart". This counts only if Configuration exists. Example is commented "ShoppingCart" when "PaymentTypes" will come before "Price" element.
I really hope this will help someone.