Has anyone implemented paypal with CB?

82 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Mert Öztürk

ungelesen,
14.04.2016, 07:31:0914.04.16
an ChicagoBoss
Hello,

I am searching for a Paypal integration example with CB or is it possible to be done?

Thanks
Mert

İbrahim Yılmaz

ungelesen,
14.04.2016, 08:22:3114.04.16
an ChicagoBoss
Hi Mert,
 
I think there is a REST API for PayPal.
 
If you need REST client examples you can go easily to kivra's restclient https://github.com/kivra/restclient
 
 
Cheers,
Ibrahim.

H. İbrahim Yılmaz

ungelesen,
14.04.2016, 09:40:1614.04.16
an chica...@googlegroups.com
Hi Mert,
 
I think there is a REST API for Paypal. What is the problem I don't understand.
 
If you need REST client examples you can go easily to kivra's restclient https://github.com/kivra/restclient
 
 
Cheers,
 
-- 
"It doesn't matter who you are or what you look like, so long as somebody loves you." - Roald Dahl
 
 
 
14.04.2016, 14:31, "Mert Öztürk" <asksome...@gmail.com>:
--
You received this message because you are subscribed to the Google Groups "ChicagoBoss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chicagoboss...@googlegroups.com.
Visit this group at https://groups.google.com/group/chicagoboss.
To view this discussion on the web visit https://groups.google.com/d/msgid/chicagoboss/eecd7871-122e-4f35-ab97-6fa49635aff1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mert Öztürk

ungelesen,
14.04.2016, 14:58:3214.04.16
an ChicagoBoss, ibr...@drlinux.org
Thanks, i will check it soon.

14 Nisan 2016 Perşembe 16:40:16 UTC+3 tarihinde H. İbrahim Yılmaz yazdı:

Mert Öztürk

ungelesen,
17.04.2016, 11:51:3517.04.16
an ChicagoBoss, ibr...@drlinux.org
Hello,

I just could not succeed adding restc application to my cb app.
When  i add "{restc, ".*", {git, "git://github.com/kivra/restclient.git", {tag, "0.3.0"}}}" as rebar dependency on rebar.config, and compile it, it just doesnt work.
application:start(restc) outputs the error with its deps app hackney: {error,{not_started,hackney}}
Do i have to get deps of restc to boss deps folder and recompile it?

Thanks


14 Nisan 2016 Perşembe 21:58:32 UTC+3 tarihinde Mert Öztürk yazdı:

Jesse Gumm

ungelesen,
17.04.2016, 12:00:3617.04.16
an chica...@googlegroups.com, ibr...@drlinux.org

That means you need to start hackney first with application:start(hackney)

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Mert Öztürk

ungelesen,
17.04.2016, 12:48:2417.04.16
an ChicagoBoss, ibr...@drlinux.org
Hello Jesse,

Forgot to mention. It is the deps folder of restc app and when i type application:start(hackney) i got the following: {error,{"no such file or directory","hackney.app"}}

Thanks

17 Nisan 2016 Pazar 19:00:36 UTC+3 tarihinde Jesse Gumm yazdı:

Jesse Gumm

ungelesen,
17.04.2016, 13:02:3417.04.16
an chica...@googlegroups.com, ibrahim Yılmaz

Oh gotcha. You want to 'rebar get-deps' and 'rebar compile' from within the root of your CB app.

With hackney in the deps directory of your restc app, it's not going to be recognized by the parent app.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Mert Öztürk

ungelesen,
17.04.2016, 13:20:0917.04.16
an ChicagoBoss, ibr...@drlinux.org
I recompiled with rebar get-deps compile but didnt work again.

restc app is something like below;

restc deps
   - erlsom
   - hackney -------------------------hackney deps
                                                 - idna
                                                 - ssl_verify_hostname
   - idna
   - jsx
   - mochiweb_util
   - ssl_verify_hostname

I can see that they are compiled well and ebins are not empty.
And i cant start with application:start(restc)

Do i have to make changes in boss.config?
Or should i sub-deps of restc and add them manually by one by one to work hackney first and then the restc?

First time of adding an extra library with deps in it so i couldnt figure out how to do it correctly.

Thanks
Mert

17 Nisan 2016 Pazar 20:02:34 UTC+3 tarihinde Jesse Gumm yazdı:

Jesse Gumm

ungelesen,
17.04.2016, 13:31:1717.04.16
an chica...@googlegroups.com, ibrahim Yılmaz

All of those deps you see in the restc app *should* be in your CB app's deps directory, at the same level as boss, erlydtl, boss_db, etc.

The deps within deps/restc/deps are outright ignored by erlang.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Mert Öztürk

