Skip to content

Instantly share code, notes, and snippets.

View appsgenii's full-sized avatar

AppsGenii appsgenii

View GitHub Profile
# I am using Stripe Connect and stroing Customers to my account
# Get Customer from Stripe
stripe_customer = Stripe::Customer.retrieve(stripe_customer_id)
# From AliPay Checkout I got stripeToken e.g. atok_asjdasalkj
strip_alipay = stripe_customer.sources.create({ source: params[:stripeToken] })
# I saved strip_alipay.id for future use
stripe_token = Stripe::Token.create(
{
# I am using Stripe Connect and stroing Customers to my account
# Get Customer from Stripe
stripe_customer = Stripe::Customer.retrieve(stripe_customer_id)
# From AliPay Checkout I got stripeToken e.g. atok_asjdasalkj
strip_alipay = stripe_customer.sources.create({ source: params[:stripeToken] })
# I saved strip_alipay.id for future use
stripe_charge = Stripe::Charge.create(
stripe_bitcoin_receiver = Stripe::BitcoinReceiver.create(
{
amount: dollar_to_cents(amount),
currency: currency,
description: charge_description,
refund_mispayments: true,
email: user.email,
metadata: charge_metadata
},
merchant_stripe_access_token
stripe_customer = Stripe::Customer.create(
description: "ShareNGo Customer",
email: email,
metadata: { "First Name" => user.first_name,
"Last Name" => user.last_name,
"Email" => user.email }
)
strip_card = stripe_customer.sources.create(
{
@appsgenii
appsgenii / payment.rb
Last active August 29, 2015 14:24
Stripe Payment Issue
When I am trying to authorized charge then I am getting sucess response with
stripe_charge = Stripe::Charge.create(
{
amount: 1000,
currency: "usd",
source: stripe_token.id,
description: "Charge for Invoice",
application_fee: 100,
capture: false