Cash Withdrawal

Cash Withdrawal is used to process online withdrawals at the the cage inside of a physical casino.

The following method IDs are covered in this section:

IDNameCredit/Debit State
174CashWithdrawalWithdrawnToUser

The payment is created when the merchant sends an initiatePaymentRequest and then a voucher number is generated. The merchant should create the voucher number and pass it as the merchantTransactionID (paymentID) in the request.

The customer will come to the cage with the voucher number. The cage clerk will open Payment Service Admin (PS Admin), enter the voucher number and confirm the payout.

This will update the state of the payment to WithdrawnToUser.

Flow overview

The CashWithdrawal flow is as follows:

551
StateDescription
CreatedPayment is created by merchant.
DuplicatePaymentValidationPassedMerchantTransactionID/PaymentID is unique.
ToBeWithdrawnA payment is waiting for a withdrawal by the user.
WithdrawnToUserA payment has been withdrawn to a user at the cage.
CancelledA payment withdrawal has been cancelled
ExpiredA payment is moved to expired after a pre-defined time.
ReassignedA payment shop (location) has been changed at the cage. This requires a special flow to be enabled for the merchant at the cage.

A special flow can be enabled for the merchant at the cage to change the shop in order to reflect the location where the voucher was redeemed by the user. The payment goes directly to WithdrawnToUser, but can still be cancelled by the operator.

241

Redirect Integration

Payment Method CashWithdrawal is also available in the checkout.

There are no additional parameters required in the getRedirectData request for CashWithdrawal Payment Method.

Example of getRedirectData request, redirection to the Selection page (=directly to PXP Checkout selection page):

<getRedirectDataRequest xmlns="http://www.cqrpayments.com/PaymentProcessing"
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                        xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <merchantID>KalixaAcceptDEMO</merchantID>
    <redirectParameters xsi:type="paymentMethodSelectionWithDetailsRedirectParameters">
        <shopID>KalixaAcceptDEMO</shopID>
        <httpMethod>GET</httpMethod>
        <returnUrl>http://return</returnUrl>
        <languageCode>en</languageCode>
        <currencyCode>usd</currencyCode>
        <countryCode>us</countryCode>
        <user>
           <id>ef430f0a-a757-4eef-b1f0-9c689221b0bc</id>
        </user>
        <merchantTransactionID>Sample_Cash_Withdraw_00048</merchantTransactionID>
        <grossAmount>10.87</grossAmount>
        <minPaymentLimitAmount>10</minPaymentLimitAmount>
        <maxPaymentLimitAmount>3000</maxPaymentLimitAmount>
        <expirationTimeSpanInSeconds>3600</expirationTimeSpanInSeconds>
        <successUrl>http://success</successUrl>
        <pendingUrl>http://pending</pendingUrl>
        <errorUrl>http://error</errorUrl>
        <cancelUrl>http://cancel</cancelUrl>
        <refusedUrl>http://refused</refusedUrl>
        <paymentDirection>Withdrawal</paymentDirection>
    </redirectParameters>
</getRedirectDataRequest>

**Example getRedirectDataResponse"

<getRedirectDataResponse xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <redirectData>
        <redirectUrl>https://payments.test2.kalixa.com/Checkout/PaymentMethods/?requestData=2hiktgiwc2iuqo5yinapgxe2_984d1bc2-9d8a-44a5-9df8-d403b3905591</redirectUrl>
    </redirectData>
</getRedirectDataResponse>

Customer using Cash at Cage payment method to Withdraw funds

  • If the Selection Page is configured for the merchant then customer is redirected to the Payment Method Selection Page.
  • Customer selects Cash Withdrawal payment method available on the PXP Checkout page and should initiate the payment.
  • PXP backend will send a notification to the merchant to approve the Withdrawal transaction. It is a synchronous callback to check with the merchant if the withdrawal is allowed or not.
  • Merchant has to be respond back with the ResultCode via PaymentStateChangedNotification.
    • To reject, Merchant needs to respond with ResultCode other than 0. Customer is redirected to the error url provided in the GetRedirectDataRequest.
    • To approve, Merchant needs to respond with ResultCode=0. Customer is redirected to the success url provided in the GetRedirectDataRequest.

The below screenshot shows an example of the payment selection page with Cash Withdrawal listed as one of the payment method.

711

Example handlePaymentStateChangedNotificationRequest:

<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationRequest xmlns="http://www.cqrpayments.com/PaymentProcessing" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<payment xsi:type="q1:paymentWithPaymentAccount">
<merchantID>KalixaAcceptDEMO</merchantID>
<shopID>KalixaAcceptDEMO</shopID>
<paymentMethod>
<key>64</key>
<value>CashWithdrawal</value>
</paymentMethod>
<merchantTransactionID>Sample_Cash_Withdraw_00002</merchantTransactionID>
<paymentID>eb493365-e3e4-4736-b8f9-664b6bd5a180</paymentID>
<userID>ef430f0a-a757-4eef-b1f0-9c689221b0bc</userID>
<paymentProvider>
<key>123</key>
<value>Kalixa</value>
</paymentProvider>
<amount currencyCode="USD">10.87</amount>
<creationType>
<key>1</key>
<value>User</value>
</creationType>
<userIP>10.155.19.251</userIP>
<state>
<id>33d802ee-1115-4fa2-840a-4d94c7e01be9</id>
<definition>
<key>232</key>
<value>Created</value>
</definition>
<createdOn>2021-12-15T14:26:15.7217443Z</createdOn>
<paymentStateDetails xsi:nil="true" />
</state>
<isExecuted>false</isExecuted>
<baseAmount currencyCode="EUR">8.17</baseAmount>
</payment>
</handlePaymentStateChangedNotificationRequest>

