eldzee Posted October 26, 2015 Report Posted October 26, 2015 Hello, I'm trying to create a custom non-merchant payment gateway which can accept multiple payment method, and I would like to control which payment method it uses. I created a form which pass an array value of the payment method, but upon passing it to the error checking, I always get Undefined index: value on line 820 in {BLESTA}/components/record/record.php it only occurs when the error checking passes (true value) metas: Array ( [merchant_id] => mercID [server_key] => servKey [client_key] => clientKey [acceptable_payment_type] => Array ( [0] => cc [1] => transfer ) [currencies] => Array ( [0] => IDR ) ) and this causes the error message: (whenever the value is true) $rules = array( 'acceptable_payment_type' => array( 'valid' => array( 'rule' => true, 'message' => "Payment type invalid" ) ) ); settings.pdt: <?php foreach($acceptablePayment as $ap) { print "<li>"; $this->Form->fieldCheckbox("acceptable_payment_type[]", $ap, true, array('id'=>"acceptable_payment_type[]")); print $this->_("test.payment_type_".$ap, true); print "</li>"; } ?> Quote
0 Tyson Posted October 26, 2015 Report Posted October 26, 2015 I created a form which pass an array value of the payment method, but upon passing it to the error checking, I always get Undefined index: value on line 820 in {BLESTA}/components/record/record.php and this causes the error message: (whenever the value is true) $rules = array( 'acceptable_payment_type' => array( 'valid' => array( 'rule' => true, 'message' => "Payment type invalid" ) ) ); You're not able to save the meta data for the gateway because the acceptable_payment_type is in an invalid format (i.e. an array). The system does not automatically serialize array data for storage with gateway meta like it does for modules, so you will need to serialize and unserialize it yourself. $rules = array( 'acceptable_payment_type' => array( 'valid' => array( 'rule' => true, 'message' => "Payment type invalid", 'post_format' => array("serialize") ) ) ); Michael 1 Quote
Question
eldzee
Hello,
I'm trying to create a custom non-merchant payment gateway which can accept multiple payment method,
and I would like to control which payment method it uses.
I created a form which pass an array value of the payment method,
but upon passing it to the error checking, I always get
it only occurs when the error checking passes (true value)
metas:
and this causes the error message: (whenever the value is true)
settings.pdt:
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.