Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
7
Erster Beitrag:
vor 8 Jahren, 1 Monat
Letzter Beitrag:
vor 8 Jahren, 1 Monat
Beteiligte Autoren:
bosher, Alexandre Leclerc

Windev + PayPal SOAP

Startbeitrag von bosher am 04.05.2010 14:14

Hi all,

I'm wondering if anyone has hooked up to paypal via their SOAP gateway from within Windev? I'm looking at getting customers to pay for content directly through their app rather than going to the Paypal website to make purchases

Any help appreciated

Cheers

Bosh

Antworten:

Hi Bosh,

In the French WD14 version there is a component called WW_PaiementSecurise (Secured Payment) which talks to PayPal using their API. The implementation still uses the PayPal Website, but it talks with the same API (as far as I can remember). Maybe there is something similar in WD14 US.

We built our own website using a hacked version of this component in AWP and it work ok. I suppose that starting from that you could work with the full API to never go on PayPal Website.

I hope this helps.

Best regards,
Alexandre Leclerc

Edit1: PS: I forgot this is not the SOAP interface, but yet it works very well.

von Alexandre Leclerc - am 04.05.2010 15:50
Hey Alexandre

That's very helpful. I seem to remember that I saw that in US version too. I'll have a good look!

Cheers

Bosh

von bosher - am 04.05.2010 16:18
Hi Alexandre,

It appears that the US version does not have this component. Is there a chance you could send it to me ?

email addr: stratton.bobATgooglemail.com

Thanks

Bosher

von bosher - am 05.05.2010 14:21
Hi Bosher,

I just found out that this component was included with LST 77. If you do not have the LST, maybe you can ask PCSoft for it?

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 05.05.2010 15:45
Hi Alexandre,

No problem, I'll just have to read the PayPal SOAP spec..:eek:

Thanks anyway.

Cheers

Bosh

von bosher - am 05.05.2010 16:18
Hi Bosher,

In fact you will have to get to know the API any-way. I had to work on it couple weeks because the component was not doing exactly what I was expecting. I'm not making a payment only, but sending all articles, prices, etc. to PayPal. And when debugging, knowledge of the API is very handy.

Here is a small example on how the communications are done: (See the API for any details on why any given parameter.)

https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/howto_api_reference

(This sandbox example uses the NVP approach. It was faster and more strait forward to implement. And the component in LST 77 was using the same API.)


XFORM is string
HTTPCreateForm(XFORM)
HTTPAddParameter(XFORM,"USER",PayPalId)
HTTPAddParameter(XFORM,"PWD",PayPalPass)
HTTPAddParameter(XFORM,"SIGNATURE",PayPalSignature)
HTTPAddParameter(XFORM,"VERSION",PayPalVer)
HTTPAddParameter(XFORM, "METHOD","SetExpressCheckout")
HTTPAddParameter(XFORM, "AMT",NumToString(moAmount,".2f"))
HTTPAddParameter(XFORM, "RETURNURL","https://url.ok.com";)
HTTPAddParameter(XFORM, "CANCELURL", "https://url.cancel.com";)
HTTPAddParameter(XFORM, "LOCALECODE","EN/FR/...")
HTTPAddParameter(XFORM, "NOSHIPPING","0")
HTTPAddParameter(XFORM, "INVNUM","Order No")
HTTPAddParameter(XFORM, "EMAIL","e@mail")
HTTPAddParameter(XFORM, "CURRENCYCODE","USD")
HTTPAddParameter(XFORM, "PAYMENTACTION","Sale")
HTTPAddParameter(XFORM, "SOLUTIONTYPE","Sole")
HTTPAddParameter(XFORM, "LANDINGPAGE","Billing")
HTTPAddParameter(XFORM, "CHANNELTYPE","Merchant")
//...

// send form
HTTP.IgnoreError = httpIgnoreInvalidCertificate
IF HTTPSendForm(XFORM,"https://api-3t.sandbox.paypal.com/nvp";) THEN
// now you have all the answers from PayPal... you can extract them to read them
// if you have a valid token, you can procede... etc.
tabValeurs is array of strings
StringToArray(HTTPGetResult(httpResult), tabValues, "&")
FOR i = 1 _TO_ tabValues..Occurrence
m_taValues[ExtractString(m_taValues, 1, "=")] = (m_taValues[[Position(m_taValues, "=") + 1 TO]])
END
//m_taValeurs["TOKEN"] // get the token, etc.
END


API reference for this code is: https://cms.paypal.com/us/cgi-bin/?&cmd=_render-content&content_ID=developer/e_howto_api_nvp_r_SetExpressCheckout

Well, I hope all this can help you. Well, if you really want to implement SOAP it will not be of much help, I understand that.

Best regards,
Alexandre Leclerc

von Alexandre Leclerc - am 05.05.2010 17:18
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.