Example handlePaymentStateChangedNotificationResponse:

<?xml version="1.0" encoding="utf-16"?>
<handlePaymentStateChangedNotificationResponse xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<resultCode>
<key xmlns="http://www.cqrpayments.com/PaymentProcessing">0
<value xmlns="http://www.cqrpayments.com/PaymentProcessing" />
</resultCode>
<resultMessage />
<details xsi:nil="true" />
</handlePaymentStateChangedNotificationResponse>

Backend2BackendIntegration

Example initiatePaymentRequest:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<merchantID>MerchantID</merchantID>
	<shopID>ShopID</shopID>
	<merchantTransactionID>B1237</merchantTransactionID>
	<paymentMethodID>174</paymentMethodID>
	<amount currencyCode="USD">10</amount>
	<userID>2f904399-b21d-4032-bea9-76223c</userID>
	<userData>
		<username>2f904399-b21d-4032-bea9-76223c</username>
		<firstname>Tony</firstname>
		<lastname>Stark</lastname>
		<dateOfBirth>1980-01-03T00:00:00</dateOfBirth>
    <identificationNumber>1232322232</identificationNumber>
	</userData>
	<userIP>127.0.0.1</userIP>
	<userSessionID>0aea1662-c133-4377-a54a-c9018122c0e3</userSessionID>
	<creationTypeID>1</creationTypeID>
</initiatePaymentRequest>

Example initiatePaymentResponse:

<?xml version="1.0" encoding="utf-8"?>
<initiatePaymentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.cqrpayments.com/PaymentProcessing">
	<payment xsi:type="paymentWithPaymentAccount">
		<merchantID>MerchantID</merchantID>
		<shopID>ShopID</shopID>
		<paymentMethod>
			<key>174</key>
			<value>CashWithdrawal</value>
		</paymentMethod>
		<merchantTransactionID>B1237</merchantTransactionID>
		<paymentID>ff7fdc5c-d6e0-4f90-ae58-73bfbf7d0f78</paymentID>
		<userID>2f904399-b21d-4032-bea9-76223c</userID>
		<paymentProvider>
			<key>123</key>
			<value>Kalixa</value>
		</paymentProvider>
		<amount currencyCode="USD">10</amount>
		<creationType>
			<key>1</key>
			<value>User</value>
		</creationType>
		<userIP>127.0.0.1</userIP>
		<state>
			<id>0b4338c7-06b4-482f-b3ae-3b90f797b23d</id>
			<definition>
				<key>371</key>
				<value>ToBeWithdrawn</value>
			</definition>
			<createdOn>2021-02-03T10:49:38.0654985Z</createdOn>
			<paymentStateDetails>
				<detail xsi:type="keyStringValuePair">
					<key>PaymentStateReasonID</key>
					<value>1</value>
				</detail>
			</paymentStateDetails>
		</state>
		<isExecuted>false</isExecuted>
		<baseAmount currencyCode="EUR">9</baseAmount>
		<paymentDetails />
	</payment>
</initiatePaymentResponse>

Note: The merchantTransactionID from the request and response is the VoucherNumber that has to be enter in PS Admin.

The label is the shopID from the request.

477

📘

Expiration

CashWithdrawal payments are moved from state ToBeWithdrawn to state Expired after the default period of 7 days. This time span can be configured for each merchant.

Notifications

The standard notification mechanism is used for notifying the merchant in the background (asynchronously) about payment state changes. For more information see PaymentStateChangedNotification.

Example handlePaymentStateChangedNotificationRequest:

<?xml version="1.0" encoding="utf-8"?>
<handlePaymentStateChangedNotificationRequest xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.cqrpayments.com/PaymentProcessing">
    <payment xsi:type="paymentWithPaymentAccount">
        <merchantID>MerchantID</merchantID>
        <shopID>ShopID</shopID>
        <paymentMethod>
            <key>174</key>
            <value>CashWithdrawal</value>
        </paymentMethod>
        <merchantTransactionID>06129a57-d536-4bef-b9dc-f84efc893583</merchantTransactionID>
        <paymentID>072d3d6e-883f-49f1-bc27-80d1c1be9da0</paymentID>
        <userID>userID</userID>
        <paymentProvider>
            <key>123</key>
            <value>Kalixa</value>
        </paymentProvider>
        <amount currencyCode="USD">10.0000</amount>
        <creationType>
            <key>1</key>
            <value>User</value>
        </creationType>
        <userIP>127.0.0.1</userIP>
        <state>
            <id>f31cab99-ffa1-4296-a363-a38703f94171</id>
            <definition>
                <key>519</key>
                <value>WithdrawnToUser</value>
            </definition>
            <createdOn>2019-12-30T10:02:16.933</createdOn>
            <paymentStateDetails xsi:nil="true" />
        </state>
        <isExecuted>true</isExecuted>
        <baseAmount currencyCode="EUR">9.0000</baseAmount>
        <paymentAccount>
            <paymentAccountID>0</paymentAccountID>
        </paymentAccount>
    </payment>
</handlePaymentStateChangedNotificationRequest>