# Payment Gateway Error

**URL:** <https://discuss.dwolla.com/t/payment-gateway-error/6001>\
**Category:** Funding Sources\
**Created:** [July 22, 2020, 6:39am UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001 "2020-07-22T06:39:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 22, 2020, 6:39am UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/1 "2020-07-22T06:39:05Z")

</div>

Hello All,

While Trying to initiate payment gateway, it is giving error of bad syntax

Attached are the screenshot of code and error which is coming

 ![image_2020_07_20T06_28_36_054Z](https://global.discourse-cdn.com/dwolla/original/2X/4/4eaa28a6623cfeb2ce39e3a42c3162cf160faa2d.png)

---

<div class="post-metadata">

**Author:** ![spencer](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/spencer/32/2143_2.png) [@spencer](https://discuss.dwolla.com/u/spencer)\
**Post date:** [July 22, 2020, 4:23pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/2 "2020-07-22T16:23:04Z")

</div>

Hi @Sourabh_Kasliwal, do you have a screenshot of the error that is getting returned back from this API request? Looks like the screenshot provided just shows your code.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 22, 2020, 4:46pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/3 "2020-07-22T16:46:00Z")

</div>

![image_2020_07_20T06_28_16_974Z](https://global.discourse-cdn.com/dwolla/original/2X/8/8eedf7eb52f68479757fcb0dd16c48005c1737d6.png)

Please check  
Thanks

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 22, 2020, 5:23pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/4 "2020-07-22T17:23:24Z")

</div>

Hi @Sourabh_Kasliwal – it looks to be the extra " `/funding-sources` " in the source and destination URLs that’s causing the error.

Here’s an example of what a funding-source resource URL looks like -  
`https://api.dwolla.com/funding-sources/{funding-source-id}`

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 23, 2020, 1:07pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/5 "2020-07-23T13:07:27Z")

</div>

Hi,  
How can I take payment from users in real time without creating customers account, I dont want there account to be created, I just need the transactions on my products that users can purchase using credit or debit cards.

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 23, 2020, 2:05pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/6 "2020-07-23T14:05:56Z")

</div>

Hi @Sourabh_Kasliwal – I’m afraid creating transfers requires your users to have a Customer account created in Dwolla. Perhaps you could create a lightweight [Unverified Customer type](https://developers.dwolla.com/concepts/customer-types) which only requires their firstName, lastName and email address along with them agreeing to your platform’s as well as Dwolla’s ToS and PP.

Also, we currently only support creating transfers from a Bank account, and not Credit/Debit cards.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 27, 2020, 5:55am UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/7 "2020-07-27T05:55:34Z")

</div>

I want to charge customers for payment how do I do that?  
As documentation is not clearly showing how to do that.

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 27, 2020, 1:43pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/8 "2020-07-27T13:43:18Z")

</div>

Hi @Sourabh_Kasliwal – You can do so by using the [facilitator-fee](https://developers.dwolla.com/concepts/facilitator-fee) object in a transfer request.

Let me know if you have any questions!

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 27, 2020, 3:02pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/9 "2020-07-27T15:02:00Z")

</div>

Okay  
Can you please share php documents  
So that I can some idea.

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 27, 2020, 4:32pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/10 "2020-07-27T16:32:40Z")

</div>

Sure! You can toggle the language selector in the above documentation to view the code request examples in PHP. Here’s also an example request in PHP for creating a transfer with facilitator-fee -

```auto
<?php

$transfersApi = new DwollaSwagger\TransfersApi($apiClient);

$transfer = $transfersApi->create([
  '_links' => [
    'source' => [
      'href' => 'https://api-sandbox.dwolla.com/funding-sources/707177c3-bf15-4e7e-b37c-55c3898d9bf4',
    ],
    'destination' => [
      'href' => 'https://api-sandbox.dwolla.com/funding-sources/a2152a8a-b1a6-4b5e-9354-79e2bb8753ee'
    ]
  ],
  'amount' => [
    'currency' => 'USD',
    'value' => '98.00'
  ],
  'fees' => [
     [
        '_links' => [
           'charge-to' => [
              'href' => 'https://api-sandbox.dwolla.com/customers/479ce4c8-385f-4cfa-9693-262c0c3b6408'
           ]
        ],
        'amount' => [
           'value' => '2.00',
           'currency' => 'USD'
        ]
     ]
  ]
 ]);

print_r($transfer); # => "https://api-sandbox.dwolla.com/transfers/74c9129b-d14a-e511-80da-0aa34a9b2388"

?>

```

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 28, 2020, 11:05am UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/11 "2020-07-28T11:05:14Z")

</div>

when create customer funding source

