Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function calculateOrderAmount() {
- // Replace this constant with a calculation of the order's amount
- // Calculate the order total on the server to prevent
- // people from directly manipulating the amount on the client
- return 100;
- }
- $
- /*$customer = \Stripe\Customer::create(array(
- "name" => 'Palash Sarkar',
- "description" => 'FosterBiz Services Item 001',
- "email" => 'ranbirit.palash@gmail.com',
- "phone" => '9998404540',
- "address" => ["city" => 'Ahmedabad', "country" => 'IN', "line1" => '89 Amit park Isanpur', "line2" => 'Opp Vishalnagar', "postal_code" => '382443', "state" => 'Gujarat']
- ));*/
- $orderID = "orderId";
- $paymentMethod = \Stripe\PaymentMethod::create([
- "billing_details" => [
- "address" => [
- "city" => "Ahmedabad",
- "country" => "IN",
- "line1" => "89 Amit park Isanpur",
- "line2" => "Opp Vishalnagar",
- "postal_code" => "382443",
- "state" => "Gujarat"
- ],
- "email" => "ranbirit.palash@gmail.com",
- "name" => "Palash Sarkar",
- "phone" => "9998404540"
- ],
- 'type' => 'card',
- 'card' => [
- 'number' => '4242424242424242',
- 'exp_month' => 2,
- 'exp_year' => 2021,
- 'cvc' => '314',
- ],
- ]);
- $paymentIntent = \Stripe\PaymentIntent::create([
- 'amount' => calculateOrderAmount(),
- 'currency' => "eur",
- 'customer' => "cus_GlQo0OBAUtF0o5",
- 'description' => "FosterBiz Online Services",
- 'payment_method' => $paymentMethod->id,
- 'metadata' => array(
- 'order_id' => $orderID
- )
- ]);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement