Jump to content

Nexus/eCommerce dev docs - direct html as paymentScreen


Clodo76

Recommended Posts

Posted

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.

Posted

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...