Our Latest Blog Posts

latest-post

In our previous blog, we had seen how to integrate stripe connect. Now we are going to see how we can split payments to the application and vendor using stripe checkout.

Let's take a simple example :

The platform is "Shopify", Merchant (Who is selling products on Shopify) & Customer who is going to register with Shopify.

Now When a customer purchases a product with $1000, Now $10 will be considered as an application fee, which is going to transfer to the Platform Account and the rest amount $90 will be transferred to Merchant.

Create Session using Stripe Checkout

public function generationSession($data)
{
    $session = \Stripe\Checkout\Session::create([
        'payment_method_types' => ['card'],
        'customer_email'       => $data['email'],
        'line_items'           => [
            [
                'name'     => "item name here",
                'amount'   => floatval($data['amount']) * 100,
                'currency' => 'usd',
                'quantity' => '1',
            ],
        ],
        'client_reference_id'  => $data['reference_id'],
        'success_url'          => url('payment-success').'?session_id={CHECKOUT_SESSION_ID}',
        'cancel_url'           => url('failed-payment?error=payment_cancelled'),
        'payment_intent_data'  => [
            'application_fee_amount' => $data['application_fees'] * 100,
            'transfer_data'          => [
                'destination' => $data['user']->stripe_connect_id,
            ],
        ],
    ]);

    return $session;
}

It will return the session object return, later you can use the session id to redirect to stripe checkout.

Redirect to checkout using StripeJS

        fetch('/generate-sesssion', {
            method: 'POST',
        })
        .then(function(session) {
            return stripe.redirectToCheckout({ sessionId: session.id });
        });

Check the transaction from your Stripe Dashboard

Once you do the transaction successfully, you can verify whether the application fee is applied or not from your stripe dashboard.

Hope this tutorial helps you.

July 13, 20231 minuteuserVishal Ribdiya

Posts

Integrate CCAvenue Payment Gateway with Laravel

This is the hardest thing as a developer I found, as there is no official documentation available to integrate the CCAvenue. Also, you will not find any tutorial or blog from which you can do the implementation.

So, in this tutorial, we are going to cover how we can integrate the CCAvenue payment gateway with Laravel.

web.php

