Jump to content

angelo, italy

  • Posts

  • Joined

  • Last visited

Everything posted by angelo, italy

  1. I'd like to share how I integrated stripe in PW.. and it works!! πŸ™†β€β™‚οΈ :-D! FORM in product page: <div style='display:<?php if ($page->Mostra1 == 1) echo "block"; echo "none";?>'> <form action='<?php echo $pages->get('template=create-checkout-session')->url; ?>' method='POST' > </form> <?php $myForm1 = " <form action='{$stripe->url}' method='post'> <button type='submit' id='checkout-button' >Acquista</button> </form>"; echo $myForm1;?> </div> and this is the 'create-checkout-session' template: <?php include 'init.php'; Stripe\Stripe::setApiKey('xxxxxxxxxxxxxxxxxx'); header('Content-Type: application/json'); $YOUR_DOMAIN = 'https://www.xxxxxxxx.it/'; $checkout_session = \Stripe\Checkout\Session::create([ 'shipping_address_collection' => [ 'allowed_countries' => ['IT'], ], 'shipping_options' => [ [ 'shipping_rate_data' => [ 'type' => 'fixed_amount', 'fixed_amount' => [ 'amount' => 700, 'currency' => 'eur', ], 'display_name' => 'Standard', // Delivers between 5-7 business days 'delivery_estimate' => [ 'minimum' => [ 'unit' => 'business_day', 'value' => 5, ], 'maximum' => [ 'unit' => 'business_day', 'value' => 7, ], ] ] ], [ 'shipping_rate_data' => [ 'type' => 'fixed_amount', 'fixed_amount' => [ 'amount' => 1000, 'currency' => 'eur', ], 'display_name' => 'Celere', // Delivers in exactly 1 business day 'delivery_estimate' => [ 'minimum' => [ 'unit' => 'business_day', 'value' => 1, ], 'maximum' => [ 'unit' => 'business_day', 'value' => 3, ], ] ] ], ], 'line_items' => [[ # Provide the exact Price ID (e.g. pr_1234) of the product you want to sell #'price' => 'price_1JyahSFL4ZyLp1tjGGqakV4Z', #'price' => $price, 'name' => $session->get(prod), 'amount' => $session->get(price), 'currency' => 'eur', 'quantity' => 1, ]], 'mode' => 'payment', 'success_url' => $YOUR_DOMAIN . 'grazie/', 'cancel_url' => $YOUR_DOMAIN . 'pagamento-rifiutato/', ]); header("HTTP/1.1 303 See Other"); header("Location: " . $checkout_session->url); I used: $session->set(prod, "$page->title"); >>> 'name' => $session->get(prod), I hope this stuff can be useful for someones!
  2. My fault was to use ' <?php echo $config->urls->templates ?> πŸ˜• ... so stupid! But now I found this issue: Compile Error: Arrays are not allowed in class constants (line 104 of site/templates/stripe-php/lib/Util/ObjectTypes.php) mmmm SOLUTION: I updated PHP version to 7+
  3. I'd like to use Stripe Checkout in processwire. The client- and server-side code redirects to a prebuilt payment page hosted on Stripe. I create a form in my page: $stripe = $pages->get("/stripe/"); <!-- HEAD--> <h1><?php echo $page->title ?></h1> <?php $myForm1 = " <form action='{$stripe->url}' method='post'> <button type='submit' id='checkout-button'>Checkout</button> </form>"; echo $myForm1; ?> <!-- FOOTER --> then, I created a template/page ----- <?php include '<?php echo $config->urls->templates ?>stripe-php/init.php'; //require 'vendor/autoload.php'; use Stripe\Stripe; Stripe\Stripe::setApiKey('xxxxxxxxx'); header('Content-Type: application/json'); $YOUR_DOMAIN = 'https://www.axxxxxxsamia.it/'; $checkout_session = \Stripe\Checkout\Session::create([ 'shipping_address_collection' => [ 'allowed_countries' => ['IT'], ], 'shipping_options' => [ [ 'shipping_rate_data' => [ 'type' => 'fixed_amount', 'fixed_amount' => [ 'amount' => 700, 'currency' => 'eur', ], 'display_name' => 'Standard', // Delivers between 5-7 business days 'delivery_estimate' => [ 'minimum' => [ 'unit' => 'business_day', 'value' => 5, ], 'maximum' => [ 'unit' => 'business_day', 'value' => 7, ], ] ] ], [ 'shipping_rate_data' => [ 'type' => 'fixed_amount', 'fixed_amount' => [ 'amount' => 1000, 'currency' => 'eur', ], 'display_name' => 'Celere', // Delivers in exactly 1 business day 'delivery_estimate' => [ 'minimum' => [ 'unit' => 'business_day', 'value' => 1, ], 'maximum' => [ 'unit' => 'business_day', 'value' => 3, ], ] ] ], ], 'line_items' => [[ # Provide the exact Price ID (e.g. pr_1234) of the product you want to sell 'price' => 'pricSFL4ZyLp1tjGGqakV4Z', 'quantity' => 1, ]], 'mode' => 'payment', 'success_url' => $YOUR_DOMAIN . '/success.html', 'cancel_url' => $YOUR_DOMAIN . '/cancel.html', ]); header("HTTP/1.1 303 See Other"); header("Location: " . $checkout_session->url); --- BUT... ERROR!! Fatal Error: Class 'Stripe\Stripe\Stripe' not found (line 8 of site/templates/create-checkout-session.php) Any ideas?? ThanksThis error message was shown because: you are logged in as a Superuser. Error has been logged.
  4. I'm having same issue on Aruba servers (Italy) in the installation process, I commented out this lines: # Note that some web hosts don't support this. If you get a (500) error, try commenting out this # SetEnv line below. <IfModule mod_env.c> SetEnv HTTP_MOD_REWRITE On </IfModule> Now It works
  5. Hi @Dzung I installed the WireMailPHPMailer module and solved it. Greetings
  6. Dear friends, the failure of the module depends on the hosting (godaddy). Below is the question solved .. Sending emails through other providers in Godaddy is not allowed, so you need to use the following settings: Port: 25 SMTP authentication: False or None SSL or secure connection: None Server or Host: The relay server to use depends on the type of hosting and script you use. What type is my hosting account? Linux (cPanel) Use localhost, unless: You use a PHP script and the mail () function. You use a Perl script and the binary / usr / lib / sendmail. In these cases, you will not need to specify any relay servers.
  7. Hi I can't get wiremail to work .. Can you show me a solution Thanks so much array(1) { ["SETTINGS"] array(28) { ["default_charset"] string(5) "UTF-8" ["localhost"] string(23) "domain.com" ["smtp_host"] string(17) "smtp.xxxxxxxx.com" ["smtp_port"] int(587) ["smtp_ssl"] string(0) "" ["smtp_ssl_crypto_method"] string(0) "" ["smtp_start_tls"] int(1) ["smtp_tls_crypto_method"] string(31) "STREAM_CRYPTO_METHOD_ANY_CLIENT" ["smtp_user"] string(25) "admin@domain.com" ["smtp_password"] string(12) "RBxxxxxxxgEPlj" ["smtp_password2"] string(0) "" ["clear_smtp_password"] string(0) "" ["allow_without_authentication"] string(0) "" ["realm"] string(0) "" ["workstation"] string(0) "" ["authentication_mechanism"] string(0) "" ["smtp_debug"] int(0) ["smtp_html_debug"] int(0) ["sender_name"] string(16) "Vincenzo xxxxxxx" ["sender_email"] string(25) "admin@domain.com" ["sender_reply"] string(0) "" ["sender_errors_to"] string(0) "" ["sender_signature"] string(0) "" ["sender_signature_html"] string(0) "" ["send_sender_signature"] string(1) "1" ["extra_headers"] array(0) { } ["valid_recipients"] array(0) { } ["smtp_certificate"] string(0) "" } } array(1) { ["RESULT"] array(5) { ["subject"] string(14) "Debug Testmail" ["addSignature"] string(1) "0" ["textbody"] string(39) "This is a test message" ["recipients"] array(1) { [0] array(3) { ["emailaddress"] string(24) "angelo.xxxxxxxx@email.com" ["name"] string(0) "" ["type"] string(2) "to" } } ["send"] string(0) "" } } array(1) { ["ERRORS"] array(1) { [0] string(69) "could not connect to the host "smtp.xxxxxxx.com": Connection refused" } } array(1) { ["DEBUGLOG"] string(144) " Resolving SMTP server domain "smtp.xxxxx.com"... Connecting to SMTP server "smtp.xxxxxx.com" port 587... " }
  8. Hi, I'm not so good in PHP ... In a website I want to sort result using foreach, this is the code: $profi = $pages->get("/professionisti/")->children('limit=4, sort=date'); My question is: if I want to change the order, from the latest to the oldest or from the oldest .. what I have to write? Thanks a lot
  9. I unistalled Front-End Page Editor and now my website is working well πŸ™‚
  10. I understood my issue and follow instructions in the forum. Now it works. Thanks
  11. I tried to find a post about my issue but I did't find it. Can you help me? thanks Issue is: Note: your current server locale setting isn’t working as expected with the UTF-8 charset and may cause minor issues. Your current locale setting is β€œC”. Please translate the β€œC” locale setting for each language to the compatible locale in /wire/modules/LanguageSupport/LanguageSupport.module: β€’ Italiano β€’ English For example, the locale setting for US English might be: en_US.UTF-8
  12. hi, I'm tryng to insert slider into my template without success... ... <div class="col-12"> <div class="animated bounceInDown" style="animation-duration: 3.5s;"><img class="img-responsive" src="<?php echo $slider->render($page->get('slider')); ?>" /></div> ... can you help me??
  13. Hi! I did it, my code is <img class="img-responsive" src="<?php echo $page->headimage->url?>" /> but imags don't appear! If I analyze code in the front using google console I saw this code <img class="img-responsive" src="/processwire-master/site/assets/files/1/"> .. it seems to stop in the folder without getting image's url.. πŸ˜•
  14. Hi guys... I love pw! I'm trying to update a template of the multilanguagge website. I created a field, i called it "headimage" and I added it to the home template. .. . But I can t see any image!!! Where is the issue?? Thanks my friends
  15. How long? I'm confident in front-end but no php...... πŸ˜•
  16. thank my friends.I am very fascinated by PW .. a lot! I am confident on front end but little back-end and PHP. Can you show me useful resources to learn PW while I build this site? Thanks again
  17. Hi guys, I've always used WP but I want to swtich to PW. I'm not sure .... I'd like to know if it's possible to create a website for an online photo contest. The participants of the competition could create their own account, in which they upload their photos. The photos uploaded remain visible only to themselves and the judges. From their account they can make the "entrance fee" payment. The judges of the competition can create their own account... entering they see the photos of the participants and vote photos At the main page I imagine the title of the competition, a button to read the regulation, and a button to register. The website should be in Italian and English. Thank you!!
  • Create New...