Menu

Wallet Monnaie Electronique

1)Création du Customer

  • Cette étape consiste à créer le customer.

    Exemple de code Curl :

        
        curl -v -X POST 'https://test-api.centralpay.net/v2/rest/customer' \
        -u 'doctest:4I9HJRTd' \
        -d 'firstName=Carla' \
        -d 'lastName=Mauru' \
        -d 'addressLine1=17 rue de la poste' \
        -d 'postalCode=37000' \
        -d 'city=Tours' \
        -d 'country=FR' \
        -d 'email=carlamauru@gmail.com' \
        -d 'cardTokenId=e03de50d-e864-43c4-8da5-95dfd28e2e8a'
        
        

Plusieurs réponses sont possibles :

Customer créé :


{
    "customerId": "6bb22104-c271-43e9-8a8d-d47812dade76",
    "creationDate": "2023-02-01T11:51:43.719426+01:00",
    "merchantCustomerId": null,
    "firstName": "CARLA",
    "lastName": "MAURU",
    "email": "carlamauru@gmail.com",
    "phone": null,
    "addressLine1": "17 RUE DE LA POSTE",
    "addressLine2": null,
    "addressLine3": null,
    "addressLine4": null,
    "postalCode": "37000",
    "city": "TOURS",
    "country": "FRA",
    "cards": [
        {
            "cardId": "864b055e-7105-47e0-a4a4-37d47686ed40",
            "creationDate": "2023-02-01T11:51:15.602631+01:00",
            "customerId": "6bb22104-c271-43e9-8a8d-d47812dade76",
            "cardTokenId": "e03de50d-e864-43c4-8da5-95dfd28e2e8a",
            "infoId": null,
            "merchantCardId": null,
            "commercialBrand": "VISA",
            "first6": "400000",
            "last4": "0010",
            "expirationMonth": 12,
            "expirationYear": 2023,
            "country": null,
            "cardholderName": "CARLA MAURU",
            "cardholderEmail": "carlamauru@gmail.com",
            "description": null,
            "fingerprint": "b31d96aaa14cf7436c4ad6d4b95a1e15c7de7cb3",
            "cardType": null,
            "region": null,
            "productType": null,
            "europeanEconomicArea": null,
            "check": false,
            "additionalData": {}
        }
    ],
    "description": null,
    "language": null,
    "otpExpired": false,
    "subscriptions": [],
    "installmentPayments": [],
    "fee": 0,
    "totalCharge": 0,
    "bankAccounts": [],
    "metaData": null,
    "movementId": "214676de-731e-456b-b039-2ac598badebc",
    "otpExpirationDate": null,
    "additionalData": {}
}

Cette réponse est renvoyée quand le customer a bien été créé.

Erreur de cardTokenId :


{
    "errors": {
        "cardTokenData": ""
    }
}

Cette réponse est renvoyée quand le cardTokenId n'est pas valide.

2)Création du Wallet

  • Cette étape consiste à créer le wallet du customer.

    Exemple de code Curl :

        
        curl -v POST 'https://test-api.centralpay.net/v2/rest/wallets' \
        -u 'doctest:4I9HJRTd' \
        -d 'currency=GTH' \
        -d 'customerId=6bb22104-c271-43e9-8a8d-d47812dade76'
        
        

Plusieurs réponses sont possibles :

Wallet créé :


{
    "walletId": "5b2307be-66f1-4b53-a7b1-9fc5fe22ba76",
    "available": [],
    "pending": [],
    "currency": "GTH",
    "bankAccount": {
        "iban": "FR7699999000014363653393541",
        "bic": "CEAYFR22"
    },
    "reference": null,
    "expirationDate": null,
    "activationDate": null,
    "additionalData": {}
}

Cette réponse est renvoyée quand le wallet a bien été créé.

Erreur de customer :


{
    "errors": {
        "customerId": "Empty or invalid"
    }
}

Cette réponse est renvoyée quand le customerId n'est pas valide.

3)Transaction

  • Cette étape consiste à réaliser une transaction avec capture.

    Exemple de code Curl :

        
        curl -v POST 'https://test-api.centralpay.net/v2/rest/transaction' \
        -h 'Content-Type: application/x-www-form-urlencoded' \
        -u 'doctest:4I9HJRTd' \
        -d 'customerId=6bb22104-c271-43e9-8a8d-d47812dade76' \
        -d 'currency=EUR' \
        -d 'amount=2500' \
        -d 'endUserIp=245.100.1.15' \
        -d '3ds[threeDSServerTransID]=d9403f5b-1f53-4cb9-b7be-914bf533f0f4' \
        -d '3ds[xid]=65846896528' \
        -d '3ds[cavv]=JAmi21makAifmwqo2120cjq1AAA=' \
        -d '3ds[eci]=01' \
        -d '3ds[status]=Y'
        
        

Réponse :


