Métodos de pago para chile y el mundo
-
Upload
sebastian-gamboa -
Category
Documents
-
view
336 -
download
0
description
Transcript of Métodos de pago para chile y el mundo
MÉTODOS DE PAGO PARACHILE Y EL MUNDO
SEBA GAMBOA
github.com/sagmortwitter.com/sagmor
COBRAR EN LATINOAMERICA ES UN PARTOEn serio si pueden evitarlo, haganlo!
AWWW, STRIPE...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!")
AWWW, STRIPE...$ 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!"
"US ONLY" :(Pero he oido de excepciones ;)
PAYPAL TO THE RESCUE
ALL NEW APIcurl -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/
SHOW ME THE MONEY!Retira tu platita con Retiros Multicaja
https://www.multicaja.cl/retiros/
A VECES NA' QUE HACERLEAceptar débito, aceptar CLP
CHAN, CHAN, CHAAAAAAANN!!!!!
WHAT IF!No CGIs
include TBK@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
INICIAR UN PAGOclass 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 endend
CONFIRMAR EL PAGOclass 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
¿FUNCIONA?creo que $500.000.000+ procesados de esta forma lo
demuestran
PENDIENTESLogger compatible con CGIs (Pa' que transbank no webee)
github.com/sagmor/tbk/issues
'U NO LIKING USING RUBY?MEESA SORRY :(
1. https://github.com/sagmor/tbk/tree/master/lib/tbk/webpay
2. http://sagmor.com/rants/technical/webpay-communication-protocol/
¡HACK TRANSBANK!Tranquilos no ese tipo de hacking ;)
ALGUIEN DIJO "TRANSBANK DEVELOPER NETWORK"?Alguien les tiene que hacer la pega parece
ISSUE #16https://github.com/sagmor/tbk/issues/16
Y LATINOAMERICA?Bastante menos documentadas pero con interfaz similar
github.com/sagmor/pagosonlinegithub.com/sagmor/pag_segurogithub.com/sagmor/mercado_pago
MUCHAS GRACIAS¿PREGUNTAS?