Alternative Payment Methods

Process alternative payment methods through the Host-to-Host API without requiring card details. This includes bank transfers, ACH payments, digital wallets, and buy-now-pay-later options.

Overview

Alternative payment methods provide:
  • No Card Required: Process payments without credit/debit card details
  • Simplified Flow: Reduced customer data requirements
  • Regional Support: Local payment methods for different markets
  • Lower Fees: Often lower processing fees than card payments
  • Bank Integration: Direct bank account payments

Required Parameters

Customer Information

ParameterDescriptionRequiredExample
nameCustomer full nameYES”Jane Smith”
emailCustomer email addressYESjane@example.com
phoneNumberCustomer phone numberYES”+1234567890”
addressCustomer addressYES”456 Oak Avenue”
cityCustomer cityYES”Los Angeles”
stateState or provinceYES”CA”
postalCodeZIP or postal codeYES”90210”
countryCountry code (ISO 3166-1)YES”US”

Transaction Details

ParameterDescriptionRequiredExample
amountPayment amountYES150.00
unitCurrency codeYES”USD”
originDomainMerchant domainYES”store.example.com”
referenceIdMerchant referenceNO”INV-67890”

Complete Request Example

{
  "name": "Jane Smith",
  "email": "jane@example.com",
  "phoneNumber": "+1234567890",
  "address": "456 Oak Avenue",
  "city": "Los Angeles",
  "state": "CA",
  "postalCode": "90210",
  "country": "US",
  "amount": 150.00,
  "unit": "USD",
  "originDomain": "store.example.com",
  "referenceId": "INV-67890",
  "notifyUrl": "https://api.example.com/webhook",
  "successUrl": "https://store.example.com/success",
  "failureUrl": "https://store.example.com/failure"
}

Implementation Example

async function processAlternativePayment(paymentData) {
  const apiEndpoint = process.env.YONOBI_H2H_ENDPOINT;
  const apiKey = process.env.YONOBI_API_KEY;
  
  try {
    const response = await fetch(apiEndpoint, {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json',
        'X-API-Key': apiKey
      },
      body: JSON.stringify({
        name: paymentData.customerName,
        email: paymentData.customerEmail,
        phoneNumber: paymentData.customerPhone,
        address: paymentData.customerAddress.street,
        city: paymentData.customerAddress.city,
        state: paymentData.customerAddress.state,
        postalCode: paymentData.customerAddress.postalCode,
        country: paymentData.customerAddress.country,
        amount: paymentData.amount,
        unit: paymentData.currency,
        originDomain: paymentData.merchantDomain,
        referenceId: paymentData.invoiceId,
        notifyUrl: paymentData.webhookUrl,
        successUrl: paymentData.successUrl,
        failureUrl: paymentData.failureUrl
      })
    });
    
    const result = await response.json();
    
    if (response.ok) {
      return {
        success: true,
        paymentRequestId: result.paymentRequestId,
        redirectUrl: result.redirectUrl,
        status: result.status
      };
    } else {
      return {
        success: false,
        error: result.error,
        message: result.message
      };
    }
  } catch (error) {
    return {
      success: false,
      error: 'NETWORK_ERROR',
      message: error.message
    };
  }
}

Supported Methods

Bank Transfers

  • ACH Payments: Direct bank account transfers
  • Wire Transfers: International bank transfers
  • SEPA: European bank transfers
  • Faster Payments: UK instant bank transfers

Digital Wallets

  • PayPal: PayPal account payments
  • Skrill: Skrill wallet payments
  • Neteller: Neteller wallet payments
  • Regional Wallets: Local digital wallet solutions

Buy Now, Pay Later

  • Klarna: Klarna payment plans
  • Afterpay: Afterpay installments
  • Affirm: Affirm financing
  • Sezzle: Sezzle payment plans

Error Handling

Common Error Codes

  • INVALID_BANK_ACCOUNT: Invalid bank account details
  • INSUFFICIENT_FUNDS: Insufficient funds in account
  • BANK_DECLINED: Bank declined the transaction
  • PAYMENT_METHOD_UNAVAILABLE: Selected method not available

Next Steps

UPI Payments

Learn about UPI payment integration

Payment Status

Track alternative payment status