使用Stripe API完成付款后如何更新订单?

时间:2020-07-09 17:35:52

标签: stripe-payments

使用Stripe API完成付款后如何更新订单?还是会自动更新订单状态?

const orderRes = await stripe.orders.create({
    currency: 'sgd',
    email: data.email,
    items: [
      {type: 'sku', parent: 'sku_HcGEjGO64SyROm'},
      {type: 'sku', parent: 'sku_HcI5uItX9vTpeF'},
    ],
    shipping: {
      name: 'Jenny Rosen',
      address: {
        line1: '1234 Main Street',
        city: 'San Francisco',
        state: 'CA',
        country: 'US',
        postal_code: '94111',
      },
    },
  }
);

const paymentIntent = await stripe.paymentIntents.create({
  amount: orderRes.amount,
  currency: 'sgd',
  payment_method_types: ['card'],
  receipt_email: data.email
});

0 个答案:

没有答案