rails-stripe-alipay

所属分类:构建工具
开发工具:Ruby
文件大小:0KB
下载次数:0
上传日期:2018-05-02 23:12:00
上 传 者sh-1993
说明:  通过stripe-rails应用程序接受支付宝
(accepting alipay via stripe rails app)

文件列表:
Gemfile (1911, 2018-05-02)
Gemfile.lock (4638, 2018-05-02)
Rakefile (227, 2018-05-02)
app/ (0, 2018-05-02)
app/assets/ (0, 2018-05-02)
app/assets/config/ (0, 2018-05-02)
app/assets/config/manifest.js (101, 2018-05-02)
app/assets/images/ (0, 2018-05-02)
app/assets/images/.keep (0, 2018-05-02)
app/assets/javascripts/ (0, 2018-05-02)
app/assets/javascripts/application.js (742, 2018-05-02)
app/assets/javascripts/cable.js (358, 2018-05-02)
app/assets/javascripts/channels/ (0, 2018-05-02)
app/assets/javascripts/channels/.keep (0, 2018-05-02)
app/assets/javascripts/charges.coffee (211, 2018-05-02)
app/assets/stylesheets/ (0, 2018-05-02)
app/assets/stylesheets/application.css (736, 2018-05-02)
app/assets/stylesheets/charges.scss (0, 2018-05-02)
app/channels/ (0, 2018-05-02)
app/channels/application_cable/ (0, 2018-05-02)
app/channels/application_cable/channel.rb (79, 2018-05-02)
app/channels/application_cable/connection.rb (85, 2018-05-02)
app/controllers/ (0, 2018-05-02)
app/controllers/application_controller.rb (97, 2018-05-02)
app/controllers/charges_controller.rb (799, 2018-05-02)
app/controllers/concerns/ (0, 2018-05-02)
app/controllers/concerns/.keep (0, 2018-05-02)
app/helpers/ (0, 2018-05-02)
app/helpers/application_helper.rb (29, 2018-05-02)
app/helpers/charges_helper.rb (25, 2018-05-02)
app/jobs/ (0, 2018-05-02)
app/jobs/application_job.rb (43, 2018-05-02)
app/mailers/ (0, 2018-05-02)
app/mailers/application_mailer.rb (102, 2018-05-02)
app/models/ (0, 2018-05-02)
app/models/application_record.rb (78, 2018-05-02)
app/models/concerns/ (0, 2018-05-02)
app/models/concerns/.keep (0, 2018-05-02)
... ...

# Stripe Alipay Demo App ## Overview This project is a demonstration of how to use Stripe to accept Ant Financial's Alipay payments. Unlike credit card payments where the the only action needed is input of the credit card info, Alipay has a few extra steps. Here's an overview of the workflow: 1. Customer performs an action that initiates the transaction, e.g. checkout. 2. On the backend, we create a source object using the Stripe API that contains our credentials and info on the transaction e.g. amount. 3. The API returns a source object which includes a redirect URL. The redirect URL contains a Alipay generated QR code which has the details of this transaction. 4. The customer scans the QR code using their Alipay mobile app. This app tells Alipay that the customer is authorizing a payment from their account to our account. 5. The source now becomes chargeable. We can setup a webhook (from Stripe dashboard) to ping our server with this notification. 6. When the source is chargeable, we make a charge request using the Stripe API. 7. Voila, the money is now in your account! ## Getting this Demo to work 1. Get your Stripe API keys and set them in your ENV variables see the stripe initializer file for details. 2. I have this demo running as a heroku project. This is necessary to get the webhook to hit your server. 3. Setup your Stripe webhook to point to the `actual_charge` endpoint e.g. `http://heroku.herokuapp.com/actual_charge` 3. Navigate to `create_source` to initiate the transaction

近期下载者

相关文件


收藏者