Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Clodo76 Posted April 7, 2018 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.
Mark Posted April 9, 2018 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'] ); } ) ) ); }
Recommended Posts
Archived
This topic is now archived and is closed to further replies.