Direct Debit

You can integrate your e-commerce application directly to our platform-agnostic Direct Debit API and process purchases and credits through a variety of bank schemes.

Click the links below to view our code samples.

Verify That the Service Is Accessible

is_online = client.direct_debit_service.monitor

Direct Debit Purchases

Process a Purchase

Process an ACH purchase
purchase = Paysafe::DirectDebit::Purchase.new({
      merchantRefNum: merchantRefNum1,
      amount: 10098,
      ach: {
      accountHolderName: "XYZ Company",
      accountType: "CHECKING",
      accountNumber: "587158188",
      routingNumber: "211589828",
      payMethod: "WEB"
      },
      customerIp: "192.0.126.111",
      profile: {
      firstName: "Joe",
      lastName: "Smith",
      email: "Joe.Smith@hotmail.com"
      },
      billingDetails: {
      street: "100 Queen Street West",
      city: "Los Angeles",
      state: "CA",
      country: "US",
      zip: "90210",
      phone: "3102649010"
      }
    })
response = get_ach_client.direct_debit_service.submit_purchase_request purchase
Process an ACH purchase using a payment token
purchase = Paysafe::DirectDebit::Purchase.new(
    {
      merchantRefNum: merchantRefNum,
      amount: 10098,
      ach: {
      paymentToken: ach_paymentToken,
      payMethod: "WEB"
      }
    })
response = get_ach_client.direct_debit_service.submit_purchase_request purchase
Process an EFT purchase
purchase = Paysafe::DirectDebit::Purchase.new({
      merchantRefNum: merchantRefNum,
      amount: 10098,
      eft: {
      accountHolderName: "XYZ Company",
      accountNumber: "98877219",
      transitNumber: "22446",
      institutionId: "001"
      },
      customerIp: "192.0.126.111",
      profile: {
      firstName: "Joe",
      lastName: "Smith",
      email: "Joe.Smith@hotmail.com"
      },
      billingDetails: {
      street: "100 Queen Street West",
      city: "Ottawa",
      state: "ON",
      country: "CA",
      zip: "M1M1M1",
      phone: "6139991100"
      }
    })
response = get_eft_client.direct_debit_service.submit_purchase_request purchase
Process an EFT purchase using a payment token
purchase = Paysafe::DirectDebit::Purchase.new(
    {
      merchantRefNum: merchantRefNum,
      amount: 10098,
      eft: {
      paymentToken: eft_paymentToken
      }
    })
response = get_eft_client.direct_debit_service.submit_purchase_request purchase
Process a BACS purchase using a payment token
purchase = Paysafe::DirectDebit::Purchase.new(
    {
      merchantRefNum: merchantRefNum,
      amount: 10098,
      bacs: {
      paymentToken: bacs_paymentToken
      }
    })
response = get_bacs_client.direct_debit_service.submit_purchase_request purchase
Process a SEPA purchase using a payment token
purchase = Paysafe::DirectDebit::Purchase.new(
    {
      merchantRefNum: merchantRefNum,
      amount: 10098,
      sepa: {
      paymentToken: sepa_paymentToken
      }
    })
response = get_sepa_client.direct_debit_service.submit_purchase_request purchase

Cancel a Purchase

Cancel a purchase
purchase_obj = Paysafe::DirectDebit::Purchase.new({
      id: ach_purchase_id,
      status: "CANCELLED"
    })
response = get_client.direct_debit_service.cancel_purchase purchase_obj

Look Up a Purchase

Look up a purchase using an ID
purchase_obj = Paysafe::DirectDebit::Purchase.new({
      id: purchase_id
    })
response = get_client.direct_debit_service.get_purchase_with_purchase_id purchase_obj
Look up a purchase using a merchant reference number
purchase_obj = Paysafe::DirectDebit::Purchase.new({
      merchantRefNum: merchantRefNum1
    })
response = get_client.direct_debit_service.get_purchase_with_merchant_reference_number purchase_obj

Direct Debit Standalone Credits

Process a Standalone Credit

Process an ACH standalone credit
standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      merchantRefNum: merchantRefNum,
      amount: 10098,
      ach: {
      accountHolderName: "XYZ Company",
      accountType: "CHECKING",
      accountNumber: "988772192",
      routingNumber: "211589828",
      payMethod: "PPD"
      },
      customerIp: "192.0.126.111",
      profile: {
      firstName: "Joe",
      lastName: "Smith",
      email: "Joe.Smith@hotmail.com"
      },
      billingDetails: {
      street: "100 Queen Street West",
      city: "Los Angeles",
      state: "CA",
      country: "US",
      zip: "90210",
      phone: "3102649010"
      }
    })
response = get_ach_client.direct_debit_service.submit_standalone_credit standalone_credit_obj
Process an ACH standalone credit using a payment token
standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      merchantRefNum: merchantRefNum,
      amount: 10098,
      ach: {
      paymentToken: ach_paymentToken,
      payMethod: "PPD"
      },
      customerIp: "192.0.126.111"
    })
response = get_ach_client.direct_debit_service.submit_standalone_credit standalone_credit_obj
Process an EFT standalone credit
standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      merchantRefNum: merchantRefNum,
      amount: 10098,
      eft: {
      accountHolderName: "XYZ Company",
      accountNumber: "988772192",
      transitNumber: "22446",
      institutionId: "001"
      },
      customerIp: "192.0.126.111",
      profile: {
      firstName: "Joe",
      lastName: "Smith",
      email: "Joe.Smith@hotmail.com"
      },
      billingDetails: {
      street: "100 Queen Street West",
      city: "Ottawa",
      state: "ON",
      country: "CA",
      zip: "90210",
      phone: "6139991100"
      }
    })
response = get_eft_client.direct_debit_service.submit_standalone_credit standalone_credit_obj
Process an EFT standalone credit using a payment token
merchantRefNum = SecureRandom.uuid
    standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      merchantRefNum: merchantRefNum,
      amount: 10098,
      eft: {
      paymentToken: eft_paymentToken
      }
    })
response = get_eft_client.direct_debit_service.submit_standalone_credit standalone_credit_obj
Process a BACS standalone credit using a payment token
merchantRefNum = SecureRandom.uuid
    standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      merchantRefNum: merchantRefNum,
      amount: 10098,
      bacs: {
      paymentToken: bacs_paymentToken
      }
    })
response = get_bacs_client.direct_debit_service.submit_standalone_credit standalone_credit_obj

Cancel a Standalone Credit

Cancel a standalone credit
standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      id: standalone_credit_id,
      status: "CANCELLED"
    })
response = get_client.direct_debit_service.cancel_standalone_credit standalone_credit_obj

Look Up a Standalone Credit

Look up a standalone credit using an ID
standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      id: standalone_credit_id
    })
response = get_client.direct_debit_service.get_standalone_credit_using_id standalone_credit_obj
Look up a standalone credit using a merchant reference number
standalone_credit_obj = Paysafe::DirectDebit::StandaloneCredits.new({
      merchantRefNum: merchantRefNum
    })
response = get_client.direct_debit_service.get_standalone_credit_using_merchant_reference_number standalone_credit_obj
Did you find this page useful?