Code which I use  
function createcustomerfundingphp(){  
Configuration::$access\_token = ‘3ixqH9146o2tnUKfgpCEXuWGWjq5IbfesvwyFFPXWjC8qdloJp’;  
$apiClient = new ApiClient($this-\>paymentmod\_url);  
$fundingApi = new FundingsourcesApi($apiClient);

$new\_fs = $fundingApi-\>createCustomerFundingSource([  
“routingNumber” =\> “222222989”,  
“accountNumber” =\> “123456779”,  
“bankAccountType” =\> “savings”,  
“name” =\> “ashish1nuance - Savings 6788”  
], “[https://api-sandbox.dwolla.com/customers/d1f7ac27-920e-4dac-90af-e7425c57a512](https://api-sandbox.dwolla.com/customers/d1f7ac27-920e-4dac-90af-e7425c57a512)”  
);  
print\_r($new\_fs);  
}

But it gives error of connecting to the API, is that something to do with routing number.

 ![image_paymentcode.png](https://global.discourse-cdn.com/dwolla/original/2X/f/f9044cab9bd3849577189fdc5628659075b8b981.png)

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 28, 2020, 2:16pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/12 "2020-07-28T14:16:55Z")

</div>

Yeah, it’s likely the routing number. You can try any US routing number that passes our checksum, or you can also use this number for Sandbox - `222222226`.

Going forward, you can also extract the actual API error message which provides more information on what’s causing the API to throw the error.

> [@ApiException in ApiClient.php line 315: \[400\] Error connecting to the API (https://api-sandbox.dwolla.com/customers)](https://discuss.dwolla.com/t/apiexception-in-apiclient-php-line-315-400-error-connecting-to-the-api-https-api-sandbox-dwolla-com-customers/5182/5):
>
> Hi @shreyas.p, You should be able to catch the error and get the JSON response-body. You can try wrapping the request in a try/catch and display the error response by calling the getResponseBody() method. Example: try{ $new\_customer = $customersApi-\>create([//request\_body]); } catch (Exception $e) { echo 'Caught exception: ', $e-\>getResponseBody(), "\n"; }

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 28, 2020, 2:52pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/13 "2020-07-28T14:52:49Z")

</div>

Is there any list for checksum?

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 28, 2020, 3:11pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/14 "2020-07-28T15:11:02Z")

</div>

Yes. You can find it listed in our API Docs - [API Reference | Dwolla API Documentation](https://docs.dwolla.com/#create-a-funding-source-for-a-customer)

> A bank routing number that identifies a bank or credit union in the U.S. **Note:** Validation of the routing number includes: a checksum, the first two digits of the routing number must fall within the range “01” through “12”, or “21” through “32”, and the string value must consist of nine digits.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 29, 2020, 9:54am UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/15 "2020-07-29T09:54:05Z")

</div>

Once a customer is created, how can he pay for the product,  
as I am not seeing any option for that, could you please explain on this.

Thanks

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 29, 2020, 1:48pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/16 "2020-07-29T13:48:36Z")

</div>

Hi Sourabh, that depends on how you’d like to charge your Customers.

You can either charge them outside of Dwolla, or even utilize the Dwolla’ API to create ACH transactions to debit their attached bank accounts.

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [July 30, 2020, 6:02am UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/17 "2020-07-30T06:02:44Z")

</div>

How to create ACH transactions, and once that is done, how that will be possible  
How can I know if they are getting request on there bank account.

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [July 30, 2020, 1:39pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/18 "2020-07-30T13:39:22Z")

</div>

You can check out our docs on how to create transfers here - [https://docs.dwolla.com/#initiate-a-transfer](https://docs.dwolla.com/#initiate-a-transfer)

The only way to know that the banks are getting ACH requests is to reach out to the bank. Dwolla doesn’t have a way to know if the funds has left a bank, and have settled into a bank. To learn more about specific funds flows, and how you can utilize Dwolla for your user-case, these funds-flow specific guides might be helpful to check out - [https://developers.dwolla.com/guides](https://developers.dwolla.com/guides)

---

<div class="post-metadata">

**Author:** ![Sourabh\_Kasliwal](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/sourabh_kasliwal/32/2564_2.png) [@Sourabh\_Kasliwal](https://discuss.dwolla.com/u/Sourabh_Kasliwal)\
**Post date:** [August 6, 2020, 2:58pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/19 "2020-08-06T14:58:27Z")

</div>

Needed details for instant verification in sandbox mode,  
Please share

---

<div class="post-metadata">

**Author:** ![shreya](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/shreya/32/2154_2.png) [@shreya](https://discuss.dwolla.com/u/shreya)\
**Post date:** [August 6, 2020, 3:00pm UTC](https://discuss.dwolla.com/t/payment-gateway-error/6001/20 "2020-08-06T15:00:50Z")

</div>

Hi @Sourabh_Kasliwal – were you looking to test IAV in Sandbox? If so, here are some helpful guides -

- [https://developers.dwolla.com/guides/sandbox#testing-funding-sources](https://developers.dwolla.com/guides/sandbox#testing-funding-sources)
- [https://developers.dwolla.com/guides/dwolla-js/instant-account-verification](https://developers.dwolla.com/guides/dwolla-js/instant-account-verification)

[Next page](https://discuss.dwolla.com/t/payment-gateway-error/6001.md?page=2)