ungelesen,
17.04.2016, 13:33:2117.04.16
an ChicagoBoss, ibr...@drlinux.org
Thanks Jesse, now i understand.

Thank you for your support.
Mert

17 Nisan 2016 Pazar 20:31:17 UTC+3 tarihinde Jesse Gumm yazdı:

Jesse Gumm

ungelesen,
17.04.2016, 13:56:3917.04.16
an chica...@googlegroups.com

You're very welcome.

I'm glad that helped.

Cheers,

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Mert Öztürk

ungelesen,
17.04.2016, 14:09:3917.04.16
an ChicagoBoss
Well bad news is hackney doesn't work with https connection as they wrote "it works". I searched a bit and they had many issues with connection failures.
Can you guys suggest any advice for making REST calls for to use Paypal (https) ?
Good news is i can now add libraries to my app :)

Thanks


17 Nisan 2016 Pazar 20:56:39 UTC+3 tarihinde Jesse Gumm yazdı:

Jesse Gumm

ungelesen,
17.04.2016, 14:26:3917.04.16
an chica...@googlegroups.com

I'm pretty sure I use ibrowse, but when I get back, I'll let you know. I can probably share some paypal code from my work-in-progress payment framework for Nitrogen.

--
Jesse Gumm
Owner, Sigma Star Systems
414.940.4866 || sigma-star.com || @jessegumm

Mert Öztürk

ungelesen,
17.04.2016, 14:30:1517.04.16
an ChicagoBoss
First thing i tried was ibrowse but it also can not make a rest call to a website with https.

Thanks

17 Nisan 2016 Pazar 21:26:39 UTC+3 tarihinde Jesse Gumm yazdı:

Mert Öztürk

ungelesen,
17.04.2016, 16:19:4117.04.16
an ChicagoBoss
Update: restc and hackney worked fine with latest Erlang OTP 18.3;


17 Nisan 2016 Pazar 21:30:15 UTC+3 tarihinde Mert Öztürk yazdı:

me...@lanyardmarket.com

ungelesen,
19.04.2016, 18:29:5019.04.16
an ChicagoBoss
Hello Jesse,

I have implemented a token request with https://github.com/kivra/oauth2_client which is also using restc and it is ok.
Do you have something in mind about making a payment call with restc. I just couldnt figured it out how to put variables in correct form to send REST call.
Trying to implement the call below with CB;

curl -v https://api.sandbox.paypal.com/v1/payments/payment \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer Access-Token" \
  -d '{
    "intent":"sale",
    "redirect_urls":{
      "return_url":"http://example.com/your_redirect_url.html",
      "cancel_url":"http://example.com/your_cancel_url.html"
    },
    "payer":{
      "payment_method":"paypal"
    },
    "transactions":[
      {
        "amount":{
          "total":"7.47",
          "currency":"USD"
        }
      }
    ]
  }'


17 Nisan 2016 Pazar 21:26:39 UTC+3 tarihinde Jesse Gumm yazdı:

Jesse Gumm

ungelesen,
26.04.2016, 18:11:0826.04.16
an chica...@googlegroups.com
Hi Mert,

Sorry for falling off the world for a bit there.

Here's my paypal code: http://pastebin.com/0ybSKHkG

Here's the code I use for Paypal with its IPN (Instant Payment Notification) system.  I haven't used paypal with oauth2, so I'm not sure what it takes to do that.

This module (for Nitrogen, so it has some nitrogen element records in it, but easy enough to figure out) generates a basic HTML form (ppb_paypal_nitro:form/6) that submits to the paypal server.

When the payment is processed, the paypal servers make a request to https://mywebserver/ppb_paypal_nitro with whatever data paypal sends. This request ends up running the ppb_paypal_nitro:main() function, which ends up running ppb_paypal_nitro:process_ipn().  This is where I call the server, and hilariously, I'm just using httpc, the built-in Inets client in Erlang.

Functions that might not be familiar to you here are:

wf:q(atom) - Request a POST or GET value

wf:request_body() - Retrieve the entire POST request body in raw form.

ppb:process_payment() is purely a side-effect thing, so the implementation is unnecessary.  It basically just calls a callback to update the database that a payment was received.

Hopefully this helps a bit,

-Jesse


For more options, visit https://groups.google.com/d/optout.



--

Mert Öztürk

ungelesen,
26.04.2016, 18:14:5126.04.16
an ChicagoBoss
Hello Jesse,

Thank you for your support.
I will check the code as soon as possible and get back to you.

Regards
Mert

27 Nisan 2016 Çarşamba 01:11:08 UTC+3 tarihinde Jesse Gumm yazdı:
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten