Common Workflows & Use Cases

This guide walks you through typical business processes and integration scenarios with Devdraft. Follow these step-by-step workflows to set up your payment operations efficiently.

Setting Up Your First Store

Complete setup from account creation to receiving your first payment:

Initial Account Setup

1

Create Account

Visit console.devdraft.ai and sign up for a new account.
Verify your email address to activate your account.
2

Complete Onboarding

Follow the guided setup process:
  • Enter your business information
  • Upload your organization logo
  • Set your default currency
  • Configure contact details
3

Verify Your Business

Complete business verification:
  • Provide business registration documents
  • Verify your identity
  • Add business address and contact information
  • Complete any required compliance checks

Product Store Configuration

1

Create Your First Product

Navigate to Product StoreProductsAdd Product.
  • Enter product name and description
  • Set pricing and currency
  • Upload product images
  • Configure inventory (if applicable)
2

Set Up Payment Methods

Configure accepted payment methods:
  • Credit and debit cards
  • Digital wallets (PayPal, Apple Pay, Google Pay)
  • Bank transfers (if available)
  • Local payment methods for your region
3

Configure Checkout Experience

Customize your checkout flow:
  • Add your branding and logo
  • Set up custom checkout pages
  • Configure email receipts
  • Set up order confirmation messages

Testing Your Setup

1

Switch to Test Mode

Ensure you’re in test mode to avoid real charges.
Test mode allows you to simulate payments without processing real money.
2

Create Test Payment

Use test payment methods to simulate a purchase:
  • Use test card numbers provided by Devdraft
  • Complete the checkout process
  • Verify payment confirmation
  • Check transaction appears in your dashboard
3

Verify Webhook Delivery

If you’ve set up webhooks, verify they’re working:
  • Check webhook delivery status
  • Verify event payloads
  • Test error handling scenarios
Step-by-step store setup process with screenshots

Complete store setup workflow showing product creation and payment testing

Creating and Testing Webhooks

Set up real-time notifications for your application:

Webhook Setup Process

1

Prepare Your Endpoint

Create a webhook endpoint in your application:
// Example Express.js webhook endpoint
app.post('/webhooks/devdraft', (req, res) => {
  const signature = req.headers['devdraft-signature'];
  const payload = req.body;
  
  // Verify webhook signature
  if (!verifySignature(payload, signature, process.env.WEBHOOK_SECRET)) {
    return res.status(400).send('Invalid signature');
  }
  
  const event = JSON.parse(payload);
  handleWebhookEvent(event);
  
  res.status(200).send('OK');
});
2

Configure Webhook in Console

In the Devdraft Console:
  • Go to SettingsWebhooks
  • Click Add Webhook
  • Enter your endpoint URL
  • Select events to listen for
  • Generate a signing secret
3

Test Webhook Delivery

Use the test webhook feature:
  • Click Send Test Webhook in the console
  • Check your application logs
  • Verify event processing
  • Test error scenarios

Webhook Testing Scenarios

Testing Checklist

  • ✅ Webhook endpoint is accessible via HTTPS
  • ✅ Signature verification is working correctly
  • ✅ All event types are handled properly
  • ✅ Error handling is implemented
  • ✅ Idempotency is maintained
  • ✅ Response time is under 10 seconds
  • ✅ Logging is configured for debugging
1

Test Payment Events

Simulate payment scenarios:
  • Successful payment completion
  • Failed payment attempts
  • Payment refunds
  • Dispute creation
2

Test Error Handling

Verify error scenarios:
  • Invalid webhook signatures
  • Duplicate event processing
  • Network timeouts
  • Malformed payloads
3

Monitor Production

Once live, monitor webhook performance:
  • Delivery success rates
  • Response times
  • Error frequencies
  • Event processing accuracy

Viewing and Debugging Failed Transactions

Troubleshoot payment issues effectively:

Transaction Investigation Workflow

1

Locate the Transaction

Find the failed transaction:
  • Go to Transactions in the console
  • Use search to find by transaction ID
  • Filter by failed status
  • Check recent activity
2

Review Transaction Details

Examine the transaction information:
  • Customer details and contact information
  • Payment method used
  • Error messages and codes
  • Processing timeline
  • Related events and logs
3

Check Processing Logs

Review detailed processing information:
  • Payment processor responses
  • Gateway error codes
  • Network timeout information
  • Authentication failures
  • Fraud detection results

Common Failure Scenarios

