WorldPay integration - symfony1

I am currently working a system whereby my users can pay for items that they have added to an order.
The payment will be using Worldpay.
I have a Worldpay account, but I am a little confused as to what steps I need to do next.
I am using symfony and I have an order, with products associated to it. I have then created a 'Pay Now' link, which links to a executePayment action.
What I'd really like, is for this to then take me to the hosted payment pages on Worldpay, pay for the order and then takes me back to my site to an order success page.
Has anyone implemented WorldPay using symfony before?
Thanks
EDIT:
So It seems, that I can have a form on the page where the Pay Now button is, but change it to a <input type="submit" /> and then post the details to https://secure-test.wp3.rbsworldpay.com/wcc/purchase
Is there some kind of callback functioanlity, to redirect me to a confirmation/failure page if the transaction was completed?
Thanks

WorldPay works like this...
1) You have a form on your website that collects your customer details. You then POST this data to https://secure-test.wp3.rbsworldpay.com/wcc/purchase
2) The customer will add their payment details in to WorldPay
3) Next, (depending on if the payment was successful or not) the user will be either directed to your resultY.html or resultC.html page that you can upload to your file management section within the WorldPay admin.
Alternatively you can supply a URL to a callback file on your server that is pinged when the customer clicks pay. This allows you to get information about the transaction and add it to your database.
With the callback page on your server, you can output a confirmation of payment, but you then have to include a link to physically get the user to come back to your site. I think automatically redirecting from this page is against Worldpay's T&Cs.
Hope this helps.
Philip

I user RBSWorldPay with Symfony - its very simple to setup - yes there is a callback function that you setup within the Settings of your RBSWorldPay account - you can also test by adding a test field - again check the RBS Documentation for testing.

Related

Get first_name (and other info) from Paypal and create Rails Devise account using paypal-recurring gem

I have create the basics of subscription Paypal using the RailsCast and now I'm doing what is missing there.
Now I'm developing the process to do the Devise user registration together/just after the payment is done. For now, I'm trying something like this and this.
As the RailsCast got the e-mail from PayPal using this line:
#subscription.email = PayPal::Recurring.new(token: params[:token]).checkout_details.email
So, I thought that I could get first name, middle name and last name from PayPal as well. From PayPal documentation it seems that it is possible but I couldn't get it through paypal-recurring gem.
I have tried to see if I can learn what I have to do from paypal-recurring GitHub docs and code but I couln't find and tried some possibilities without success.
Is it possible? Maybe in another way not using paypal-recurring gem?
If you have another recomendation/reference to do this registration process, please, let me know.
Update
As #Andrew suggested PayPal IPN, I thought it would be better update my question as I want to have the first_name from PayPal as a default value to ease the process to the user register in my database but he or she may want to change to another name.
The process that I want is something like:
The user chooses his plan and to pay with PayPal
User is sent to PayPal
User fills payment info on PayPal site
User is sent again to my site
My site gets e-mail and name of the user from PayPal and asks the user to confirm or change the data, and provide his password to create the login to my site
My site uses the user data provided to register the user and sends the request to PayPal to request the payment and create the recurring profile
Ok, based on your current outline of steps you can handle that exact flow using Express Checkout.
SetExpressCheckout will generate a token for you, and you then redirect the user to PayPal. They review and approve the payment and are then redirected back to your site. There you can call GetExpressCheckoutDetails to obtain the email, name, address, etc. and display a final review page for the customer to confirm everything or make changes if necessary. Finally, you'd call DoExpressCheckoutPayment to finalize the payment using the customers confirmed details.
I would look at PayPal IPN (Instant Payment Notification). It'll POST transaction details to a listener script you have sitting on your server so you can process the data accordingly in real-time.

Trigger paypal donate on form submit

i'm working on a paypal donate feature in a rails 4 app. I'm not very familiar with paypal api, so any advices about the right way to work with it are welcome.
What i want to do:
the donate page is a form to create a new Donateur object who will hold all informations about the donator like name, email, status of the donation (paid or not) etc
When a user fill and submit this form to make a donation, i want to redirect him to the paypal paiement page (after the form submission has succeed).
Then, when paypal donation is done, IPN send to my app the paiement datas so i can update the previous Donateur entry created and fill informations about the success or failure of the donation.
What i got
I have the classic form for creating a new Donateur object, nothing special here.
In my controller, i wonder how i can redirect user to the paiement page of my paypal account
#donateurs_controller.rb
def create
#donateur = Donateur.new(post_params)
#donateur.save ? redirect_to(PAYPAL_DONATE_PAGE) : render('index')
end
The callback (after paiement) doesn't matter for the moment
My question
Donations with paypal are they classic transactions (so i could use the api like if i was selling some products) or should i specifiy something about it s a donation while make a payement call?
Thanks
I've fix my problems. I used this gem https://github.com/paypal/buttonmanager-sdk-ruby to generate a donate button on form submit. I can get programmaticaly the api request url sent when clicking this button, so i don't have to display it on the screen.

Using Existing CAS to authenticate users on another website

First time posting, but been a long time reader. I'm tasked to use my university's CAS to authenticate users on a ruby on rails app. I have my welcome page that has a link to the signon screen that then is forwarded to a dashboard with a ticket in the url. I'm a bit confused on how to take that ticket and authenticate the ticket in order to get the info of the user that has logged in. Please help. THanks in advance.
Your application must take the ticket returned by the user's browser and make a direct call back to CAS and "turn in" the ticket to retrieve the actual user information.
You basically have three protocols/endpoints that can be used: /cas/validate, /cas/serviceValidate, and /cas/samlValidate. See http://www.jasig.org/cas/protocol for details.
But instead of writing your own solution, check out Ruby on Rails CAS Clients for a couple of options.

Facebook Connect - simply add a user's Facebook profile url into database via Rails

I'm coding a simple app which should use some FB connect mechanics but I don't want too much overhead here so maybe you can share your thoughts/experience on my task:
merchants can post products they want to give away for free
users can register for the article and get into a raffle
Once a user enters the page, I want the page to connect to his FB profile URL (facebook.com/username). User hits a "Add me to the raffle" button, the FB profile URL gets stored into my model. The merchant or a cron choses the FB profile URL randomly, displays it and lets the merchant connect to the winner (this I realised already).
This is what I've done so far:
http://limitless-brook-6233.herokuapp.com/ads/1
as you can see, I realised it via email addresses which get shuffled by the merchant. This is not very clever since FB profiles are somehow more unique and everyone can participate only one time.
What is the smartest way in your opinion to retrieve a user's Facebook URL and store it into my database? I just need to attach it to some text/input field (non editable) and let the user hit that button.
Thanks for any support.
You need to use Facebook login, take a look here
https://developers.facebook.com/docs/facebook-login/
or here
https://github.com/mkdynamic/omniauth-facebook
for the second one use version 1.4.0 as 1.4.1 has ome annoying bugs.

Redirect back to "purchases" page after order completion

I've inherited an app which uses the legacy shopify API and I have a hard deadline of August 21st, so I want to avoid updating the API to solve the problem.
We are selling e-documents, and the current purchase process is as follows:
User searches and places a product in the cart
The User checks out
and goes through the purchase process on the Shopify site
This all seems to work fine. What we would like is to redirect the user back to our app with information about the successful purchase (or failure) of the products. As it stands, we don't know what products the user has purchased and we are therefore unable to provide them links to download the documents.
Is there some parameter we can pass to shopify to create that redirect, or do we need to ping the API about past purchases, or is there some other step we are missing?
This one is quite easy... Shopify provides you with a textarea element in the admin (checkout and payments) where you can paste code. In this code, you have access to the entire order contents. You can get at this with Liquid.
All you have to do, is render a link to your App and pass the order details to the App via that link. Now your customers will see the Thank You for your purchase, and a button/link to click to complete things as you wish.
Okay, it turns out that what I'm looking for are shopify Webhooks: http://wiki.shopify.com/WebHook
It appears that the app is already set up to send order_create and order_payed and all we have to do is capture the data sent to us.

Resources