# Payments v2


## Payment Methods (User)

<small class="badge badge-darkred">requires authentication</small>

Use this end point to get the payment methods of a user

> Example request:

```bash
curl -X GET \
    -G "https://apiqa.bettorfantasy.com/v2/payments/payment-methods/list" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json"
```


> Example response (200):

```json
{
    "message": "Payment Methods",
    "data": {
        "payment_methods": [
            {
                "id": 1,
                "userPaymentOptionId": "131144318",
                "method_image": "http:\/\/apiqa.bettorfantasy.com\/images\/payments\/visa-white.png",
                "method_name": "Visa Debit",
                "method_masked_number": "4****1390",
                "created_at": "2024-10-10T11:24:23.000000Z"
            }
        ]
    }
}
```
<div id="execution-results-GETv2-payments-payment-methods-list" hidden>
    <blockquote>Received response<span id="execution-response-status-GETv2-payments-payment-methods-list"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-GETv2-payments-payment-methods-list"></code></pre>
</div>
<div id="execution-error-GETv2-payments-payment-methods-list" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-GETv2-payments-payment-methods-list"></code></pre>
</div>
<form id="form-GETv2-payments-payment-methods-list" data-method="GET" data-path="v2/payments/payment-methods/list" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('GETv2-payments-payment-methods-list', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-GETv2-payments-payment-methods-list" onclick="tryItOut('GETv2-payments-payment-methods-list');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-GETv2-payments-payment-methods-list" onclick="cancelTryOut('GETv2-payments-payment-methods-list');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-GETv2-payments-payment-methods-list" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-green">GET</small>
 <b><code>v2/payments/payment-methods/list</code></b>
</p>
<p>
<label id="auth-GETv2-payments-payment-methods-list" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="GETv2-payments-payment-methods-list" data-component="header"></label>
</p>
</form>


## Payment Method Delete (User)

<small class="badge badge-darkred">requires authentication</small>

Use this end point to delete the payment method of a user

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/v2/payments/payment-methods/delete" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"id":1}'

```


> Example response (200):

```json
{
    "message": "Payment Method Deleted Successfully"
}
```
> Example response (404):

```json
{
    "message": "Payment method not found!"
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "id": [
            "The id field is required."
        ]
    }
}
```
<div id="execution-results-POSTv2-payments-payment-methods-delete" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTv2-payments-payment-methods-delete"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTv2-payments-payment-methods-delete"></code></pre>
</div>
<div id="execution-error-POSTv2-payments-payment-methods-delete" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTv2-payments-payment-methods-delete"></code></pre>
</div>
<form id="form-POSTv2-payments-payment-methods-delete" data-method="POST" data-path="v2/payments/payment-methods/delete" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTv2-payments-payment-methods-delete', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-POSTv2-payments-payment-methods-delete" onclick="tryItOut('POSTv2-payments-payment-methods-delete');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTv2-payments-payment-methods-delete" onclick="cancelTryOut('POSTv2-payments-payment-methods-delete');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTv2-payments-payment-methods-delete" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>v2/payments/payment-methods/delete</code></b>
</p>
<p>
<label id="auth-POSTv2-payments-payment-methods-delete" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="POSTv2-payments-payment-methods-delete" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>id</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="id" data-endpoint="POSTv2-payments-payment-methods-delete" data-component="body" required  hidden>
<br>
ID. Ex: 123
</p>

</form>


## Repeat Deposit

<small class="badge badge-darkred">requires authentication</small>

Use this end point to repeat the deposit

> Example request:

```bash
curl -X POST \
    "https://apiqa.bettorfantasy.com/v2/payments/repeat-deposit" \
    -H "Authorization: Bearer {YOUR_AUTH_KEY}" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{"userPaymentOptionId":5,"amount":10,"cvv":7}'

