Forums / General Questions / Porting OsCommerce Drop Ship To Zen

Porting OsCommerce Drop Ship To Zen

Locked

Views: 1,304

Results 1 to 4 of 4
This thread is locked. New replies are disabled.
16 Apr 2008, 9:24 PM
#1
fotofx avatar

fotofx

Zen Follower

Join Date:
Apr 2008
Location:
South Florida
Posts:
195
Plugin Contributions:
0

Porting OsCommerce Drop Ship To Zen

I have a Zen Cart that every item comes from the same drop shipper. They provided me with an OSCommerce drop ship template that transmits the order using cUrl after payment success. I need to port the plugin over to Zen Cart.

Any suggestions on where to start or similar Zen Card code to look at for the Zen variables?

Steve

16 Apr 2008, 10:13 PM
#2
fairestcape avatar

fairestcape

Totally Zenned

Join Date:
Mar 2008
Location:
Cape Town & London (depends on the season)
Posts:
2,957
Plugin Contributions:
0

Re: Porting OsCommerce Drop Ship To Zen

You'll probably have to do a lot of work on this OSC thing. Why not just copy your drop-shipper on the Order Confirmation e-mail? It gets sent out as the concluding part of checkout_success and adding their e-mail address to the list will take about 20 seconds...

16 Apr 2008, 10:28 PM
#3
fotofx avatar

fotofx

Zen Follower

Join Date:
Apr 2008
Location:
South Florida
Posts:
195
Plugin Contributions:
0

Re: Porting OsCommerce Drop Ship To Zen

They don't handle drop shipping that way. The API actually places the order with the dropshipper and provides our credit card to pay for the order. They have a modified checkout_success.php files that processes the order.

Or they provide the following .php that you can add to your code. (I have removed the company info)

<html><body> <?

##################################################

$environment = "test"; #Set to: "process" when read for production

######################################################

#Set Default Variables

$aid=0000; #(enter YOUR Account ID#)
$password="yourpassword"; #(enter YOUR Password)
$card_no="5555111122224444"; #(enter YOUR Credit Card#)
$card_mo="02"; #(enter YOUR CC# expiration format mm)
$card_yr="05" ; #(enter YOUR CC# expiration format yy)
$card_type="Visa"; #(enter YOUR CC# Type: Visa, Mastercard, Discover

$cvv="005"; #(enter YOUR CC# Card CVV

###################################################
#Create the Customer Transaction info string

#Header Record is a comma delimited string of:
#your_internal_orderid, customer_name, customer_company, customer_address_1, customer_address_2, customer_city, customer_state, customer_zip, customer_country, customer_phone, customer_special_instructions
##################################################

$your_order_id = "123111" ; #Max 30 Characters
$customer_ship_name = "Tom Public" ; #Required but leave blank if n/a
$customer_ship_company = "XyZ Industry" ; #Max 60 Characters
$customer_ship_address1 = "Suite 5" ; #Max 60 Characters
$customer_ship_address2 = "109 Williams Rd"; #Max 60 Characters
$customer_ship_city = "JohnsonTown"; #Max 60 Characters
$customer_ship_state = "VA" ; #Max 60 Characters
$customer_ship_zip = "10999"; #Max 20 Characters
$customer_ship_country = "USA"; #Max 100 Characters
$customer_ship_telephone = "555-555-1212" ; #Optional Max 20
$customer_ship_message = "Special Instructions"; #Optional Max 255

#build header string

$header= "$your_order_id,$customer_ship_name,$customer_ship_company";

$header.=",$customer_ship_address1,$customer_ship_address2,";

$header.= "$customer_ship_city,$customer_ship_state,";
$header.= "$customer_ship_zip,$customer_ship_country,";
$header.= "$customer_ship_telephone,$customer_ship_message";

$product_id = "gwdj025503";
$qty = "3";
$style = "Vanilla" ; #optional flavor/size/color depending on product
$detail = Array();
$detail[0] = "$product_id,$qty,$style";

$product_id = "gwdj025506";
$qty = "1";
$style = ""; #optional flavor/size/color depending on product
$detail[1] = "$product_id,$qty,$style";

$PostData = "aid=$aid&Version=1.0&header=" . urlencode($header) . "&Card_no=$card_no&Card_Type=$card_type&Card_Mo=$card_mO&Card_YR=$card_yr&CVV=$cvv";

for ($i=0;$i< count($detail);$i++)
{
$detail[$i];
$PostData.= "&detail=" . urlencode($detail[$i]);
}

$defined_vars = get_defined_vars();

$_url = "https://www.dropship.com/dropship/xml/$environment" . "transaction.asp";

$ch = curl_init();
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS,$PostData);
curl_setopt($ch, CURLOPT_URL,$_url);
curl_setopt($ch, CURLOPT_USERPWD,"$aid:$password");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_USERAGENT, $defined_vars['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
$result=curl_exec ($ch);

if (curl_error($ch))
printf("Error %s: %s", curl_errno($ch), curl_error($ch));
curl_close ($ch);

#Do what you want with the result;

list ($response, $message) = split (",", $result,2);

if ($response == 1) {
print "Success: $message";
}
else {
print "An Error has Occured: $message";
}

?>

16 Apr 2008, 10:56 PM
#4
fotofx avatar

fotofx

Zen Follower

Join Date:
Apr 2008
Location:
South Florida
Posts:
195
Plugin Contributions:
0

Re: Porting OsCommerce Drop Ship To Zen

They don't work that way. The modified checkout_success.php they provided places the order with them thru cUrl after we have received payment and provides our credit card number to the shipper for payment. If someone will tell me how to include a code block in the reply, I will post sample code.

Steve