Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
17
Erster Beitrag:
vor 1 Jahr, 5 Monaten
Letzter Beitrag:
vor 2 Monaten, 2 Wochen
Beteiligte Autoren:
jonlau, cardcoder, Luis Antonio Gutiérrez Flores, DerekM, DerekM-2

WebDev 22 - Internal Component PayPal - or REST code?

Startbeitrag von DerekM am 15.06.2016 04:46

[NOT* Resolved] Need to "load unsafe scripts" on the browser - mixed http/https - for Chrome - click on the little "shield" on the address bar. Will now look at the PayPal Component and see where it is using http.

Sheesh! Lot of work if you don't look in the right places :(


------------------------------------------------------------------------------
Update 2: I thought that I could resolve this with SSLActive(true)
That fixes the PageDisplay using http instead of https - but I have no idea how to fix all these WebDev javascripts that are generated (I think by the Internal Page Control runtime process).

Maybe this is do-able in Vers 21 ? Anyway this is most annoying and I can't get this to work at all unless I do a major work-around.

-------------------------------------------------------------------------------


Hi Guys

I have an issue where I adapted the sample WebDev [19] PayPal component project.

It all appeared to work fine in development (Apache) - but when moved to the server (Windows 2008 R2 IIS 7.5) it just did not work.

I had a devil of a time debugging this - but it now seems that the issue is related to https. I can run another test example on the server with http and it works - but the PayPal widgets are not displayed when called from an https session.

This may be a generic PayPal issue (or even an IIS config. issue or a firewall issue) - but if anyone is aware of the pitfalls here I would of course greatly appreciate any pointers on how to handle this.

If it's generic issue I should be able to google some help - but has anyone else encountered this? Perhaps it is something to do with WebDev failing to include the internal page with https?

Sorry if this is a bit obscure or not well described.

TIA for any feedback.

Regards
Derek

Antworten:

Re: WebDev - Internal Page (PayPal) with https

Hi Derek,

I found the Webdev Paypal example a complete nightmare!

Because my situation, all of my sites are based on PHP mode (I have posted several questions on the forum).

I wrote my own procedure to talk to paypal. It is very easy - easier than you may think!!! I can give some sample code if required.

Kindest Regards,

Mike

von cardcoder - am 15.06.2016 08:17

Re: WebDev - Internal Page (PayPal) with https

Hi Mike

Yes please! I am using Dynamic WebDev. I did not think that I would have to do so much low-level work to do for something as common as a PayPal button !

Thanks & Regards,
Derek

von DerekM - am 16.06.2016 00:53

Re: WebDev - Internal Page (PayPal) with https [NOT Resolved - think not possible with WB19]

Hi Derek,

It is a bit long winded to put on the forum because you have to put bits in different places.

If you send me an email mike at fbs-ltd dot co dot uk I can go through it with you.

I have an invisible cell with -
paypal button
html control
iframe control.

When all the details for delivery are entered, the cell is then made visible and the customer can pay by paypal.


At the page initialisation -
I read the DB for the location details - this has paypal return address etc (I set them up as parameters in my location_table on the DB)

I then call the procedure below. It fills the box with all of the info required to talk to paypal.

At the bottom is the Click Code of PayPal Button.


I hope this helps,

Mike



PROCEDURE PRIVATE _html_paypal()


// Summary: Generates the HTML code required to run the PayPal payment button
// Syntax:
//_HTML ()
//
// Parameters:
// None

gsButton="paypal_logo.jpg"
salt is string ="Press Button Now!!!"
//sAlt is string = (gsLanguage nationFrench ? "Make payments with PayPal - it’s fast, free and secure!" ELSE "Effectuez vos paiements via PayPal : une solution rapide, gratuite et sécurisée !")


//
// Mandatory values
//

// MA IF gsAccount = "" THEN gsAccount = pPayPal.gsPayPalAccount
sAccount is string = _CREATEFORMVALUE("business", gsAccount)

// Amount
gcyAmount=Cell_basket_items.cell_led_invoice_total
sAmount is string = _CREATEFORMVALUE("amount", gcyAmount)

// Name and reference of the object

gsItem_Name= "LED LIGHTING SALE"
sItemName is string = _CREATEFORMVALUE("item_name", gsItem_Name)
gsItem_Number = DateToString(wdate)
sItemNmbr is string = _CREATEFORMVALUE("item_number", gsItem_Number)

// Quantities
gnQuantity = 1
sQuantity is string = _CREATEFORMVALUE("quantity", gnQuantity)


sModQuantity is string = _CREATEFORMVALUE("undefined_quantity", gbUndef_Quantity, True)

// Currency
sCURRENCY is string = _CREATEFORMVALUE("currency_code", gsCurrency_Code, True)

//
// Optional values
//