Customer Communication

Customer Support Best Practices

  • Be Transparent: Explain what went wrong clearly
  • Provide Solutions: Offer alternative payment methods
  • Follow Up: Check if the customer needs additional help
  • Document Issues: Keep records for future reference
  • Escalate When Needed: Know when to involve technical support

Managing Subscription Billing

Set up and manage recurring payments:

Subscription Setup

1

Create Subscription Product

Set up a subscription in your product store:
  • Choose subscription pricing model
  • Set billing frequency (monthly, yearly, etc.)
  • Configure trial periods if applicable
  • Set up usage limits or tiers
2

Configure Billing Rules

Set up subscription billing behavior:
  • Retry failed payments
  • Grace period for late payments
  • Automatic cancellation rules
  • Proration for plan changes
3

Test Subscription Flow

Verify subscription processing:
  • Test subscription creation
  • Verify recurring billing
  • Test plan upgrades/downgrades
  • Verify cancellation process

Subscription Management

1

Monitor Active Subscriptions

Track subscription health:
  • View active subscriptions
  • Monitor renewal rates
  • Track churn metrics
  • Identify at-risk customers
2

Handle Failed Renewals

Manage failed subscription payments:
  • Review failure reasons
  • Contact customers for updated payment info
  • Process manual payments if needed
  • Update subscription status
3

Process Subscription Changes

Handle customer requests:
  • Plan upgrades and downgrades
  • Billing frequency changes
  • Payment method updates
  • Subscription cancellations

Handling Refunds and Disputes

Manage customer refunds and payment disputes:

Refund Processing

1

Review Refund Request

Assess the refund request:
  • Check original transaction details
  • Verify refund eligibility
  • Review customer communication
  • Check refund policy compliance
2

Process the Refund

Execute the refund:
  • Choose refund amount (full or partial)
  • Select refund reason
  • Process through Devdraft console
  • Confirm refund completion
3

Follow Up with Customer

Complete the refund process:
  • Send refund confirmation
  • Provide refund timeline
  • Answer any questions
  • Document the interaction

Dispute Management

Payment disputes can impact your account standing and processing fees.
1

Receive Dispute Notification

Respond to dispute alerts:
  • Check dispute details immediately
  • Review transaction information
  • Gather supporting documentation
  • Understand dispute reason
2

Prepare Response

Compile dispute response:
  • Collect transaction evidence
  • Gather customer communication
  • Prepare delivery confirmations
  • Document service fulfillment
3

Submit Response

Respond within timeframe:
  • Upload supporting documents
  • Provide detailed explanation
  • Submit before deadline
  • Monitor dispute status

API Integration Workflow

Integrate Devdraft into your application:

Development Setup

1

Get API Keys

Generate your API credentials:
  • Go to SettingsAPI Keys
  • Create test API keys first
  • Generate live keys when ready
  • Store keys securely
2

Install SDK

Add Devdraft SDK to your project:
# Node.js
npm install devdraft

# Python
pip install devdraft

# PHP
composer require devdraft/devdraft
3

Initialize Client

Set up API client:
const devdraft = require('devdraft');

const client = new devdraft({
  publicKey: process.env.DEVDRAFT_PUBLIC_KEY,
  secretKey: process.env.DEVDRAFT_SECRET_KEY,
  environment: 'production'
});

Integration Testing

1

Test Payment Creation

Verify payment processing:
const payment = await client.payments.create({
  amount: 2000, // $20.00
  currency: 'usd',
  description: 'Test payment',
  customer_email: 'customer@example.com'
});
2

Test Webhook Handling

Verify webhook processing:
  • Set up webhook endpoint
  • Send test webhooks
  • Verify event handling
  • Test error scenarios
3

Test Error Handling

Ensure robust error handling:
  • Test invalid API keys
  • Test network failures
  • Test rate limiting
  • Test validation errors

Best Practices

Workflow Best Practices

  • Test Thoroughly: Always test in development environment first
  • Document Processes: Keep detailed records of workflows
  • Monitor Performance: Track success rates and response times
  • Plan for Errors: Implement proper error handling and recovery
  • Train Your Team: Ensure all team members understand workflows
  • Regular Reviews: Periodically review and optimize processes
  • Security First: Always prioritize security in all workflows
  • Customer Focus: Design workflows with customer experience in mind

Troubleshooting Common Issues

Next Steps

Explore these related topics to enhance your workflows: