我使用Inchoo的扩展程序连接Magento和Stripe付款 . Inchoo组件很简单,它基于https://github.com/stripe/stripe-php . 当我将它用于测试付款时,它应该是可行的 .

但我需要条纹连接,因为'application_fee',我现在有问题 .

根据教程stripe.com/docs/connect/oauth我使用https://gist.github.com/afeng/3507366

一切仍然很好 .

根据stripe.com/docs/connect/collecting-fees:

我们有以下代码 -

// Get the credit card details submitted by the form

$token = $_POST['stripeToken'];

// Create the charge on Stripe's servers - this will charge the user's card
$charge = Stripe_Charge::create(array(
  "amount" => 1000, // amount in cents
  "currency" => "usd",
  "card" => $token,
  "description" => "payinguser@example.com"),
  "application_fee" => 123 // amount in cents
  ),
  **ACCESS_TOKEN** // user's access token from the Stripe Connect flow
);

但ACCESS_TOKEN是个问题,因为我使用的是上一步“stripe.com/docs/connect/oauth”中的那个

并得到错误:

OAuth based requests must use card tokens from Stripe.js, but card details were directly provided.

我应该使用Stripe.js的原因和位置?一切正常,直到请求'ACCESS_TOKEN'并且它说://用户来自Stripe Connect流程的访问令牌 - 我已经拥有ACCESS_TOKEN

来自(stripe.com/docs/connect/oauth){_ "token_type":"bearer","stripe_publishable_key":PUBLISHABLE_KEY,"scope":"read_write","livemode":"false","stripe_user_id":USER_ID,"refresh_token":REFRESH_TOKEN, "access_token": ACCESS_TOKEN }

问题w