WB17 - Passing Parameters

Startbeitrag von cardcoder am 27.11.2015 22:09

Hi Guys,

A really strange occurrence - the code below is the page initialisation of PAGE_CHECKOUT_SUCCESSFUL.

The procedure is -
select goods
confirm customer (new or returning)
go to payment provider
return with parameter if successful.

As you can see below, if it is a returning customer they already have a number. I perform the whole procedure once and it all works fine. If I do a second transaction, it performs everything correctly UNTIL it displays the PAGE_CHECKOUT_SUCCESSFULpage and then IGNORES all of the code below.

Getting very confused and all help greatly appreciated.


// this all gets the successful from Worldpay or paypal. If buffer has Y - must have come from worldpay, P - comes from paypal
Edit_paid_by=""
g_transId is string = PageParameter("payment")
IF g_transId >"" THEN
Edit_paid_by=g_transId
END


IF Edit_paid_by = "Y" THEN
ws_invoice_paymethod="Paid With Worldpay"
ELSE
ws_invoice_paymethod="Paid With Paypal"
END



Static_telephone_no..Caption="TEL : "+w_location_phone
proc_invoice_from_all_false()

// add new customer to system
IF ws_customer_key < 1 THEN
// led_customer_header.led_customer_key=ws_customer_key
led_customer_header.led_customer_password=w_password
led_customer_header.led_customer_email=w_email
led_customer_header.led_customer_mobile=w_mobile
led_customer_header.led_customer_telephone=w_phone
led_customer_header.led_customer_address2=w_address2
led_customer_header.led_customer_town=w_town
led_customer_header.led_customer_postcode=w_postcode
led_customer_header.led_customer_county=w_county
led_customer_header.led_customer_country=w_country
led_customer_header.led_customer_address1=w_address1
led_customer_header.led_customer_business_name=w_business_name
led_customer_header.led_customer_surname=w_surname
led_customer_header.led_customer_forename=w_firstnames
led_customer_header.led_customer_title=w_title
led_customer_header.led_customer_date=DateSys()
led_customer_header.led_customer_time=Left(TimeSys(), 4)
HAdd(led_customer_header)
HReadLast(led_customer_header, led_customer_key)
ws_customer_key=led_customer_header.led_customer_key
END


//add invoice header
HReadSeek(led_customer_header,led_customer_key,ws_customer_key)
IF HFound(led_customer_header) THEN
led_invoice_header.led_invoice_customer_key=ws_customer_key
led_invoice_header.led_invoice_password=led_customer_header.led_customer_password
led_invoice_header.led_invoice_email=led_customer_header.led_customer_email
led_invoice_header.led_invoice_mobile=led_customer_header.led_customer_mobile
led_invoice_header.led_invoice_telephone=led_customer_header.led_customer_telephone
led_invoice_header.led_invoice_address2=led_customer_header.led_customer_address2
led_invoice_header.led_invoice_town=led_customer_header.led_customer_town
led_invoice_header.led_invoice_postcode=led_customer_header.led_customer_postcode
led_invoice_header.led_invoice_county=led_customer_header.led_customer_county
led_invoice_header.led_invoice_country=led_customer_header.led_customer_country
led_invoice_header.led_invoice_address1=led_customer_header.led_customer_address1
led_invoice_header.led_invoice_business_name=led_customer_header.led_customer_business_name
led_invoice_header.led_invoice_forename=led_customer_header.led_customer_forename
led_invoice_header.led_invoice_title=led_customer_header.led_customer_title

IF W_checkout_address_CheckBox=False THEN
led_invoice_header.led_invoice_shipping_address1=w_shipping_address1
led_invoice_header.led_invoice_shipping_address2=w_shipping_address2
led_invoice_header.led_invoice_shipping_town=w_shipping_town
led_invoice_header.led_invoice_shipping_county=w_shipping_county
led_invoice_header.led_invoice_shipping_country=w_shipping_country
led_invoice_header.led_invoice_shipping_postcode=w_shipping_postcode
led_invoice_header.led_invoice_shipping_surname=w_shipping_surname
led_invoice_header.led_invoice_shipping_forename=w_shipping_firstnames
led_invoice_header.led_invoice_shipping_title=w_shipping_title
END

led_invoice_header.led_invoice_date=DateSys()
led_invoice_header.led_invoice_time=Left(TimeSys(), 4)
// web booking has staff 999
led_invoice_header.led_invoice_staff_taking_booking=999
// full payment taken by web booking
led_invoice_header.led_invoice_basket_value=ws_basket_basketvalue
led_invoice_header.led_invoice_basket_discount=ws_basket_promotion_discount
led_invoice_header.led_invoice_delivery_charge=ws_basket_delivery_charge
led_invoice_header.led_invoice_total=ws_basket_invoice_total
led_invoice_header.led_invoice_status="N"
led_invoice_header.led_invoice_del_collected=ws_collection_by_customer
led_invoice_header.led_invoice_payment_method=ws_invoice_paymethod

IF ws_basket_delivery_charge > 0
led_invoice_header.led_invoice_delivery_charge=ws_basket_delivery_charge
led_invoice_header.led_invoice_delivery_quoteID=ws_basket_carrier_QuoteID
led_invoice_header.led_invoice_delivery_ServiceID=ws_basket_carrier_ServiceID
led_invoice_header.led_invoice_extra_notes= ws_basket_carrier_ServiceName + CRLF
ELSE
led_invoice_header.led_invoice_delivery_charge=0
led_invoice_header.led_invoice_delivery_quoteID=0
led_invoice_header.led_invoice_delivery_ServiceID=0
END

HAdd(led_invoice_header)
END


TIA

Mike

Antworten:

HI

What doe this procedure do ?

proc_invoice_from_all_false()


Maybe try :

IF g_transId "" THEN ( meaning not equal to , greater then (>) is ok on int . This is webdev and webdev isnot as forgiving as windev. )

Try debugging this peace.

If this is not the fault set a numer of points with the debugger and go with F7 through all the lines. That is the only way to see what is going on.

regards

Allard

von Allard - am 28.11.2015 02:02

Re: WB17 - Passing Parameters *** WORKAROUND SORTED ***

Hi Allard,

Thanks for the reply.

What I have done is created 2 identical pages and the relevant page is opened depending the payment method. I then call the relevant procedure as a "Global Procedure" from either page - one set of code called from either page.

I have removed completely the parameter section at the beginning at now works perfectly. Not the best way but works !!!!

Mike

von cardcoder - am 28.11.2015 17:44
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.