Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted April 7, 20186 yr 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.
April 9, 20186 yr 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'] ); } ) ) ); }
Archived
This topic is now archived and is closed to further replies.