// Return Pages
sPageCancel is string = _CREATEFORMVALUE("cancel_return", gsCancel_Return, True)
sPageOK is string = _CREATEFORMVALUE("return", gsReturn, True)
sTxtContinue is string = _CREATEFORMVALUE("cbt", gsCbt, True)


// Comments
sCn is string = _CREATEFORMVALUE("cn", gsCn, True)
sNoNote is string = _CREATEFORMVALUE("no_note", gbNo_Note, True)

// Page layout
sHdImage is string = _CREATEFORMVALUE("cpp_header_image", gsCpp_Header_Image, True)
sHdColor is string = _CREATEFORMVALUE("cpp_headerback_color", gsCpp_HeaderBack_Color, True)
sHdBdColor is string = _CREATEFORMVALUE("cpp_headerborder_color", gsCpp_HeaderBorder_Color, True)
sPayFlow is string = _CREATEFORMVALUE("cpp_payflow_color", gsCpp_PayFlow_Color, True)
sCs is string = _CREATEFORMVALUE("cs", gbCs, True)
sLogo is string = _CREATEFORMVALUE("image_url", gsImage_Url, True)

// Delivery addresses
sShipping is string = _CREATEFORMVALUE("no_shipping", gnNo_Shipping, True)

// Return Mode
sRM is string = _CREATEFORMVALUE("rm", gnRm, True)

// Various
sCustom is string = _CREATEFORMVALUE("custom", gsCustom, True)
sHandling is string = _CREATEFORMVALUE("handling", gcyHandling, True)
sInvoice is string = _CREATEFORMVALUE("invoice", gsInvoice, True)
sShipping01 is string = _CREATEFORMVALUE("shipping", gcyShipping, True)
sShipping02 is string = _CREATEFORMVALUE("shipping2", gcyShipping2, True)
sID is string = "PAYPAL" + GetIdentifier()

sHTML is string

sHTML=""


// Complete
sHTML= [





%5

]

sHTML = StringBuild(sHTML, sID, gsButton, salt, gsLanguage, ...
sAccount + ...
sAmount + ...
sItemName + ...
sItemNmbr + ...
sQuantity + ...
sModQuantity + ...
sCURRENCY + ...
sPageCancel + ...
sPageOK + ...
sTxtContinue + ...
sCn + ...
sLogo + ...
sHdImage + ...
sHdColor + ...
sHdBdColor + ...
sCs + ...
sPayFlow + ...
sShipping + ...
sRM + ...
sCustom + ...
sHandling + ...
sInvoice + ...
sShipping01 + ...
sShipping02)


// Test mode?
// IF NOT pPayPal.gbTestMode THEN sHTML = Replace(sHTML, "sandbox.", "")
IF NOT gbtestmode THEN sHTML = Replace(sHTML, "sandbox.", "")


// Language
IF gsLanguage nationFrench THEN sHTML = Replace(sHTML, "fr_FR", "en_US")


// Open an external file
ResCreation is int = fCreate ("paypal_link.php")
IF ResCreation -1 THEN
// Write into this file
fWrite(ResCreation, sHTML)
fClose(ResCreation)
END


gsHTML_paypal=sHTML

HTML_paypal..Value=sHTML

HTML_paypal = ""





Click Code of PayPal Button

led_temp_basket.led_temp_basket_email=BrowserIPAddress()
led_temp_basket.led_temp_basket_image="PAYPAL"
HAdd(led_temp_basket)


proc_customer_dets_to_ws()
StringDisplay(gsHTML_paypal)

von cardcoder - am 16.06.2016 12:26

Re: WebDev - Internal Page (PayPal) with https [NOT Resolved - think not possible with WB19]

Hi Derek,
I tried to post the code to show you how it worked. Something went wrong!!!

If you send me an email mike at fbs-ltd dot co dot uk I will ahow you what to do.

Regards,

Mike

von cardcoder - am 18.06.2016 09:12

Re: WebDev - Internal Page (PayPal) with https

Hi Mike / All

I'm back to this PayPal stuff :( - Did not contact Mike last year :(

Now using WebDev 22 The PayPal Component is now an Internal Component.

My questions now are :-

(1) Is there anyone with a good understanding of this Internal Component and an explain to me in simple terms - what it is actually doing?

(2) If I "just" use the PayPal example REST code instead - how do I go about this in WebDev? Should I be using the Client Side REST code?

Would be great if someone could give me a few pointers to get started with this.

Regards,
Derek

von DerekM - am 30.08.2017 05:38
Hi Derek,

if you want to PM me, I can get you going.

Kindest Regards,

Mike

von cardcoder - am 30.08.2017 08:47

Re: WebDev - Internal Page (PayPal) with https

I recommend you using the PayPal payment that is integrated in the SecurePayment component, not the paypal only, didn't have any problem using it, I can send you some of the code I use if you want. I've used this in WebDev20 and WebDev22, in fact I'm still using the version 20 component in WebDev22, since some of the coding of the component changed in the last version.