Route::post('purchase', [CCAvenueController::class, purchaseSubscription']);

CCAvenueController.php

public function purchaseSubscription(Request $request)
{
    $input = $request->all();

    $input['amount'] = $data['grandTotal'];
    $input['order_id'] = "123XSDDD456";
    $input['currency'] = "INR";
    $input['redirect_url'] = route('cc-response');
    $input['cancel_url'] = route('cc-response');
    $input['language'] = "EN";
    $input['merchant_id'] = "your-merchant-id";

    $merchant_data = "";

    $working_key = config('cc-avenue.working_key'); //Shared by CCAVENUES
    $access_code = config('cc-avenue.access_code'); //Shared by CCAVENUES

    $input['merchant_param1'] = "some-custom-inputs"; // optional parameter
    $input['merchant_param2'] = "some-custom-inputs"; // optional parameter
    $input['merchant_param3'] = "some-custom-inputs"; // optional parameter
    $input['merchant_param4'] = "some-custom-inputs"; // optional parameter
    $input['merchant_param5'] = "some-custom-inputs"; // optional parameter
    foreach ($input as $key => $value) {
        $merchant_data .= $key . '=' . $value . '&';
    }

    $encrypted_data = $this->encryptCC($merchant_data, $working_key);
    $url = config('cc-avenue.url') . '/transaction/transaction.do?command=initiateTransaction&encRequest=' . $encrypted_data . '&access_code=' . $access_code;

    return redirect($url);
}

Manage Callback

public function ccResponse(Request $request)
{
    try {
        $workingKey = config('cc-avenue.working_key'); //Working Key should be provided here.
        $encResponse = $_POST["encResp"];

        $rcvdString = $this->decryptCC($encResponse, $workingKey);        //Crypto Decryption used as per the specified working key.
        $order_status = "";
        $decryptValues = explode('&', $rcvdString);
        $dataSize = sizeof($decryptValues);
}

Other Encryption functions

public function encryptCC($plainText, $key)
{
    $key = $this->hextobin(md5($key));
    $initVector = pack("C*", 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
    $openMode = openssl_encrypt($plainText, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $initVector);
    $encryptedText = bin2hex($openMode);
    return $encryptedText;
}

public function decryptCC($encryptedText, $key)
{
    $key = $this->hextobin(md5($key));
    $initVector = pack("C*", 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f);
    $encryptedText = $this->hextobin($encryptedText);
    $decryptedText = openssl_decrypt($encryptedText, 'AES-128-CBC', $key, OPENSSL_RAW_DATA, $initVector);
    return $decryptedText;
}

public function pkcs5_padCC($plainText, $blockSize)
{
    $pad = $blockSize - (strlen($plainText) % $blockSize);
    return $plainText . str_repeat(chr($pad), $pad);
}

public function hextobin($hexString)
{
    $length = strlen($hexString);
    $binString = "";
    $count = 0;
    while ($count < $length) {
        $subString = substr($hexString, $count, 2);
        $packedString = pack("H*", $subString);
        if ($count == 0) {
            $binString = $packedString;
        } else {
            $binString .= $packedString;
        }

        $count += 2;
    }
    return $binString;
}

That's it.

So that is how you can integrate the CCAvenue Payment Gateway with Laravel.

September 05, 20232 minutesauthorVishal Ribdiya
Regression Testing Techniques & Tools

Regression Testing Techniques:

Retest All:

Retest All In this technique, the entire test suite is executed again to verify that no existing functionality has been affected by recent code changes. It's a comprehensive but time-consuming approach.

Selective Regression Testing:

Selective Regression Testing This technique involves selecting a subset of test cases from the existing test suite that is most likely to be affected by the code changes. It's a more efficient approach compared to retesting all test cases.

Test Case Prioritization:

Test Case Prioritization Test cases are prioritized based on factors like their likelihood of failure, criticality, and importance to the application. High-priority test cases are executed first to quickly identify issues.

Test Automation:

Test Automation tools are used to create and execute test scripts that can be easily rerun whenever there are code changes. Popular automation tools include Selenium, Appium, and JUnit for Java applications.

Regression Testing Tools

Regression Testing Tools:

Selenium:

Selenium is one of the most popular open-source automation testing tools for web applications. It supports multiple programming languages and browsers and allows testers to create robust regression test suites.

Appium:

Appium is an open-source tool for automating mobile applications on Android and iOS platforms. It can be used for regression testing of mobile apps.

JUnit:

JUnit is a widely-used testing framework for Java applications. It's especially useful for unit and regression testing in the Java ecosystem.

TestNG:

TestNG is another Java-based testing framework that offers more advanced testing features compared to JUnit, making it suitable for regression testing.

Jenkins:

Jenkins is a popular open-source automation server that can be used to automate the execution of regression test suites. It integrates with various testing tools and can schedule test runs based on code changes.

Postman:

Postman is a popular tool for testing RESTful APIs. It can be used for API regression testing to ensure that changes in the API do not break existing functionality.

TestRail:

TestRail is a test management tool that helps teams organize and manage their regression test cases, track test results, and collaborate on testing efforts.

JIRA:

JIRA, developed by Atlassian, is an issue and project tracking tool that can be used for managing and tracking regression test cases and defects.

Travis CI:

Travis CI is a continuous integration tool that can be used to automate the execution of regression tests whenever code changes are pushed to a version control system like GitHub.

CircleCI:

CircleCI is another continuous integration and continuous delivery (CI/CD) platform that supports automated regression testing as part of the software development pipeline.

The choice of regression testing technique and tool depends on the specific requirements of your project, the nature of the application, and the resources available. It's essential to select the most appropriate combination to ensure effective regression testing and maintain the quality of your software.

September 11, 20232 minutesauthorVirendra Harkhani
Android UI Design: Tips and Best Practices

A visually appealing and user-friendly user interface (UI) is key to creating successful Android apps. Mastering Android UI design requires a combination of creativity, usability principles, and knowledge of best practices. In this blog post, we will delve into valuable tips and best practices to help you create exceptional UI designs for your Android apps, ensuring an engaging and intuitive user experience.

Understand Material Design Guidelines:

Google's Material Design guidelines serve as a foundation for creating visually consistent and intuitive UIs across Android devices. Familiarize yourself with these guidelines, which cover aspects such as layout, typography, color schemes, and iconography. By adhering to Material Design principles, you can create UIs that feel native to the Android platform while offering a modern and visually pleasing experience.

Prioritize Consistency:

Consistency plays a vital role in UI design. Maintain a consistent visual style, including color schemes, typography, and spacing, throughout your app. Consistent UI elements and interactions create a sense of familiarity, enabling users to navigate your app with ease. Ensure that your app's UI aligns with the overall branding and design language to establish a cohesive experience.

Keep it Simple and Minimalistic:

Simplicity is key to effective UI design. Strive for a clean and uncluttered interface that focuses on essential elements. Avoid overwhelming users with excessive information or complex layouts. Use whitespace strategically to enhance readability and highlight important elements. Embrace minimalistic design principles, such as flat or material design, to create a visually pleasing and intuitive UI.

Optimize for Different Screen Sizes:

Android devices come in various screen sizes and resolutions, so it's crucial to ensure your UI design adapts seamlessly to different form factors. Design responsive layouts that can adjust to different screen sizes, orientations, and aspect ratios. Utilize relative sizing and scalable elements to accommodate various screen densities. Test your app on different devices to ensure a consistent and user-friendly experience across the board.

Use Intuitive Navigation Patterns:

Efficient navigation is key to a user-friendly app. Utilize intuitive navigation patterns such as bottom navigation bars, hamburger menus, and tabs to provide easy access to different sections of your app. Follow established navigation patterns that users are already familiar with, but also consider the specific needs and context of your app to provide a tailored and intuitive navigation experience.

Pay Attention to Typography:

Typography plays a crucial role in UI design, affecting readability and overall aesthetic appeal. Choose legible fonts that align with your app's branding and style. Ensure appropriate font sizes for different text elements, considering factors such as readability on various screen sizes and accessibility for users with visual impairments. Use typography to guide users and emphasize important information within your app.

Utilize Meaningful and Consistent Icons:

Icons are powerful visual elements that aid in navigation and convey meaning. Use icons consistently throughout your app, adhering to recognized iconography standards. Ensure that icons are visually clear, easily recognizable, and aligned with their intended actions or functionalities. Combine icons with text labels when necessary to provide clarity and improve usability.

Employ Color Strategically:

Color choices can evoke emotions and influence user perception. Select a color palette that aligns with your app's branding and purpose. Use colors purposefully to differentiate elements, convey hierarchy, and provide visual cues. Ensure color contrast for text and important elements to maintain accessibility for all users. Leverage color to create a visually engaging and cohesive UI design.

Test and Iterate:

Regular testing and iteration are crucial in UI design. Gather feedback from users, conduct usability tests, and analyze user behavior to identify areas for improvement. Iterate your design based on user feedback and insights, refining the UI to enhance usability, address pain points, and optimize the overall user experience. Embrace an iterative design process to continuously improve your app's UI.

Stay Updated and Inspired:

UI design trends evolve over time, so it's essential to stay updated with the latest design trends, techniques, and emerging patterns. Explore design inspiration from other successful Android apps, industry resources, and design communities. Keep an eye on Google's updates to Material Design and Android design patterns to ensure your UI remains relevant and appealing.

Conclusion:

Mastering Android UI design involves a combination of creativity, adherence to best practices, and a deep understanding of user needs. By following these tips and best practices, such as understanding Material Design guidelines, prioritizing consistency, keeping the UI simple and minimalistic, optimizing for different screen sizes, using intuitive navigation patterns, paying attention to typography and color, testing and iterating, and staying updated with design trends, you can create compelling and user-friendly UIs that enhance the overall user experience of your Android apps. Strive for excellence in UI design, and your apps will stand out in the crowded Android marketplace.

July 17, 20234 minutesauthorVivek Beladiya
Creating a Winning Sales Culture: Strategies to Motivate and Inspire Your Team

Creating a winning sales culture is essential to achieving success and achieving outstanding results. A motivated and motivated sales team can make a significant difference in meeting and exceeding goals. In this blog post, we'll explore effective strategies for creating a winning sales culture that fosters motivation, inspires your team members, and ultimately leads to exceptional sales performance.

Lead by example:

As a sales leader, it's important to set the tone for your team by leading by example. Show strong work ethic, enthusiasm, and positive attitude. Demonstrate your passion for sales and dedication to achieving goals. When your team sees your commitment and drive, it inspires them to follow suit.

Clearly define goals and expectations:

To motivate and inspire your sales team, they need a clear understanding of what is expected of them. Set Specific, Measurable, Attainable, Relevant, and Time-bound (SMART) goals.

Provide ongoing training and development:

Invest in ongoing training and development opportunities for your sales team. Equip them with the skills and knowledge they need to excel in their roles. Organize regular sales training sessions, workshops, and seminars to enhance their sales techniques, product knowledge, and customer engagement skills.

Promote a positive and supportive environment:

Create a positive and supportive work environment where team members feel valued, respected, and encouraged. Celebrate individual and team achievements, big or small, to boost morale. Encourage open communication, actively listen to your team's ideas and concerns, and provide constructive feedback.

Implement recognition and reward programs:

Recognition and rewards play an important role in motivating sales professionals. Implement a structured recognition program that acknowledges outstanding performance and achievement. Publicly celebrate individual and team successes, both within the sales team and across the organization, to create a sense of accomplishment and motivate others.

Provide regular feedback and coaching:

Regular feedback and coaching are critical in the growth and development of sales professionals. Provide coaching and mentoring opportunities to help team members develop their skills and reach their full potential. Regularly review performance metrics and offer actionable insights to improve efficiency.

July 17, 20232 minutesauthorAnkit Kalathiya
Exploring AI-Based Tools in Adobe Photoshop

Adobe Photoshop has long been the go-to software for graphic designers, offering powerful tools and endless creative possibilities. Photoshop has taken a huge step ahead with the use of artificial intelligence (AI) technology, allowing designers to improve their productivity, automate repetitive operations, and generate amazing outcomes more effectively than ever before. In this blog post, we will explore the AI-based tools in Adobe Photoshop that are revolutionizing the field of graphic design.

Generative Fill:

Generative Fill is an AI-powered tool in Adobe Photoshop that uses machine learning techniques to automatically create complicated and visually appealing patterns and textures. Generative Fill creates new designs using rich details, organic shapes, and appealing styles by analysing existing visual elements or utilising a set of established characteristics. This technology allows designers to quickly explore and experiment with an array of artistic possibilities without the need for manual design or complex work flows.

Open the image you want to manipulate in Photoshop beta. Use any selection tool to choose the specific area you want to apply the Generative Fill to. Click on the "Generative Fill" button located in the small toolbar that appears. In the prompt box, type your desired instructions for the tool or leave it blank. Once satisfied, click "Generate" to initiate the Generative Fill process. Wait for a few seconds to a few minutes, depending on the complexity of the prompt, as Generative Fill completes your request. The AI will provide you with three variations to choose from. Select the option you like best to apply it. The changes will be applied to a separate layer, preserving your original image on the base layer.

Content-Aware Fill:

One of the standout AI-powered features in Photoshop is Content-Aware Fill. This tool analyzes the content surrounding a selected area and automatically fills it in a way that seamlessly blends with the surrounding elements. Whether removing unwanted objects or extending backgrounds, Content-Aware Fill saves designers valuable time and effort by intelligently generating realistic replacements.

Select an object in your photo, go to Edit, and choose Content-Aware Fill. You’ll be able to refine your selection further and see a preview of how the fill is going to work. You can specify areas of the image Photoshop should use to fill in the background once it removes the object.

Neural Filters:

Neural Filters is a set of AI-powered filters in Photoshop that leverages machine learning algorithms to apply complex transformations to images. These filters enable designers to achieve artistic effects, retouch portraits, adjust facial expressions, and enhance details with just a few clicks. From the Style Transfer filter to the Smart Portrait filter, Neural Filters offer a wide range of creative options to elevate your designs.

To use them, go to Filter in the main navigation bar and then click on Neural Filters. You’ll be able to choose from a wide range of actions, such as adding depth to your images and smoothing the skin on people’s faces. Each filter comes with its own set of options, so you can tweak them to make them more or less aggressive, depending on what you want your final photo to look like.

Sky Replacement:

The Sky Replacement feature in Photoshop utilizes AI algorithms to automatically detect and replace the sky in an image while preserving other elements like foreground objects and lighting conditions. Designers can choose from a library of preloaded skies or add their own, transforming the mood and atmosphere of a scene in an instant. This tool simplifies the process of creating captivating visuals with dramatic sky effects.

Open an image, go to Edit, and then Sky Replacement to make alterations. You can drop in one of the program’s pre-sets or load your own, as well as tweak the sky’s temperature and brightness, and make adjustments to the foreground to help it match the lighting.

Select Subject and Object Selection:

Selecting intricate subjects or objects within an image can be a time-consuming task. Adobe Photoshop's AI-based Select Subject and Object Selection tools come to the rescue. These tools utilize advanced machine learning algorithms to intelligently identify and isolate subjects or objects, allowing designers to make precise selections quickly. This feature greatly enhances the efficiency of various design workflows, such as compositing and retouching.

Just go to Select and choose Subject to let Photoshop get to work. Even if it doesn’t pick out the subject exactly, it should give you a good starting point.

June 30, 20234 minutesauthorNency Dobariya
5 Proven Strategies to Boost Your Sales Revenue

Boosting sales revenue is a top priority for businesses seeking growth and success. In this blog post, we will explore five proven strategies that can significantly enhance your sales performance and help you achieve remarkable revenue results. Whether you're a sales manager, a business owner, or a sales professional, implementing these strategies can provide a competitive edge and drive your sales revenue to new heights.

Set Clear Sales Goals

Establishing clear and measurable sales goals is the foundation for success. Define specific targets for your team to strive towards, ensuring they are challenging yet achievable. This clarity will align everyone's efforts and provide a roadmap for success.

Focus on Targeted Prospecting

Identify your ideal customer profile and concentrate your efforts on reaching out to prospects who match that profile. This targeted approach will save time and resources while increasing the likelihood of converting leads into paying customers.

Develop Effective Sales Messaging

Clearly communicate the unique value proposition of your products or services, highlighting the benefits and solving pain points for potential customers.

Nurture Existing Customer Relationships

Don't overlook the importance of existing customers. Implement strategies to nurture and upsell to your current client base, such as personalized follow-ups, exclusive offers, and loyalty programs. Satisfied customers can become your most powerful brand advocates.

Embrace Continuous Improvement

Encourage a culture of continuous improvement within your sales team. Regularly review and analyze your sales processes, identify areas for optimization, and implement necessary changes. Embracing a growth mindset will help you stay ahead of the competition.

By implementing these five proven strategies, you can empower your sales team, drive revenue growth, and achieve outstanding sales results. Remember, consistency and perseverance are key. Stay committed to these strategies, adapt as needed, and watch your sales revenue soar to new heights.

June 17, 20231 minuteauthorAnkit Kalathiya
How to integrate Stripe Connect in Laravel / PHP ?

Stripe Connect is the fastest way to integrate payment into your marketplace.

In this tutorial we are going to integrate the stripe connect with Laravel.

To integrate the stripe connect you must need the stripe secret and the stripe key. You can get that credentials from your Stripe account.

So let's start integrating...

Installation

composer require srmklive/paypal:~2.0

Onboard the seller using Stripe connect

Define the route for onboarding the seller.

  Route::get('onboard-seller', [StripeController::class, 'onboard']);

Now on StripeController.php write the code for the onboarding link.

use Stripe\Stripe;
use Stripe\Account;
use App\Models\User;
use Stripe\AccountLink;

public function onBoard()
{
    $user = Auth::user();

    /** @var User $user */
    if (empty($user->stripe_on_boarding_completed_at)) {
        Stripe::setApiKey(stripeKey());

        if (empty($user->stripe_connect_id)) {
            /** @var Account $account */
            $account = Account::create([
                'type'         => 'express',
                'email'        => $user->email,
                'country'      => 'US',
                'capabilities' => [
                    'card_payments' => ['requested' => true],
                    'transfers'     => ['requested' => true],
                ],
                'settings'     => [
                    'payouts' => [
                        'schedule' => [
                            'interval' => 'manual',
                        ],
                    ],
                ],
            ]);

            $user->stripe_connect_id = $account->id;
            $user->save();
        }

        $user->fresh();

        $onBoardLink = AccountLink::create([
            'account'     => $user->stripe_connect_id,
            'refresh_url' => route('organization.dashboard'),
            'return_url'  => route('stripe.onboard-result', Crypt::encrypt($user->stripe_connect_id)),
            'type'        => 'account_onboarding',
        ]);

        return redirect($onBoardLink->url);
    }


    $loginLink = $this->stripeClient->accounts->createLoginLink($user->stripe_connect_id, []);

    return redirect($loginLink->url);
}

Please note that you have to generate routes for return and cancel URLs.

Once a merchant is successfully onboarded stripe will again redirect him to the return_url

Below you can find the code in which we managed the success callback.

public function onBoardResult($encodedToken)
{
    /** @var User $user */
    $user = User::whereStripeConnectId(Crypt::decrypt($encodedToken))->firstOrFail();

    $user->stripe_on_boarding_completed_at = Carbon::now();
    $user->save();

    return redirect(route('dashboard'));
}
July 13, 20231 minuteauthorVishal Ribdiya
Regression Testing Vs Retesting

In this article, We will see the difference between regression testing vs retesting.

The concepts of regression testing and retesting are generally confused within the field of test automation. They sound similar and they have correlations too.

The main difference is that regression testing is designed to test or verify for bugs you don’t expect to be there. Retesting is designed to test or verify for bugs you do expect to be there.

What is Regression Testing?

Regression testing is a type of software testing executed to check whether a code change has not critically disturbed the current functions & features of an application/software, what does it mean that the point of regression testing is to make sure that new updates or features added/release to software don’t break any previously released updates or features or functions.

What is Retesting?

Retesting is done to ensure that the bug is fixed and even if failed functionality is working fine or not, this is a kind of verification process followed in the testing field for the fixed bugs. Most of the testers having confused with Regression and Retesting.

Boost Customer Satisfaction, Find out Hidden Bugs In Your Software

Generally, testers find bugs while testing the software application or website and assign them to the developers to fix them. Then the developers fix the bug and assign it back to the testers/QA for verification. This continuous process is called Retesting.

Difference between Regression Testing and Retesting.

We could say that regression testing is a type of retesting. Retesting really means testing something again. And when we are regression testing, we are testing something that we have tested numerous times before.

But determining what the two have in common or similar might confuse more than it will help. So, for the well-being of clarity, below is an overview of the key differences.

Regression Testing Vs Retesting

Regression Testing Retesting
Regression Testing is carried out to establish whether a recent program or code change has not negatively affected existing features. Re-testing is carried out to establish the test cases that failed in the final execution are passing after the defects are fixed.
The purpose of Regression Testing is that new code fixes should not have any side effects on existing functionalities. Re-testing is performed on the basis of the defect fixes.
Regression Testing can be carried out parallel with Re-testing, based on the project and availability of resources. Retesting is carried out before regression testing because the priority of re-testing is higher than regression testing.
Defect verification is not part of regression testing. Defect verification is part of re-testing.
Regression testing is known as genetic testing. Re-testing is planned to test.
Regression testing is executed for passed test cases. Retesting is executed for failed test cases only.
Regression testing checks for unexpected side effects. Re-testing ensures that the original fault has been corrected.
Regression testing is only done when there are any modifications or fixes become mandatory in an existing project. Re-testing executes a defect with the same data in the same environment with different inputs with a new build.
We can do automation for regression testing; Manual testing could be time-consuming and expensive. We can’t automate the test cases for retesting.
Test cases for regression testing can be captured from the functional specification, user manuals and tutorials, and defect reports in regard to corrected problems. Test cases for retesting cannot be captured before starting testing.

Conclusion:

In case you are still confused, it may be easier to think of retesting as checking to see whether the bug actually fixed and regression testing as whether you created any new bugs with your fix. While you may identify regression issues during a retest, they are in fact separate and should be treated as distinct forms of testing.

June 01, 20233 minutesauthorVirendra Harkhani