How to implement BDD using JBehave? - bdd

How to make acceptance test with JBehave with this story?
I've read many tutorial, but still find difficulty to implement in JBehave.
Could you give example step by step to create it? Thank you.
SCENARIO : Accessing Card Payment Page
GIVEN Customer log in at Dashboard
AND able to see his/her list of Card
WHEN Customer Click Quick Action in one of card
AND Choose Payment
THEN Customer will be redirect into Card Payment Page which contain information such as ( Name, Card name, Input amount for payment and Input description"

Related

Paying before registration information is saved to the DB

So I have everything implemented with braintree and rails. However, I wanted to switch it up a little. I have a user role which is a business account. When someone wants to sign up as a business account I want them to pay before the devise registration is actually saved? I've seen it on a lot of website but cant really find any resources online how to do it. Someone please give an example of how it can work.
As a general Idea what you can do is one registration of user on business account take the card information also for billing.
On submit of that information it will go to a controller action with all the params of registration and billing.
Try to charge the card through brain tree and if they payment is successfull you can register the user because you have access to the params and you can save this transaction for the user also.
Its just a general idea that how can you implement it.
As one of the comments say, you question is vague.
What I would do is to have a column in that table that tells whether the record has payed or not.
If it hasn't payed then restrict its ability to log in. This way you can still record its information and it may be usefull for some cases, say to remind that user through an email that he/she should complete its payment.

User with bank account info

I have the following doubt, I hope you can help me. I have a project in Rails which allows any user to register on the website, this user has the option to enter information from his bank account for the site to make the deposit for his services, then I have a user model that Is related to account_bank model:
How can I make the url appear like this www.sitio.com/usuario/pepe/cuenta_banco?
If I do it in the traditional way, I get it www.sitio.com/usuario/pepe/cuenta_banco/123
Thanks for the help.

Clarification on using stripe

I'm essentially following this guide:
https://rails.devcamp.com/ruby-gem-walkthroughs/payment/how-to-use-a-custom-form-for-stripe
However, I'm confused about two things:
What if I want to add additional data to be filled out by the user, such as billing address, zip code, full name, and use that for stripe to verify the credit card with? What do I need to add and where?
How do I tell that the payment has gone through? I'm going to be selling an online product -- I need some way to verify that the user has paid successfully in order to unlock access to the product.
Thanks!
1) You can specify with the Stripe.js options whether you would like to add billing and/or shipping address to your checkout form.
2) You can check your payment results by:
The return value of your API call to create a charge. Look for the status parameter
Log in to your dashboard and check it there
Use Stripe's webhooks, and listen for the charge.succeeded event type.

PayPal using MVC issues

I am trying to set up a simple payment using PayPal and MVC, right now I have code which accepts an ID from the database on items you can purchase.
I have managed to find code which takes me to this screen:
I have some code which after you click "Continue" PayPal will return to and call, but the only thing I have in that bit of code is this:
public ActionResult PayPalExpressCheckoutAuthorisedSuccess(string token, string PayerID)
{
return RedirectToAction("GivePurchasedItemsToUse");
}
I can see they have given me the token and payer id, but I am unsure where to go from here, in the PayPalExpressCheckourAuthorisedSuccess method, do I send something back to PayPal? Nothing yet has been displayed on any of the two PayPal accounts I am using.
The tutorial I followed was: http://rituranjangupta.blogspot.nl/2012/10/paypal-with-aspnet-mvc.html
Assuming I understood the state of where you are, which is after a user has "approved*" a Paypal Payment (where Paypal redirects back to your RETURNURL), you will need to "complete" the transaction.
GetExpressCheckoutDetails - (optional) if you want to obtain details e.g. Paypal shipping address
DoExpressCheckoutPayment - this is the actual step that completes the transaction
Extensive Reference: Paypal Developer -> Express Checkout
*approved
TIP: Don't misinterpret "approved" as "payment" - all it really means is that the user has approved a Paypal payment for you to use (e.g. user has agreed to pay some amount, chosen what funding source, shipping, etc.) - you still need to "finalize" things
Hth..

WorldPay integration

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.

Resources