zimminy Posted June 18, 2015 Share Posted June 18, 2015 Hi Guys, Can someone please help me. I have following PHP code that works fine. I get Stripe token, I get all good results, and see that Stripe transaction appears in my test account. This scenario should work if: Shelly buys widget from Paul and pays Paul directly. I made this code to to make sure I get good results from simplest type of transaction, and I do, it works fine. \Stripe\Stripe::setApiKey(STRIPE_PRIVATE_KEY); $charge = \Stripe\Charge::create(array( "amount" => $amount, // amount in cents "currency" => "usd", "source" => $token, "description" => $email ) ); But when I try to add these two parameters, so that: Shelly uses Jill's site to buy widget, Jill gets 1.50 as a fee, Paul gets 18.50 for widget. I'm Jill, and this is my code to try and send Paul his money and get my 1.50. I don't want managed account scenario, I want direct connect so that Paul deals with refunds, etc. Private key below is Jill's (my) private key and the destination below is Paul's Stripe ID \Stripe\Stripe::setApiKey(STRIPE_PRIVATE_KEY); \Stripe\Charge::create(array( 'amount' => $amount, 'currency' => 'usd', 'source' => $token, 'application_fee' => $jillfee, 'destination' => 'rp_16ElxDFGdfgFGd7jL7Vj4QU' )); I do have a try/catch in place and when I use this catch area, I get result 5 } catch (\Stripe\Error\Card $e) { // Card was declined. $e_json = $e->getJsonBody(); $err = $e_json['error']; $errors['stripe'] = $err['message']; echo '1 card declined'; } catch (\Stripe\Error\ApiConnection $e) { echo '2 Network problem, perhaps try again.'; } catch (\Stripe\Error\InvalidRequest $e) { echo '3 You screwed up in your programming.'; } catch (\Stripe\Error\Api $e) { echo '4 Stripe servers are down!'; } catch (\Stripe\Error\Base $e) { echo '5 Something else that is not customer fault.'; } any help very much appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/296894-stripe-payment-works-until-i-try-destination/ Share on other sites More sharing options...
Solution zimminy Posted June 18, 2015 Author Solution Share Posted June 18, 2015 I got help via their support already. I used IRC on web https://webchat.freenode.net/ #Stripe... Support there says I am using a recipient ID for "Paul" and need to connect to Paul via their oAuth scripts, then use THAT connection id. They do not know why I am getting error code line 5. Quote Link to comment https://forums.phpfreaks.com/topic/296894-stripe-payment-works-until-i-try-destination/#findComment-1514257 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.