Data at Your Fingertips: Explore Our New Reporting and Statistical Capabilities By Ryan Ashbrook Tuesday at 01:29 PM
Clodo76 Posted April 7, 2018 Share Posted April 7, 2018 I'm migrating some code from 3.4 Nexus to 4.x eCommerce. I don't find any docs like the older 3.4 Nexus docs about mark an invoice paid, create a payment gateway etc... A specific question: all my payments gateway i need to migrate do something like public function payScreen() { $html = "my html"; ... return array("html" => $html); } The only payment gateway in the default installation that use a paymentScreen is AuthorizeNet, with this kind of code: public function paymentScreen( \IPS\nexus\Invoice $invoice, \IPS\nexus\Money $amount, \IPS\nexus\Customer $member = NULL, $recurrings = array() ) { $return = array(); $return['card'] = new \IPS\nexus\Form\CreditCard( $this->id . '_card', NULL, FALSE, $options ); return $return; } Any advice about filling the $return with direct html? Thx. Link to comment Share on other sites More sharing options...
Mark Posted April 9, 2018 Share Posted April 9, 2018 If you can construct what you need to display out of form helpers (they're quite flexible!) then do that. If you absolutely need to use custom HTML though, you can use \IPS\Helpers\Form\Custom. See Stripe for an example: elseif ( $settings['type'] === 'amex' ) { return array( 'card' => new \IPS\Helpers\Form\Custom( $this->id . '_card', NULL, FALSE, array( 'rowHtml' => function( $field ) use ( $settings ) { return \IPS\Theme::i()->getTemplate( 'forms', 'nexus', 'global' )->amexExpressCheckout( $field, $this, $settings['amex_client_id'] ); } ) ) ); } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.