Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

Greetings!

 

Using the current Linkpoint API and have received a strange (IMHO) request from a client...

 

They want the LinkPoint API to only pre-authorize the card and not charge until shipped with the option of changing the final charge amount before final billing.

 

I don't see anything that does this by default -- and I'm quite sure it will take some major re-work of the orders part of the admin, but was wondering if anyone has attempted this with OSC before.

 

I figure it is a matter of changing the XML sent to get the pre-authorize and having the orders page send a new XML to bill the account when the order status is updated to shipped. ?

 

Anyone with some insight? As I move forward with this project I plan on makings things as contrib-friendly as possible, we may get a new trunk of the Linkpoint API contrib. :)

 

Thanks!

Glen

Posted

Here I go answering myself again -- If I remove:

			//if OK do this stuff
		$realorder["ordertype"] = "POSTAUTH";					//CHANGE FOR 1.2a
		$realorder["oid"]  = $result["r_ordernum"];		//CHANGE FOR 1.2a

		// Send the SALE transaction.
		$result = $mylphp->curl_process($realorder);  // use curl methods

		// - SGS-000001: D:Declined:P:
		//- SGS-005005: Duplicate transaction.
		//	Begin Transaction Status does not = APPROVED

		if ($myorder['debugging'] == 'true') {
			exit;
		}

		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'D:Declined')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
		}
		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'R:Referral')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
		}
		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'Duplicate transaction')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_DUPLICATE_MESSAGE), 'SSL', true, false));
		} 
		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'SGS')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode($result["r_error"]), 'SSL', true, false));
		}
		if ($result["r_approved"] != "APPROVED" ) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_ERROR_MESSAGE), 'SSL', true, false));
		}
		//	End Transaction Status does not = APPROVED

This will cause only a pre-auth, and allow the customer to log into the Linkpoint account and then flag the txn as shipped? Right?

 

Thanks!

Posted
Here I go answering myself again -- If I remove:

			//if OK do this stuff
		$realorder["ordertype"] = "POSTAUTH";					//CHANGE FOR 1.2a
		$realorder["oid"]  = $result["r_ordernum"];		//CHANGE FOR 1.2a

		// Send the SALE transaction.
		$result = $mylphp->curl_process($realorder);  // use curl methods

		// - SGS-000001: D:Declined:P:
		//- SGS-005005: Duplicate transaction.
		//	Begin Transaction Status does not = APPROVED

		if ($myorder['debugging'] == 'true') {
			exit;
		}

		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'D:Declined')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
		}
		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'R:Referral')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_DECLINED_MESSAGE), 'SSL', true, false));
		}
		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'Duplicate transaction')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_DUPLICATE_MESSAGE), 'SSL', true, false));
		} 
		if ($result["r_approved"] != "APPROVED" && strstr($result['r_error'], 'SGS')) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode($result["r_error"]), 'SSL', true, false));
		}
		if ($result["r_approved"] != "APPROVED" ) {
			tep_redirect(tep_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . ' - ' . urlencode(MODULE_PAYMENT_LINKPOINT_API_TEXT_ERROR_MESSAGE), 'SSL', true, false));
		}
		//	End Transaction Status does not = APPROVED

This will cause only a pre-auth, and allow the customer to log into the Linkpoint account and then flag the txn as shipped? Right?

 

Thanks!

 

 

I haven't taken a look at the full code but that should basically be correct. Someone else asked to to this recently too. Keep in mind a few issues (written for someone else but still applies):

 

The pre-auth performs a cvv and avs check. Presently it performs a check for the full amount and that puts an instance on the customers card for the full amount in the cart but does not process it so the charge will dissappear within a few business days. I am not sure why you would want only a pre-auth as that would not process the actual transaction, you need a pre-auth then a ticket after pre-auth validation to actually receive the money, but you would just remove the steps after the pre-auth check in the code to do so. So yes, that is possible to do and would require minor code modifications but it would not actually get the money from the customer and put it into the stores account, it would only check that the avs and cvv information is valid and put a temporary charge on the card.

 

If you use the same order number as your pre-auth order number returned from linkpoint then you can do a pre-auth for the full amount to hold the funds and then do a ticket later to pull those funds. If you make them separate transactions you will end up drawing the card twice for the full amount or you can make the pre-auth for a lower amount like $1 or something but that won't validate that they have the funds available. Ideally you would be storing the order number variable in the qb db somewhere and then pass that to your in-house inventory software which could reference it to complete the pre-auth you did online with a ticket.

 

You will see based on the information in your linkpoint panel.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...