{
    "transactionId": "16aef720-d5aa-41e1-b541-b56ffe2dc56c",
    "creationDate": "2023-02-01T11:54:55.875600+01:00",
    "pointOfSaleId": "7ada08f0-e0f5-4c4a-96c0-a92a85aca539",
    "contractId": "71602dd0-2790-4743-877b-e72530d7576d",
    "merchantTransactionId": null,
    "archivingReference": "GQW8WB5W8PVE",
    "transactionStatus": "SUCCESS",
    "authorizationStatus": "SUCCESS",
    "bankCode": "0",
    "bankMessage": "Simulation : Transaction Approved",
    "authorizationCode": "000000",
    "riskScore": null,
    "source": "EC",
    "description": null,
    "currency": "EUR",
    "payoutCurrency": "EUR",
    "payoutAmount": 2500,
    "commission": 0,
    "fee": 0,
    "amount": 2500,
    "partialAuthorization": false,
    "partialAuthorized": false,
    "partialAuthorizedAmount": null,
    "totalAmount": 2500,
    "card": {
        "cardId": "864b055e-7105-47e0-a4a4-37d47686ed40",
        "creationDate": "2023-02-01T11:51:15.602631+01:00",
        "customerId": "6bb22104-c271-43e9-8a8d-d47812dade76",
        "cardTokenId": "e03de50d-e864-43c4-8da5-95dfd28e2e8a",
        "infoId": null,
        "merchantCardId": null,
        "commercialBrand": "VISA",
        "first6": "400000",
        "last4": "0010",
        "expirationMonth": 12,
        "expirationYear": 2023,
        "country": null,
        "cardholderName": "CARLA MAURU",
        "cardholderEmail": "carlamauru@gmail.com",
        "description": null,
        "fingerprint": "b31d96aaa14cf7436c4ad6d4b95a1e15c7de7cb3",
        "cardType": null,
        "region": null,
        "productType": null,
        "europeanEconomicArea": null,
        "check": false,
        "additionalData": {}
    },
    "cardMerchantToken": null,
    "captureStatus": "CAPTURED",
    "amountCaptured": 2500,
    "refunded": false,
    "amountRefunded": 0,
    "refunds": [],
    "endUserIp": "245.100.1.15",
    "endUserLanguage": null,
    "browserUserAgent": null,
    "browserAcceptLanguage": null,
    "country": null,
    "receiptEmail": "carlamauru@gmail.com",
    "transactiontransfers": [],
    "transferGroup": null,
    "residualAmount": 0,
    "order": {
        "firstName": "CARLA",
        "lastName": "MAURU",
        "addressLine1": "17 RUE DE LA POSTE",
        "addressLine2": null,
        "addressLine3": null,
        "addressLine4": null,
        "postalCode": "37000",
        "city": "TOURS",
        "country": "FRA",
        "email": "carlamauru@gmail.com",
        "phone": null,
        "cardCountry": null,
        "cardholderName": "CARLA MAURU",
        "cardholderEmail": "carlamauru@gmail.com"
    },
    "dispute": null,
    "cardPresent": {
        "cardSequenceNumber": null,
        "cardEntryMode": null,
        "pinEntryCapability": null,
        "transactionSequenceCounter": null,
        "uniqueTerminalId": null,
        "cardholderSignatureImage": null,
        "gpsLatitude": null,
        "gpsLongitude": null,
        "cardholderPhoto": null,
        "cardAcceptorTerminalId": null,
        "offlinePinIndicator": null,
        "ucatTerminalIndicator": null,
        "iccData": null,
        "iccDataResponse": null
    },
    "clearingNumber": null,
    "merchantCategoryCode": "6012",
    "withCvv": true,
    "authorizationCancellationDate": null,
    "customerId": "6bb22104-c271-43e9-8a8d-d47812dade76",
    "captureDate": "2023-02-01T11:54:57.322075+01:00",
    "clearingDate": null,
    "captureCancellationDate": null,
    "enrollmentId": null,
    "movementId": "b8a00bdb-a6d0-4261-9d41-536fc77510c8",
    "authorizationMovementId": "e26f1d33-7eb5-4382-a335-4a8ace8087f1",
    "cancelMovementId": null,
    "paymentRequestBreakdownId": null,
    "paymentRequestId": null,
    "invoiceId": null,
    "installmentId": null,
    "customAcceptanceData": {},
    "additionalData": {},
    "3ds": true
}

Cette réponse est renvoyée quand la transaction a bien été créé.

4)Transfert

  • Cette étape consiste à transferer les fonds reçu vers le wallet customer.

    Exemple de code Curl :

        
        curl -v POST 'https://test-api.centralpay.net/v2/rest/transfer' \
        -h 'Content-Type: application/x-www-form-urlencoded' \
        -u 'doctest:4I9HJRTd' \
        -d 'amount=1133' \
        -d 'emissionWalletId=8cb84d25-039f-496b-a4f7-2e54dc3ae142' \
        -d 'fromCurrency=EUR' \
        -d 'destinationWalletId=5b2307be-66f1-4b53-a7b1-9fc5fe22ba76' \
        -d 'toCurrency=GTH'
        
        

