문제

I'm in the process of building an online marketplace which sells shippable goods. The site will be similar to Etsy, which will connect merchants with buyers.

I'd like to be able to charge a customer's card ONLY when an item is shipped by a merchant to avoid chargebacks and provide an Amazon-like payment experience. This will also help us avoid chargebacks and payment disputes in case a merchant is slow to ship or flakes out. In some cases, the goods will take more than 7 days to be custom manufactured and shipped out

Here's an example timeline:

  • 1/1/2014 - Customer adds $75 worth of items to their cart and clicks "buy". Enters credit card info.
  • 1/1/2014 - Customer's card is verified and a $75 temporary hold is placed on their card. Order is sent to merchant for fulfillment.
  • 1/14/2014 - Merchant ships goods to customer and adds shipping tracking info
  • 1/14/2014 - Customer's card is charged for the full amount and merchant receives $75 minus fees.

I plan to use Stripe Connect for payment processing, but am not sure how to delay capturing a payment for more than 7 days. Any thoughts? I don't want to aggregate the funds under my own account and use payouts since this will likely run afoul of money transmission laws. Any help would be appreciated!

EDIT: It looks like Quora has a similar question here , but the answers don't seem to deal with the case where a merchant ships out the item but the payment fails.

도움이 되었습니까?

해결책

After further research, it seems there's no way to delay capturing a charge past the 7 day authorization window.

But here's one way to delay a charge:

  1. Tokenize a credit card using the stripe.js library
  2. Create a new stripe customer passing in the token as the "card" param

An example from the Stripe FAQ: https://support.stripe.com/questions/can-i-save-a-card-and-charge-it-later

Note that the longer you wait between tokenizing a card and actually charging it, the more likely your charge will be declined for various reasons (expired card, lack of funds, fraud, etc). This also adds a layer of complexity (and lost sales) since you'll need to ask a buyer to resubmit payment info.

I'd still like to confirm that a certain amount can be charged (like a "preauthorization"), but this lets me at least charge the card at a later date.

다른 팁

Celery has built a service to help you do this with Stripe. They are very easy to use, but note that they charge 2% per transaction.

actually you can save user token and pay later with tracking info

# get the credit card details submitted by the form or app
token = params[:stripeToken]

# create a Customer
customer = Stripe::Customer.create(
  card: token,
  description: 'description for payinguser@example.com',
  email: 'payinguser@example.com'
)

# charge the Customer instead of the card
Stripe::Charge.create(
    amount: 1000, # in cents
    currency: 'usd',
    customer: customer.id
)

# save the customer ID in your database so you can use it later
save_stripe_customer_id(user, customer.id)

# later
customer_id = get_stripe_customer_id(user)

Stripe::Charge.create(
    amount: 1500, # $15.00 this time
    currency: 'usd',
    customer: customer_id
)

Stripe release a delay method to place a hold without charging. https://stripe.com/docs/payments/capture-later

<?php

require_once('stripe-php/init.php');
\Stripe\Stripe::setApiKey('your stripe key'); 
$token  = $_POST['stripeToken'];

$stripeinfo = \Stripe\Token::retrieve($token);
 
     $email = $stripeinfo->email;
   
   
   $customer = \Stripe\Customer::create(array(
    "source" => $token,
    "email" => $email)
);

?>

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top