```


> Example response (200):

```json
{
    "message": "Successfull!",
    "data": {
        "status": "APPROVED",
        "amount": 20,
        "trn": "7110000000005743261",
        "redirect_url": null,
        "raw": {
            "internalRequestId": 1348562118,
            "status": "SUCCESS",
            "errCode": 0,
            "reason": "",
            "merchantId": "1075880000455231537",
            "merchantSiteId": "232258",
            "version": "1.0",
            "clientRequestId": "0cc49954-7b96-4ce0-9e98-9dfce8c73d88_2024-10-16.07:27:35",
            "sessionToken": "fd038442-57bd-48b6-b3a0-d9d4fd2a157a",
            "clientUniqueId": "206_79231f48-64a2-40af-8e59-532520021946",
            "orderId": "502329078",
            "userTokenId": "tahasethwala",
            "paymentOption": {
                "userPaymentOptionId": "131144318",
                "card": {
                    "ccCardNumber": "4****1390",
                    "bin": "476134",
                    "last4Digits": "1390",
                    "ccExpMonth": "01",
                    "ccExpYear": "29",
                    "acquirerId": "19",
                    "cvv2Reply": "",
                    "avsCode": "",
                    "cardType": "Debit",
                    "issuerBankName": "INTL HDQTRS-CENTER OWNED",
                    "issuerCountry": "SG",
                    "isPrepaid": "false",
                    "threeD": {}
                },
                "paymentAccountReference": "f4iK2pnudYKvTALGdcwEzqj9p4"
            },
            "transactionStatus": "APPROVED",
            "gwErrorCode": 0,
            "gwExtendedErrorCode": 0,
            "issuerDeclineCode": "",
            "issuerDeclineReason": "",
            "transactionType": "Sale",
            "transactionId": "7110000000005743261",
            "externalTransactionId": "",
            "authCode": "111588",
            "customData": "",
            "fraudDetails": {
                "finalDecision": "Accept"
            },
            "externalSchemeTransactionId": "",
            "merchantAdviceCode": ""
        }
    }
}
```
> Example response (422):

```json
{
    "message": "Please enter required information",
    "errors": {
        "userPaymentOptionId": [
            "The user payment option id field is required."
        ],
        "amount": [
            "The amount field is required."
        ]
    }
}
```
> Example response (400, Age Restrictions Apply):

```json

{
      "message": "Validations",
      "error_box": {
          "heading": "Age Restrictions Apply",
          "message": "You must be 21 or older to enter cash contests in Massachusetts",
          "cta": "Return",
          "color": "Blue",
          "cta_type": "Return",
      }
  }
```
> Example response (400, Deposit Limit Reached):

```json
{
    "message": "Validations",
    "error_box": {
        "heading": "Deposit Limit Reached",
        "message": "You are unable to take this action because of self exclusion restrictions placed on this account.",
        "cta": "Return",
        "color": "Blue",
        "cta_type": "Return"
    }
}
```
> Example response (500):

```json
{
    "message": "Something went wrong. Please try again later."
}
```
<div id="execution-results-POSTv2-payments-repeat-deposit" hidden>
    <blockquote>Received response<span id="execution-response-status-POSTv2-payments-repeat-deposit"></span>:</blockquote>
    <pre class="json"><code id="execution-response-content-POSTv2-payments-repeat-deposit"></code></pre>
</div>
<div id="execution-error-POSTv2-payments-repeat-deposit" hidden>
    <blockquote>Request failed with error:</blockquote>
    <pre><code id="execution-error-message-POSTv2-payments-repeat-deposit"></code></pre>
</div>
<form id="form-POSTv2-payments-repeat-deposit" data-method="POST" data-path="v2/payments/repeat-deposit" data-authed="1" data-hasfiles="0" data-headers='{"Authorization":"Bearer {YOUR_AUTH_KEY}","Content-Type":"application\/json","Accept":"application\/json"}' onsubmit="event.preventDefault(); executeTryOut('POSTv2-payments-repeat-deposit', this);">
<h3>
    Request&nbsp;&nbsp;&nbsp;
        <button type="button" style="background-color: #8fbcd4; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-tryout-POSTv2-payments-repeat-deposit" onclick="tryItOut('POSTv2-payments-repeat-deposit');">Try it out ⚡</button>
    <button type="button" style="background-color: #c97a7e; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-canceltryout-POSTv2-payments-repeat-deposit" onclick="cancelTryOut('POSTv2-payments-repeat-deposit');" hidden>Cancel</button>&nbsp;&nbsp;
    <button type="submit" style="background-color: #6ac174; padding: 5px 10px; border-radius: 5px; border-width: thin;" id="btn-executetryout-POSTv2-payments-repeat-deposit" hidden>Send Request 💥</button>
    </h3>
<p>
<small class="badge badge-black">POST</small>
 <b><code>v2/payments/repeat-deposit</code></b>
</p>
<p>
<label id="auth-POSTv2-payments-repeat-deposit" hidden>Authorization header: <b><code>Bearer </code></b><input type="text" name="Authorization" data-prefix="Bearer " data-endpoint="POSTv2-payments-repeat-deposit" data-component="header"></label>
</p>
<h4 class="fancy-heading-panel"><b>Body Parameters</b></h4>
<p>
<b><code>userPaymentOptionId</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="userPaymentOptionId" data-endpoint="POSTv2-payments-repeat-deposit" data-component="body" required  hidden>
<br>
ID. Ex: 12345678
</p>
<p>
<b><code>amount</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="amount" data-endpoint="POSTv2-payments-repeat-deposit" data-component="body" required  hidden>
<br>
Amount. Ex: 20.0
</p>
<p>
<b><code>cvv</code></b>&nbsp;&nbsp;<small>integer</small>  &nbsp;
<input type="number" name="cvv" data-endpoint="POSTv2-payments-repeat-deposit" data-component="body" required  hidden>
<br>
CVV for card ("payment_method": "cc_card"), send 123 if not ("payment_method": "cc_card") . Ex: 123
</p>

</form>