Plusieurs réponses sont possibles :

Transfert créé :


{
    "transferId": "8fb62992-5060-4f77-9a35-400e1d6ff8d1",
    "creationDate": "2023-02-01T11:56:56.412634+01:00",
    "merchantTransferId": null,
    "currency": "EUR",
    "amount": 2500,
    "fee": 0,
    "net": 2500,
    "toCurrency": "GTH",
    "exchangedAmount": 25,
    "exchangedFee": 0,
    "exchangedNet": 25,
    "rate": 1.0,
    "sourceType": null,
    "transferGroup": null,
    "description": null,
    "status": "TRANSFERRED",
    "transferReversals": [],
    "reversed": false,
    "metaData": null,
    "escrowDate": null,
    "emissionWalletId": "9b7f18d8-734f-4c72-8792-aea2ecdbdbaa",
    "destinationWalletId": "5b2307be-66f1-4b53-a7b1-9fc5fe22ba76",
    "sourceId": null,
    "movementId": "b5202fb5-483e-4f06-b112-dd6b1b358ada",
    "cancelMovementId": null,
    "cancellationDate": null,
    "additionalData": {}
}

Cette réponse est renvoyée quand le transfert a bien été créé.

Erreur de currency :


{
    "errors": {
        "currency": "Currency 'HUY' not found"
    }
}

Cette réponse est renvoyée quand la currency n'est pas valide.

Erreur de destinationWalletId :


{
    "errors": {
        "walletId": "Empty or invalid"
    }
}

Cette réponse est renvoyée quand le destinationWalletId n'est pas valide.

5a)Payout avec CB

  • Cette étape consiste à réaliser un payout

    Exemple de code Curl :

        
        curl -v POST 'https://test-api.centralpay.net/v2/rest/payout' \
        -h 'Content-Type: application/x-www-form-urlencoded' \
        -u 'doctest:4I9HJRTd' \
        -d 'merchantPayoutId=' \
        -d 'currency=EUR' \
        -d 'amount=2500' \
        -d 'customerId=6bb22104-c271-43e9-8a8d-d47812dade76' \
        -d 'cardId=34a3f444-9e5a-45c0-bf1f-4348dec849fc' \
        -d 'walletId=6bb22104-c271-43e9-8a8d-d47812dade76' \
        -d 'payoutType=CREDIT' \
        
        

Réponse :


{
    "payoutId": "b5d01971-a1a3-4ff9-b5a2-55bf2b72870f",
    "creationDate": "2023-05-02T18:29:02.521631+02:00",
    "destinationBankAccountId": null,
    "cancellationDate": null,
    "expectedArrivalDate": "2023-05-04",
    "arrivalDate": null,
    "merchantPayoutId": "payout marchand DEMO 02/05/2023",
    "currency": "EUR",
    "amount": 1,
    "fee": 0,
    "net": 1,
    "description": "ma description",
    "status": "PENDING",
    "automatic": false,
    "payoutReference": "PAYOUT-20230502182902",
    "payoutType": "CREDIT",
    "walletId": "6bb22104-c271-43e9-8a8d-d47812dade76",
    "movementId": null,
    "cancelMovementId": null,
    "additionalData": {},
    "message": null
}

Cette réponse est renvoyée quand le payout a bien été créé

5b)Payout avec IBAN

  • Cette étape consiste à réaliser un payout

    Exemple de code Curl :

        
        curl -v POST 'https://test-api.centralpay.net/v2/rest/payout' \
        -h 'Content-Type: application/x-www-form-urlencoded' \
        -u 'doctest:4I9HJRTd' \
        -d 'merchantPayoutId=valeurMarchand' \
        -d 'currency=EUR' \
        -d 'amount=2500' \
        -d 'destinationBankAccountId=903bdc68-6b00-4434-8f42-d36d4dc3bd1d' \
        -d 'walletId=6bb22104-c271-43e9-8a8d-d47812dade76' \
        -d 'payoutType=SCT' \
        
        

Réponse :


{
    "payoutId": "fff221b8-72f2-403c-88c9-5dbdd9725e11",
    "creationDate": "2023-05-02T18:26:47.746120+02:00",
    "destinationBankAccountId": "fa7ffc14-1250-4dfb-93ea-2df3b0be716e",
    "cancellationDate": null,
    "expectedArrivalDate": "2023-05-04",
    "arrivalDate": null,
    "merchantPayoutId": "payout marchand DEMO 02/05/2023",
    "currency": "EUR",
    "amount": 1,
    "fee": 0,
    "net": 1,
    "description": "ma description",
    "status": "PENDING",
    "automatic": false,
    "payoutReference": "PAYOUT-20230502182647",
    "payoutType": "SCT",
    "walletId": "6bb22104-c271-43e9-8a8d-d47812dade76",
    "movementId": "89e62dba-feef-4b13-ae4f-34fe62f734da",
    "cancelMovementId": null,
    "additionalData": {},
    "message": null
}

Cette réponse est renvoyée quand le payout a bien été créé.