Common php IDE file structure usage

  • A simple stripe API payment example. 
  • Upon visiting the page, (1) create a customer, (2) create a paymentintent with the customer.
  • The content of the code field will be included in index.php
  • Two PHP files will reside in the page dir
  • app.ini will reside out of doc root dir
  • index_inc.php will include shared.php
  • shared.php uses app.ini, which is in the other record
  • shared.php will use stripe library
doc_base /home/cmsnow/www/hosts/design.asonehosting.com/docs/
/home/cmsnow/www/hosts/design.asonehosting.com/docs/..//default/en-US/nav6h3/E/Dev/s/Stripe/Payment/php/app.ini
array(7) {
  ["DOMAIN"]=>
  string(21) "http://localhost:4242"
  ["PAYMENT_METHOD_TYPES"]=>
  string(4) "card"
  ["PRICE"]=>
  string(15) "price_abc123..."
  ["STATIC_DIR"]=>
  string(9) "../client"
  ["STRIPE_PUBLISHABLE_KEY"]=>
  string(32) "pk_test_5cQYArKzzFMqm4LZbptu9EPe"
  ["STRIPE_SECRET_KEY"]=>
  string(107) "rk_test_515ztjhK6p085J4TOzcIs9anO7ynwFXEPG8z6QqwMiC6UJk3hgcEsk2VVlIgZLcDXU6IP2hDZumFsElgpzU8J1ic400YYMdXUZd"
  ["STRIPE_WEBHOOK_SECRET"]=>
  string(70) "whsec_619acc2ccce06fb6cb07be1b6ac72a907257dddb19fa90be64b7cc84e3218216"
}
object(Stripe\PaymentIntent)#31 (41) { ["id"]=> string(27) "pi_3Q8HrAK6p085J4TO1Dmk9rtY" ["object"]=> string(14) "payment_intent" ["amount"]=> int(1999) ["amount_capturable"]=> int(0) ["amount_details"]=> object(Stripe\StripeObject)#36 (1) { ["tip"]=> array(0) { } } ["amount_received"]=> int(0) ["application"]=> NULL ["application_fee_amount"]=> NULL ["automatic_payment_methods"]=> object(Stripe\StripeObject)#37 (2) { ["allow_redirects"]=> string(6) "always" ["enabled"]=> bool(true) } ["canceled_at"]=> NULL ["cancellation_reason"]=> NULL ["capture_method"]=> string(9) "automatic" ["charges"]=> object(Stripe\Collection)#41 (5) { ["object"]=> string(4) "list" ["data"]=> array(0) { } ["has_more"]=> bool(false) ["total_count"]=> int(0) ["url"]=> string(54) "/v1/charges?payment_intent=pi_3Q8HrAK6p085J4TO1Dmk9rtY" } ["client_secret"]=> string(60) "pi_3Q8HrAK6p085J4TO1Dmk9rtY_secret_2tQoLQSt7xdg4E2ItTdM1P2Xh" ["confirmation_method"]=> string(9) "automatic" ["created"]=> int(1728549384) ["currency"]=> string(3) "usd" ["customer"]=> string(18) "cus_R0ISA0Y1SO0E9H" ["description"]=> NULL ["invoice"]=> NULL ["last_payment_error"]=> NULL ["latest_charge"]=> NULL ["livemode"]=> bool(false) ["metadata"]=> object(Stripe\StripeObject)#45 (0) { } ["next_action"]=> NULL ["on_behalf_of"]=> NULL ["payment_method"]=> NULL ["payment_method_configuration_details"]=> object(Stripe\StripeObject)#49 (2) { ["id"]=> string(28) "pmc_1KakYAK6p085J4TOW7MDeOxK" ["parent"]=> NULL } ["payment_method_options"]=> object(Stripe\StripeObject)#53 (1) { ["card"]=> object(Stripe\StripeObject)#61 (4) { ["installments"]=> NULL ["mandate_options"]=> NULL ["network"]=> NULL ["request_three_d_secure"]=> string(9) "automatic" } } ["payment_method_types"]=> array(1) { [0]=> string(4) "card" } ["processing"]=> NULL ["receipt_email"]=> string(22) "jennyrosen@example.com" ["review"]=> NULL ["setup_future_usage"]=> NULL ["shipping"]=> NULL ["source"]=> NULL ["statement_descriptor"]=> NULL ["statement_descriptor_suffix"]=> NULL ["status"]=> string(23) "requires_payment_method" ["transfer_data"]=> NULL ["transfer_group"]=> NULL }