[英]FoxyCart credit card payment testing
Currently, I want to use FoxyCart to handle the shopping cart and checkout process of my website. 目前,我想使用FoxyCart处理网站的购物车和结帐流程。 The payment gateway behind is Stripe. 后面的支付网关是Stripe。 I am actually using the card numbers for testing provided by stripe for the checkout. 我实际上是使用条纹提供的用于检验的卡号。
This is what I filled in: 这是我填写的内容:
I am trying to make things work, however..... 我正在尝试使事情正常,但是.....
This message comes out when I completed the checkout form and click the checkout button: 当我填写结帐表格并单击“结帐”按钮时,将显示以下消息:
Error: Your payment was declined for the following reason: Sending credit card numbers directly to the Stripe API is generally unsafe. 错误:由于以下原因,您的付款被拒:直接将信用卡号发送到Stripe API通常是不安全的。 We suggest you use test tokens that map to the test card you are using, see https://stripe.com/docs/testing . 我们建议您使用映射到您正在使用的测试卡的测试令牌,请参阅https://stripe.com/docs/testing 。
Stripe told me that they declined my request: Stripe告诉我他们拒绝了我的请求:
I don't quite understand how do checkout testing using the test tokens which was the method they suggested. 我不太了解如何使用测试令牌来进行结帐测试,这是他们建议的方法。 Is there any can help me? 有什么可以帮助我的吗? I just want to make it work. 我只是想使其工作。 Please feel free to give me other solution if you have one. 如果您有其他解决方案,请随时给我。
These are what I have done so far: 这些是我到目前为止所做的:
Checkout.pug Checkout.pug
extends ../../layouts/layout-checkout
block content
// link example
a(href='https://playground.foxycart.com/cart?name=Cool%20Example&price=10&color=red&code=sku123') Add a red Cool Example
// form example
form(action='https://whre-playground2.foxycart.com/cart', method='post', accept-charset='utf-8')
input(type='hidden', name='name', value='Cool Example')
input(type='hidden', name='price', value='10')
input(type='hidden', name='code', value='sku123')
label.label_left Size
select(name='size')
option(value='small') Small
option(value='medium') Medium
option(value='large') Large
input.submit(type='submit', value='Add a Cool Example')
doctype html
layout-checkout.pug layout-checkout.pug
html(lang="en")
head
//include ../scripts/meta/HeadTags.pug
block title
link(rel='stylesheet', href='/dist/css/whre.css')/
include ../scripts/meta/GAnalytics.pug
body
block content
script(src='/dist/js/bundle.min.js')
script(data-cfasync='false', src='https://cdn.foxycart.com/playground/loader.js', async='', defer='')
include ../scripts/Hotjar.pug
block extraScripts
checkout.js checkout.js
var express = require('express');
var router = express.Router();
/* GET users listing. */
router.get('/', function(req, res, next) {
res.render('pages/main/Checkout');
});
module.exports = router;
This error message happens when you send card details directly in the API server-side, instead of tokenizing. 当您直接在API服务器端发送卡详细信息而不是令牌化时,会出现此错误消息。 This usually has some PCI compliance implications so Stripe blocks it by default. 这通常具有一些PCI合规性含义,因此Stripe默认情况下将其阻止。
Usually, you need to change your integration to properly tokenize client-side with Elements or Checkout . 通常,您需要更改集成以使用Elements或Checkout正确标记客户端。
In your case though you don't control the code or integration since you are using a third-party platform called FoxyCart. 在您的情况下,由于您使用的是称为FoxyCart的第三方平台,因此您无法控制代码或集成。 They are the ones who should either start tokenizing client-side, or use Stripe Connect to make API requests on your behalf instead. 他们应该要么开始令牌化客户端,要么使用Stripe Connect代替您发出API请求。
I would recommend talking to them (FoxyCart) about this issue so that they can upgrade their integration. 我建议与他们(FoxyCart)讨论此问题,以便他们可以升级其集成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.