En serio si pueden evitarlo, haganlo!
Stripe.api_key = "sk_test_mkGsLqEW6SLnZa487HYfJVLf"
Stripe::Charge.create(
amount: 400,
currency: "usd",
card: {
name: "John Doe",
number: 4111111111111111,
exp_month: 1,
exp_year: 2014,
cvc: 123
},
description: "Give me the money!"
)
$ curl https://api.stripe.com/v1/charges \
-u "sk_test_mkGsLqEW6SLnZa487HYfJVLf:" \
-d "amount=400" \
-d "currency=usd" \
-d "card[name]=John Doe" \
-d "card[number]=4111111111111111" \
-d "card[exp_month]=1" \
-d "card[exp_year]=2014" \
-d "card[cvc]=123" \
-d "description=Mum me can charge from thy terminal!"
Pero he oido de excepciones ;)
curl -v https://api.sandbox.paypal.com/v1/payments/payment \
-H 'Content-Type:application/json' \
-H 'Authorization:Bearer EOjEJigcsRhdOgD7_76lPfrr45UfuI43zzNzTktUk1MK' \
-d '{
"intent":"sale",
"redirect_urls":{
"return_url":"http://return URL here",
"cancel_url":"http://cancel URL here"
},
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"USD"
},
"description":"This is the payment transaction description."
}
]
}'
https://developer.paypal.com/webapps/developer/docs/integration/web/accept-paypal-payment/
Retira tu platita con Retiros Multicaja
https://www.multicaja.cl/retiros/
Aceptar débito, aceptar CLP
No CGIs
@payment = Webpay::Payment.new({
amount: 10_000,
order_id: 1234,
success_url: webpay_success_url,
confirmation_url: webpay_confirmation_url
failure_url: webpay_failure_url
})
redirect_to @payment.redirect_url
http://sagmor.com/tbk
class WebpayController < ApplicationController
def pay
@payment = TBK::Webpay::Payment.new({
amount: ORDER_AMOUNT,
order_id: ORDER_ID,
success_url: webpay_success_url,
# Webpay can only access the HTTP protocol to a direct IP address (keep that in mind)
confirmation_url: webpay_confirmation_url(host: SERVER_IP_ADDRESS, protocol: 'http'),
failure_url: webpay_failure_url # success_url is used by default
})
# Redirect the user to Webpay
redirect_to @payment.redirect_url
end
end
class WebpayController < ApplicationController
def confirmation
@confirmation = TBK::Webpay::Confirmation.new(request.raw_post)
if ... # confirmation is invalid for some reason (wrong order_id or amount, double payment, etc...)
render text: @confirmation.reject
return # reject and stop execution
end
if @confirmation.success?
# EXITO!
# perform everything you have to do here.
end
# Acknowledge payment
render text: @confirmation.acknowledge
end
end
creo que $500.000.000+ procesados de esta forma lo demuestran
Tranquilos no ese tipo de hacking ;)
Alguien les tiene que hacer la pega parece
https://github.com/sagmor/tbk/issues/16
Bastante menos documentadas pero con interfaz similar