von Luis Antonio Gutiérrez Flores - am 30.08.2017 16:07

Re: WebDev - Internal Page (PayPal) with https

Quote
Luis Antonio Gutiérrez Flores
I recommend you using the PayPal payment that is integrated in the SecurePayment component, not the paypal only, didn't have any problem using it, I can send you some of the code I use if you want. I've used this in WebDev20 and WebDev22, in fact I'm still using the version 20 component in WebDev22, since some of the coding of the component changed in the last version.


Hi Luis,

Are you able to send the sample code to my email address:jonlau88@singnet.com.sg ?

Thank you in advance !

Regards,

Jon Lau

von jonlau - am 31.08.2017 02:06

Re: WebDev - Internal Page (PayPal) with https

Hi

Big thanks to Mike who spend time to organise a document and send me some example code - much appreciated - and to Luis for the helpful offer. .

Turns out that the WebDev PayPal Internal Component is just fine for my purposes, and all my PayPal settings were correct - everything was fine EXCEPT that I did not check for PayPal cookies in Chrome when I made my changes!

Seems that one can never be too old to fall into traps for young players ..

Regards,
Derek

(now I've lost my cookie for this forum :( )

von DerekM-2 - am 31.08.2017 03:39

Re: WebDev - Internal Page (PayPal) with https

Quote
DerekM-2
Hi

Big thanks to Mike who spend time to organise a document and send me some example code - much appreciated - and to Luis for the helpful offer. .

Turns out that the WebDev PayPal Internal Component is just fine for my purposes, and all my PayPal settings were correct - everything was fine EXCEPT that I did not check for PayPal cookies in Chrome when I made my changes!

Seems that one can never be too old to fall into traps for young players ..

Regards,
Derek


(now I've lost my cookie for this forum :( )


Hi Derek,

Are you able to send me the sample code ?

Regards,

Jon Lau

von jonlau - am 31.08.2017 03:51

Re: WebDev - Internal Page (PayPal) with https

Of course! Just wait a little

von Luis Antonio Gutiérrez Flores - am 31.08.2017 13:39

Re: WebDev - Internal Page (PayPal) with https

Quote
Luis Antonio Gutiérrez Flores
Of course! Just wait a little


Will need your sample code as I am not sure where to change ( looking at the sample eBusiness webdev application) to a different CURRENCY ( as the default currency used is EURO ).

Regards,

Jon Lau

von jonlau - am 01.09.2017 02:42

Re: WebDev - Internal Page (PayPal) with https

Hi! I already sent you my sample code.
I'm attaching the part of my code where I specify the currency to use by paypal, mine is in Mexican pesos, but you can look at paypal documentation to know which is your currency code.
[attachment 2434 currency.png]

von Luis Antonio Gutiérrez Flores - am 01.09.2017 20:33

Re: WebDev - Internal Page (PayPal) with https

Quote
Luis Antonio Gutiérrez Flores
Hi! I already sent you my sample code.
I'm attaching the part of my code where I specify the currency to use by paypal, mine is in Mexican pesos, but you can look at paypal documentation to know which is your currency code.
[attachment 2434 currency.png]


Hi Luis,

Thank you very much !

I will try this code.

Regards,

Jon Lau

von jonlau - am 02.09.2017 19:12

Re: WebDev - Internal Page (PayPal) with https

Quote
Luis Antonio Gutiérrez Flores
Hi! I already sent you my sample code.
I'm attaching the part of my code where I specify the currency to use by paypal, mine is in Mexican pesos, but you can look at paypal documentation to know which is your currency code.
[attachment 2434 currency.png]


Hi Luis,

MyPayment is SecurePayment(PayPal)
MyPayment.Language = "MXN"
MyPayment.CurrencyCode = "MXN"

I have tested and the currency works in your currency ( which is MXN)..but it's still showing in frence language instead of MXN.

Do i need to set the locale ?

Regards,

Jon Lau

von jonlau - am 02.09.2017 20:11

Re: WebDev - Internal Page (PayPal) with https

Quote
jonlau
Quote
Luis Antonio Gutiérrez Flores
Hi! I already sent you my sample code.
I'm attaching the part of my code where I specify the currency to use by paypal, mine is in Mexican pesos, but you can look at paypal documentation to know which is your currency code.
[attachment 2434 currency.png]


Hi Luis,

MyPayment is SecurePayment(PayPal)
MyPayment.Language = "MXN"
MyPayment.CurrencyCode = "MXN"

I have tested and the currency works in your currency ( which is MXN)..but it's still showing in frence language instead of MXN.

Do i need to set the locale ?

Regards,

Jon Lau


It's ok. i find the solution.

i will need to add the ""PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE" to the relevant country code and it will work fine.

Regards,

Jon Lau

von jonlau - am 04.09.2017 08:14
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.