Quick Start

Introduction

A number of “recipes” are provided here to give merchants and developers an idea of how the MarketDirect hosted payment page works. These demo “recipes” provide live examples of various configurations and ways in which the page can be used. Have fun playing with the various options as you become comfortable with the many different ways you can integrate MarketDirect with your website.

If you do not require any customization at all, you can copy and paste the below examples to create a live payment page. In order for the page to work you must replace the sample authentication values with those authentication values provided to you by your client support representative.

These examples assume you are using PHP scripting language and you have downloaded the official MarketDirect PHP Helper from here. If you are using any other language, these examples still apply, but you will need to code the <form> manually using field information provided in Advanced Reference section.

Example 1: Simplest Possible Button Diagram Icon

This creates a payment button to process a transaction worth USD $19.99 with default options.

<?php include_once('md.php')?>
<form action="https://raven.deepcovelabs.com/payment" method="post">
<?php mdGenerateInputs(array(
'md_submitter' => 'ernest',
'md_shared_secret' => 'all good men die young',
'md_routing' => '987743',
'md_currency' => 'USD',
'md_amount' => '1999'
))?>
<input type="image" src="https://docs.pacnetservices.com/misc/marketdirect/buynow.gif"/>
</form>

Example 2: Customized Look & Feel Diagram Icon

This creates a payment button to process a transaction worth CAD $20.00 without collecting shipping or billing information. This button also configures the payment page with a unique color, logo and merchant URL.

<?php include_once('md.php')?>
<form action="https://raven.deepcovelabs.com/payment" method="post">
<?php mdGenerateInputs(array(
'md_submitter' => 'ernest',
'md_shared_secret' => 'all good men die young',
'md_routing' => '987743',
'md_currency' => 'CAD',
'md_amount' => '2000',
'md_collect_shipping' => 'no',
'md_collect_billing' => 'none',
'md_collect_email' => 'no',
'md_color' => '#480073',
'md_logo_url' => 'https://docs.pacnetservices.com/misc/marketdirect/buynow.gif',
'md_return_url' => 'https://docs.pacnetservices.com/marketdirect/quick-start'
))?>
<input type="image" src="https://docs.pacnetservices.com/misc/marketdirect/buynow.gif"/>
</form>

Example 3: Complex Settlement Diagram Icon

This is the most complicated example, specifically designed to make use of many possible options with the exception of those that will be automatically filled in by the helper function if omitted from the parameters list (see Advanced Reference for details).

<?php include_once('md.php')?>
<form action="https://raven.deepcovelabs.com/payment" method="post">
<?php mdGenerateInputs(array(
'md_submitter' => 'ernest',
'md_shared_secret' => 'all good men die young',
'md_routing' => '987743',
'md_currency' => 'USD',
'md_amount' => '6232',
'md_collect_billing' => 'full',
'md_collect_shipping' => 'yes',
'md_collect_email' => 'yes',
'md_fulfillment_url' => '//docs.pacnetservices.com/misc/marketdirect/fulfill.php',
'md_fulfillment_post' => 'no',
'md_result_url' => '//docs.pacnetservices.com/misc/marketdirect/receipt.php',
'md_result_post' => 'yes',
'md_email_receipt' => 'no',
'md_color' => '#480073',
'md_logo_url' => '//docs.pacnetservices.com/misc/marketdirect/logo.gif',
'md_language' => 'en',
'md_return_url' => '//docs.pacnetservices.com/marketdirect/quick-start',
'md_detail_item_1' => 'Wine Opener',
'md_detail_cost_1' => '1999',
'md_detail_qty_1' => '1',
'md_detail_item_2' => 'Wine Glass',
'md_detail_cost_2' => '1095',
'md_detail_qty_2' => '2',
'md_detail_extras' => '230',
'md_detail_shipping' => '1000',
'md_detail_taxes' => '813',
'md_contact_email' => 'ernest@senoma.zaphod',
'md_shipping_name' => 'Ernest Gallo',
'md_shipping_company' => 'Senoma Wines',
'md_shipping_phone' => '+1 (604) 987-6543',
'md_shipping_fax' => '+1 (604) 987-6543',
'md_shipping_address1' => 'Unit 405, 595 Howe Street',
'md_shipping_city' => 'Vancouver',
'md_shipping_state' => 'British Columbia',
'md_shipping_country' => 'CA',
'md_shipping_zip' => 'V6C 2T5'
))?>
<input type="image" src="//docs.pacnetservices.com/misc/marketdirect/buynow.gif"/>
</form>

Example 4: Configuration Errors Diagram Icon

This is an example that demonstrates how errors in the configuration of MarketDirect can affect the customer’s experience.

<?php include_once('md.php')?>
<form action="https://raven.deepcovelabs.com/payment" method="post">
<?php mdGenerateInputs(array(
'md_submitter' => 'unknown user',
'md_shared_secret' => '',
'md_routing' => '123456',
'md_currency' => 'XYZ',
'md_amount' => '19.99',
'md_language' => 'ru'
))?>
<input type="image" src="//docs.pacnetservices.com/misc/marketdirect/buynow.gif"/>
</form>