- 浏览: 2539774 次
- 性别:
- 来自: 成都
文章分类
最新评论
-
nation:
你好,在部署Mesos+Spark的运行环境时,出现一个现象, ...
Spark(4)Deal with Mesos -
sillycat:
AMAZON Relatedhttps://www.godad ...
AMAZON API Gateway(2)Client Side SSL with NGINX -
sillycat:
sudo usermod -aG docker ec2-use ...
Docker and VirtualBox(1)Set up Shared Disk for Virtual Box -
sillycat:
Every Half an Hour30 * * * * /u ...
Build Home NAS(3)Data Redundancy -
sillycat:
3 List the Cron Job I Have>c ...
Build Home NAS(3)Data Redundancy
Stripe Payment(1)Introduction Of Payments and Docs
Test Card Number
https://stripe.com/docs/testing#cards
1. Checkout form
https://stripe.com/docs/tutorials/checkout
The data will be sent to Stripe and Stripe will auto post a token to our server side.
<form action="http://requestb.in/w8djhzw8" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_rRej93hjdXTW9TaWUGSv1odD"
data-amount="2000"
data-name="Demo Site"
data-description="2 widgets ($20.00)"
data-image="/128x128.png"
data-locale="auto">
</script>
2. Charge the Customer
https://stripe.com/docs/tutorials/charges
https://stripe.com/docs/api#create_charge
Try with Java API in Scala
The Dependency
"com.stripe" % "stripe-java" % "1.37.0", //MIT
The JAVA Codes
package com.sillycat.stripe
import java.util
import com.stripe.Stripe
import com.stripe.model.Charge
object StripeApp extends App{
Stripe.apiKey = "sk_test_xxxxxxx"
val token = "tok_xxxxxxxxxxx"
val chargeParams = new util.HashMap[String, Object]()
chargeParams.put("amount", new Integer(400))
chargeParams.put("currency", "usd")
chargeParams.put("source", token)
chargeParams.put("description", "Charge for test@example.com")
val charge:Charge = Charge.create(chargeParams)
println(charge)
}
Stripe tokens can only be used once.
All the APIs are here.
https://stripe.com/docs/api/java#capture_charge
3. Creating Subscription
https://stripe.com/docs/tutorials/subscriptions
We first create plan, and the plan can be day, week, month or year.
https://stripe.com/docs/api/java#create_plan
Then we subscribe a customer to a plan.
https://stripe.com/docs/api/java#create_customer
4. Share Charges
https://stripe.com/docs/connect/payments-fees
https://stripe.com/docs/api#create_account
First of all, Go to [Connect] and Register my Platform Settings.
The flow I tried:
1. Step 1. Create platform account for Sillycat. (platform)
2. Step 2. Use API to create connect account in Sillycat for Kiko. (third party application name)
3. Step 3. End user Carl post payment 20$ to Kiko in browser(Can be our iOS or Android application)
4. Step 4. There is a web hook that once the payment is sent, our HTTP API Server side will receive a token from Stripe.
5. Step 5. Using that payment token, we will create a user account for the end user Carl and receiving a customer token.
6. Step 6. In the web hook HTTP Server, we will call stripe JAVA API with the customer token to split the payment 20$ into 10$ to customer account Kiko (No transaction fee from stripe), 0.88$ into stripe(Transaction fee), 9.12$ into platform account Sillycat.
Some Notes:
1. We can create many other connect accounts, like Kiko2, Kiko3 and etc.
2. We can save the customer token for future payment. We can charge the customer any time we need.
Here is the core codes in sillycat-stripe
package com.sillycat.stripe
import java.util
import com.stripe.Stripe
import com.stripe.model.{Customer, Account, Charge}
object StripeApp extends App{
Stripe.apiKey = "sk_test_M1rxxxxx" // luohuazju
//Stripe.apiKey = "sk_test_35ffxxxxxx" //cluo
val token = "tok_16qnxxxxxx"
// //Creating an account
// val accountParams = new util.HashMap[String, Object]()
// accountParams.put("managed", java.lang.Boolean.FALSE)
// accountParams.put("country", "US")
// accountParams.put("email", "cluo@jobs2careers.com")
//
// Account.create(accountParams)
// //fetch Account
// val result = Account.retrieve()
// println(result)
//create customer
// val customerParams = new util.HashMap[String, Object]()
// customerParams.put("description", "Customer for test@example.com")
// customerParams.put("source", token)
//
// Customer.create(customerParams)
//list Customers
// val customerParams = new util.HashMap[String, Object]()
// customerParams.put("limit", new Integer(3))
//
// val results = Customer.all(customerParams)
// println(results)
//Charge
val chargeParams = new util.HashMap[String, Object]()
chargeParams.put("amount", new Integer(1000))
chargeParams.put("currency", "usd")
//chargeParams.put("source", token)
chargeParams.put("customer", "cus_74xxxxxx")
chargeParams.put("description", "Charge for cluo@example.com")
chargeParams.put("destination", "acct_16qmbxxxxx")
chargeParams.put("application_fee", new Integer(500))
val charge:Charge = Charge.create(chargeParams)
println(charge)
}
References:
http://www.kuqin.com/shuoit/20150728/347262.html stripe with swift
official document
https://stripe.com/docs
https://stripe.com/docs/api#create_charge
Test Card Number
https://stripe.com/docs/testing#cards
1. Checkout form
https://stripe.com/docs/tutorials/checkout
The data will be sent to Stripe and Stripe will auto post a token to our server side.
<form action="http://requestb.in/w8djhzw8" method="POST">
<script
src="https://checkout.stripe.com/checkout.js" class="stripe-button"
data-key="pk_test_rRej93hjdXTW9TaWUGSv1odD"
data-amount="2000"
data-name="Demo Site"
data-description="2 widgets ($20.00)"
data-image="/128x128.png"
data-locale="auto">
</script>
2. Charge the Customer
https://stripe.com/docs/tutorials/charges
https://stripe.com/docs/api#create_charge
Try with Java API in Scala
The Dependency
"com.stripe" % "stripe-java" % "1.37.0", //MIT
The JAVA Codes
package com.sillycat.stripe
import java.util
import com.stripe.Stripe
import com.stripe.model.Charge
object StripeApp extends App{
Stripe.apiKey = "sk_test_xxxxxxx"
val token = "tok_xxxxxxxxxxx"
val chargeParams = new util.HashMap[String, Object]()
chargeParams.put("amount", new Integer(400))
chargeParams.put("currency", "usd")
chargeParams.put("source", token)
chargeParams.put("description", "Charge for test@example.com")
val charge:Charge = Charge.create(chargeParams)
println(charge)
}
Stripe tokens can only be used once.
All the APIs are here.
https://stripe.com/docs/api/java#capture_charge
3. Creating Subscription
https://stripe.com/docs/tutorials/subscriptions
We first create plan, and the plan can be day, week, month or year.
https://stripe.com/docs/api/java#create_plan
Then we subscribe a customer to a plan.
https://stripe.com/docs/api/java#create_customer
4. Share Charges
https://stripe.com/docs/connect/payments-fees
https://stripe.com/docs/api#create_account
First of all, Go to [Connect] and Register my Platform Settings.
The flow I tried:
1. Step 1. Create platform account for Sillycat. (platform)
2. Step 2. Use API to create connect account in Sillycat for Kiko. (third party application name)
3. Step 3. End user Carl post payment 20$ to Kiko in browser(Can be our iOS or Android application)
4. Step 4. There is a web hook that once the payment is sent, our HTTP API Server side will receive a token from Stripe.
5. Step 5. Using that payment token, we will create a user account for the end user Carl and receiving a customer token.
6. Step 6. In the web hook HTTP Server, we will call stripe JAVA API with the customer token to split the payment 20$ into 10$ to customer account Kiko (No transaction fee from stripe), 0.88$ into stripe(Transaction fee), 9.12$ into platform account Sillycat.
Some Notes:
1. We can create many other connect accounts, like Kiko2, Kiko3 and etc.
2. We can save the customer token for future payment. We can charge the customer any time we need.
Here is the core codes in sillycat-stripe
package com.sillycat.stripe
import java.util
import com.stripe.Stripe
import com.stripe.model.{Customer, Account, Charge}
object StripeApp extends App{
Stripe.apiKey = "sk_test_M1rxxxxx" // luohuazju
//Stripe.apiKey = "sk_test_35ffxxxxxx" //cluo
val token = "tok_16qnxxxxxx"
// //Creating an account
// val accountParams = new util.HashMap[String, Object]()
// accountParams.put("managed", java.lang.Boolean.FALSE)
// accountParams.put("country", "US")
// accountParams.put("email", "cluo@jobs2careers.com")
//
// Account.create(accountParams)
// //fetch Account
// val result = Account.retrieve()
// println(result)
//create customer
// val customerParams = new util.HashMap[String, Object]()
// customerParams.put("description", "Customer for test@example.com")
// customerParams.put("source", token)
//
// Customer.create(customerParams)
//list Customers
// val customerParams = new util.HashMap[String, Object]()
// customerParams.put("limit", new Integer(3))
//
// val results = Customer.all(customerParams)
// println(results)
//Charge
val chargeParams = new util.HashMap[String, Object]()
chargeParams.put("amount", new Integer(1000))
chargeParams.put("currency", "usd")
//chargeParams.put("source", token)
chargeParams.put("customer", "cus_74xxxxxx")
chargeParams.put("description", "Charge for cluo@example.com")
chargeParams.put("destination", "acct_16qmbxxxxx")
chargeParams.put("application_fee", new Integer(500))
val charge:Charge = Charge.create(chargeParams)
println(charge)
}
References:
http://www.kuqin.com/shuoit/20150728/347262.html stripe with swift
official document
https://stripe.com/docs
https://stripe.com/docs/api#create_charge
发表评论
-
Stop Update Here
2020-04-28 09:00 310I will stop update here, and mo ... -
NodeJS12 and Zlib
2020-04-01 07:44 466NodeJS12 and Zlib It works as ... -
Docker Swarm 2020(2)Docker Swarm and Portainer
2020-03-31 23:18 361Docker Swarm 2020(2)Docker Swar ... -
Docker Swarm 2020(1)Simply Install and Use Swarm
2020-03-31 07:58 363Docker Swarm 2020(1)Simply Inst ... -
Traefik 2020(1)Introduction and Installation
2020-03-29 13:52 328Traefik 2020(1)Introduction and ... -
Portainer 2020(4)Deploy Nginx and Others
2020-03-20 12:06 419Portainer 2020(4)Deploy Nginx a ... -
Private Registry 2020(1)No auth in registry Nginx AUTH for UI
2020-03-18 00:56 428Private Registry 2020(1)No auth ... -
Docker Compose 2020(1)Installation and Basic
2020-03-15 08:10 364Docker Compose 2020(1)Installat ... -
VPN Server 2020(2)Docker on CentOS in Ubuntu
2020-03-02 08:04 444VPN Server 2020(2)Docker on Cen ... -
Buffer in NodeJS 12 and NodeJS 8
2020-02-25 06:43 376Buffer in NodeJS 12 and NodeJS ... -
NodeJS ENV Similar to JENV and PyENV
2020-02-25 05:14 464NodeJS ENV Similar to JENV and ... -
Prometheus HA 2020(3)AlertManager Cluster
2020-02-24 01:47 413Prometheus HA 2020(3)AlertManag ... -
Serverless with NodeJS and TencentCloud 2020(5)CRON and Settings
2020-02-24 01:46 330Serverless with NodeJS and Tenc ... -
GraphQL 2019(3)Connect to MySQL
2020-02-24 01:48 242GraphQL 2019(3)Connect to MySQL ... -
GraphQL 2019(2)GraphQL and Deploy to Tencent Cloud
2020-02-24 01:48 443GraphQL 2019(2)GraphQL and Depl ... -
GraphQL 2019(1)Apollo Basic
2020-02-19 01:36 320GraphQL 2019(1)Apollo Basic Cl ... -
Serverless with NodeJS and TencentCloud 2020(4)Multiple Handlers and Running wit
2020-02-19 01:19 306Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(3)Build Tree and Traverse Tree
2020-02-19 01:19 310Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(2)Trigger SCF in SCF
2020-02-19 01:18 285Serverless with NodeJS and Tenc ... -
Serverless with NodeJS and TencentCloud 2020(1)Running with Component
2020-02-19 01:17 302Serverless with NodeJS and Tenc ...
相关推荐
在stripe-payment- go run server.go目录中,键入go run server.go以启动中间件。 WebHooks的条带化CLI stripe login完成浏览器上的登录。 stripe listen --forward-to http://localhost:3000/webhook观察来自运行...
7. **安全性**: Stripe遵循PCI DSS(Payment Card Industry Data Security Standard)标准,确保所有支付数据的安全传输和存储,降低了支付过程中的风险。 8. **错误处理**: PHP SDK提供了丰富的错误处理机制,当...
在"stripe-card-payment"项目中,我们看到以下几个关键文件: 1. `global.css`:这是一个全局CSS样式表,用于定义项目的样式规则,包括按钮、表单、布局等,以确保页面的视觉一致性。 2. `checkout.html`:这是...
通过npm进行演示安装:yarn add vue-stripe-payment-或-npm install vue-stripe-payment使用此插件向您的应用程序添加vue-stripe-payment就像其他插件一样简单:从'vue'导入Vue; 从'vue-stripe-p导入...
使用springboot 开发Stripe支付的一个demo,大家可以下载参考一下,博客地址:https://blog.csdn.net/maxi1234/article/details/105002346
安装$ yarn add react-native-stripe-payments $ npx react-native link react-native-stripe-payments该库附带需要与React Native一起编译的平台本机代码。这需要您配置可通过完成的构建工具。用法设置首先,您必须...
- `upload/catalog/controller/extension/payment/stripe.php` 和 `upload/admin/controller/extension/payment/stripe.php`:分别对应于前台和后台的控制器,处理用户支付请求和管理员的设置操作。 - `upload/...
标题"laravel-stripe-example:如何在Laravel项目中集成Stripe Payment Gateway"表明我们讨论的主题是关于在使用Laravel框架构建的Web应用中整合Stripe支付网关的过程。Stripe是一个流行的在线支付处理平台,它提供了...
stripe_payment 使用Stripe方便地保护付款方式。 快速浏览 这个Flutter插件是React Native的tipsi-stripe插件的直接移植-我们试图保持API尽可能接近,因此文档中应用了此插件。 从用户的Card Input和** Apple&...
1. **安装扩展**:首先,你需要找到并下载适合 OpenCart 3.x 的 PayPal 和 Stripe 扩展。这些通常可以在 OpenCart 市场或其他第三方插件市场找到。提供的压缩包“opencart-3-x”可能包含了这些扩展的安装文件。 2. ...
1. **安装Stripe库**: 首先,我们需要在项目中引入Stripe的JavaScript库。可以通过CDN链接或者npm包管理器安装。例如,在HTML文件中添加: ```html <script src="https://js.stripe.com/v3/"></script> ``` 2. *...
Easy E-Commerce Using Laravel And Stripe 2015 Lean Publishing 2015 by W. Jason Gilmore and Eric L. Barnes
Magento 1的条纹信用卡扩展安装说明在安装扩展程序之前,请确保已禁用Magento缓存,并且已关闭编译。 还强烈建议在将扩展部署到生产之前,首先将其安装在测试/过渡环境中。下载扩展从GitHub下载zip文件。将文件复制...
**Laravel 开发与 Stripe 集成** 在 Laravel 框架中集成 Stripe 支付系统是一项常见的任务,尤其对于构建电子商务网站或其他需要在线支付功能的 Web 应用程序。Stripe 是一个流行的付款处理平台,它允许开发者轻松...
**Laravel 开发与 Stripe 集成** 在 Laravel 框架中,Stripe 是一个常用的支付处理库,尤其适用于在线订阅服务和一次性付款。Stripe 提供了一个简单易用的 API,使得开发者能够轻松地在应用程序中添加支付功能。本...
本文将重点介绍使用Go语言实现的Stripe API客户端库——Go-stripe,以及如何利用这个库来高效地与Stripe API进行交互。 首先,让我们理解什么是Go-stripe。Go-stripe是针对Stripe API开发的一个Golang客户端库,它...
Stripe是一家知名的在线支付处理平台,为开发者提供便捷的API接口,使得集成支付功能变得简单。在给定的压缩包文件中,“stripe-checkout-sample-code_stripe_phpstripedemo_”显然是一个PHP版本的Stripe Checkout...
亚马逊克隆构建Amazon克隆:Nodejs + MongoDB + Stripe Payment(Udemy课程) 参考: https://www.udemy.com/build-an-amazon-clone-nodejs-stripe-elasticsearch/Check git log, branches, pm/history.txt for ...