This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | Tue Jul 08 14:04:41 -0700 2008 | [fesplugas] |
| |
README | Tue Jul 08 17:40:27 -0700 2008 | [fesplugas] |
| |
Rakefile | Tue Jul 08 14:04:55 -0700 2008 | [fesplugas] |
| |
app/ | Mon Sep 29 02:16:58 -0700 2008 | [spejman] |
| |
config/ | Tue Jul 08 17:23:41 -0700 2008 | [fesplugas] |
| |
doc/ | Tue Jul 08 17:28:05 -0700 2008 | [fesplugas] |
| |
generators/ | Tue Jul 08 17:25:16 -0700 2008 | [fesplugas] |
| |
init.rb | Tue Jul 08 17:23:20 -0700 2008 | [fesplugas] |
| |
install.rb | Tue Jul 08 14:04:05 -0700 2008 | [fesplugas] |
| |
lib/ | Mon Sep 29 02:19:00 -0700 2008 | [spejman] |
| |
test/ | Tue Jul 08 17:27:52 -0700 2008 | [fesplugas] |
README
= Simplified Sermepa
Plugin for doing Sermepa (La Caixa, BBVA, MasterCard) payments.
== Usage
In order to use Simplified Sermepa you need:
- A <tt>config/sermepa.yml</tt> file explained above.
- A model used to store orders by default Order but configurable at `sermepa.yml`.
- A model used to store transaction details by default OrderTransaction
but configurable at `sermepa.yml`.
The Order model attributes:
Order
token
...
The OrderTransaction model attributes:
OrderTransaction
raw_response
order_id
created_at
updated_at
== ToDo
- Tests.
- Generators.
- Models shouldn't be hardcoded.
- Method to generate token.
== Configuration
After installing the plugin a configuration file named `sermepa.yml` will
be created under `RAILS_ROOT/config`
Example:
development:
fuc: 201920191
secret_key: h2u282kMks01923kmqpo
payment_url: https://sis-t.sermepa.es:25443/sis/realizarPago
ipn_url: http://sample.no-ip.org:3000/sermepa_backend/create
success_url: http://0.0.0.0:3000/store/thanks
failure_url: http://0.0.0.0:3000/store/checkout?message=error
test:
...
production:
...
=== Testing
You can use the following credit card to test your application.
Fuc: 201920191
Secret Key: h2u282kMks01923kmqpo
Tarjeta: 4548812049400004
Fecha de caducidad: 12/07
CIP: 123456
== Example
On your models ...
##
# app/models/order.rb
#
class Order < ActiveRecord::Base
use_sermepa
end
After adding <tt>use_sermepa</tt> to your model, it will be enable to
accept transactions.
>> Order.find_by_token('QWERTY').ipn_success?
=> true
>> Order.find_by_token('QWERTY).ipn_code
=> '0000'
So after creating an order you can deliver the confirmation email to your
client or run the desired task.
class Order < ActiveRecord::Base
use_sermepa
after_create :notify_dispatch_and_user
def notify_dispatch_and_user
if self.ipn_success?
# Deliver email with ActiveMailer ...
end
end
end
On your views ...
##
# app/views/payments/confirm.html.erb
#
<%= form_submit_to_sermepa(amount, token) %>
Copyright (c) 2008 Sergio Espeja and Francesc Esplugas, released under the MIT license




