Changeset 2688907
- Timestamp:
- 03/04/2022 01:51:59 PM (4 years ago)
- Location:
- bykea-cash-online-payments
- Files:
-
- 12 added
- 4 edited
-
tags/2.8 (added)
-
tags/2.8/LICENSE (added)
-
tags/2.8/README.md (added)
-
tags/2.8/admin_scripts.js (added)
-
tags/2.8/admin_style.css (added)
-
tags/2.8/app-store-icon.png (added)
-
tags/2.8/bykea-cash-logo.png (added)
-
tags/2.8/bykea-full-payment-option.png (added)
-
tags/2.8/google-play-icon.png (added)
-
tags/2.8/online-payments-bykeacash.php (added)
-
tags/2.8/readme.txt (added)
-
tags/2.8/woocommerce-bykeacash.php (added)
-
trunk/README.md (modified) (2 diffs)
-
trunk/online-payments-bykeacash.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/woocommerce-bykeacash.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bykea-cash-online-payments/trunk/README.md
r2688232 r2688907 5 5 Requires at least: 4.0 6 6 Tested up to: 5.9 7 Stable tag: 2. 77 Stable tag: 2.8 8 8 Requires PHP: 7.4 9 9 License: GPLv3 … … 118 118 == Changelog == 119 119 120 = 2. 7=121 * Added functionality to choose payment options in the API120 = 2.8 = 121 * Added IPN functionality for Cash Pickup option 122 122 123 123 == Upgrade Notice == -
bykea-cash-online-payments/trunk/online-payments-bykeacash.php
r2688232 r2688907 5 5 * Plugin URI: https://wordpress.org/plugins/bykea-cash-online-payments 6 6 * Description: This plugin helps WooCommerce (WordPress) customers pay via Debit / Credit Cards or Cash Pickups using Bykea Cash payment service. 7 * Version: 2. 77 * Version: 2.8 8 8 * Requires at least: 5.2 9 9 * Requires PHP: 7.4 … … 265 265 die(); 266 266 } 267 268 // IPN functionality for Cash Pickup 269 function opbc_manage_IPN_Data( $request ) { 270 $ipnData = $request->get_json_params(); 271 if($ipnData['payment_method'] == 'cash_pickup'){ 272 if ( ! class_exists( 'WC_Payment_Gateway' ) ) return; 273 include_once( 'woocommerce-bykeacash.php' ); 274 $bcashApi = new OnlinePayments_BykeaCash(); 275 $orderId = $ipnData['details']['order']; 276 $invoice = $ipnData['invoice_number']; 277 $order = wc_get_order( $orderId ); 278 $orderData = $order->get_data(); 279 $adminEmail = $bcashApi->email; 280 $customerEmail = $orderData['billing']['email']; 281 if($ipnData['payment_status'] == 'completed'){ 282 $order->update_status( 'processing' ); 283 $orderNote = __("Payment against invoice no: <a href='https://invoice.bykea.cash/receive/invoice/".$invoice."' target='_blank'>".$invoice."</a> has been confirmed."); 284 $order->add_order_note( $orderNote ); 285 // Payment confirmation to admin 286 $to = $adminEmail; 287 $subject = 'Payment Notification from Bykea Cash'; 288 $headers = array('Content-Type: text/html; charset=UTF-8','From: '.get_bloginfo( 'name' ).' <wordpress@'.$_SERVER['HTTP_HOST'].'>'); 289 $message = '<html><body>'; 290 $message .= '<p>Dear Admin, we have received your payment against Order ID: '.$orderId.'. It will get transferred into your bank account shortly. Bykea Cash Invoice ID for this payment is "'.$invoice.'".</p>'; 291 $message .= '</body></html>'; 292 wp_mail($to,$subject,$message,$headers); 293 // Payment confirmation to customer 294 $to = $customerEmail; 295 $subject = 'Payment Confirmation Notification'; 296 $headers = array('Content-Type: text/html; charset=UTF-8','From: '.get_bloginfo( 'name' ).' <wordpress@'.$_SERVER['HTTP_HOST'].'>'); 297 $message = '<html><body>'; 298 $message .= '<p>Dear Customer, your payment against Order ID: '.$orderId.' on '.home_url().' has been confirmed. You will receive update about your order shortly.</p>'; 299 $message .= '</body></html>'; 300 wp_mail($to,$subject,$message,$headers); 301 }else{ 302 $order->update_status( 'failed' ); 303 $orderNote = __("Payment against invoice no: <a href='https://invoice.bykea.cash/receive/invoice/".$invoice."' target='_blank'>".$invoice."</a> has been declined."); 304 $order->add_order_note( $orderNote ); 305 // Payment cancellation notification to admin 306 $to = $adminEmail; 307 $subject = 'Payment Notification from Bykea Cash'; 308 $headers = array('Content-Type: text/html; charset=UTF-8','From: '.get_bloginfo( 'name' ).' <wordpress@'.$_SERVER['HTTP_HOST'].'>'); 309 $message = '<html><body>'; 310 $message .= '<p>Dear Admin, payment made against Order ID: '.$orderId.'. has been declined. For more details please contact Bykea Cash Support. Bykea Cash Invoice ID for this payment is "'.$invoice.'".</p>'; 311 $message .= '</body></html>'; 312 wp_mail($to,$subject,$message,$headers); 313 // Payment cancellation notification to customer 314 $to = $customerEmail; 315 $subject = 'Payment Decline Notification'; 316 $headers = array('Content-Type: text/html; charset=UTF-8','From: '.get_bloginfo( 'name' ).' <wordpress@'.$_SERVER['HTTP_HOST'].'>'); 317 $message = '<html><body>'; 318 $message .= '<p>Dear Customer, your payment against Order ID: '.$orderId.' on '.home_url().' has been voided. For more details, please contact website administrator.</p>'; 319 $message .= '</body></html>'; 320 wp_mail($to,$subject,$message,$headers); 321 } 322 } 323 } 324 add_action( 'rest_api_init', function () { 325 register_rest_route( 'bcashapi/v1', '/ipn', array( 326 'methods' => 'POST', 327 'callback' => 'opbc_manage_IPN_Data', 328 ) ); 329 }); -
bykea-cash-online-payments/trunk/readme.txt
r2688232 r2688907 5 5 Requires at least: 4.0 6 6 Tested up to: 5.9 7 Stable tag: 2. 77 Stable tag: 2.8 8 8 Requires PHP: 7.4 9 9 License: GPLv3 … … 118 118 == Changelog == 119 119 120 = 2. 7=121 * Added functionality to choose payment options in the API120 = 2.8 = 121 * Added IPN functionality for Cash Pickup option 122 122 123 123 == Upgrade Notice == -
bykea-cash-online-payments/trunk/woocommerce-bykeacash.php
r2688232 r2688907 160 160 'title' => __( 'Payment Options', 'online-payments-bykeacash' ), 161 161 'desc_tip' => __( 'Select the payment option that you want to show to your customers', 'online-payments-bykeacash' ), 162 'type' => 'select', 163 'default' => 'card_payments', 164 'options' => array( 162 'type' => 'select', 163 'class' => $showClass." plugin-details-fields", 164 'default' => 'card_payments', 165 'options' => array( 165 166 'card_payments' => 'Show Visa/Mastercard Payment Option', 166 167 'cash_pickup' => 'Show Cash Pickup Payment Option',
Note: See TracChangeset
for help on using the changeset viewer.