linkorb / buckaroo

API client for Buckaroo BPE 3.0 for PHP. PSR-0 compliant.
MIT License
11 stars 16 forks source link

Servicecode: sepadirectdebit #14

Open Daboymarky opened 8 years ago

Daboymarky commented 8 years ago

Hi there,

I'm using your code for a SEPA Direct Debit payment. Now i'm having a problem. It works almost correctly, but when I do a request with the "Pay" action it's getting to Buckaroo with a statuscode 790 (Pending input: the request has been received, possibly the gateway is waiting for the customer to enter his details.) So i need the send the customer details with it. There is an action called "ExtraInfo" for sending customer details. But my question is how too send this action together with the "Pay" action?

Here is a part of the code so far:

        // Configuration
        $websiteKey = 'xxx';
        $req = new Buckaroo\Request($websiteKey);
        $req->loadPem(public_path().'/BuckarooPrivateKey.pem');

        // Create the message body (actual request)
        $TransactionRequest = new SOAP\Body();
        $TransactionRequest->Currency = 'EUR';
        $TransactionRequest->AmountDebit = 2.10;
        $TransactionRequest->Invoice = 'DNK_PHP_1';
        $TransactionRequest->Description = 'Example description for this request';
        $TransactionRequest->ReturnURL = 'http://192.168.33.116/';
        $TransactionRequest->StartRecurrent = FALSE;

        // Specify which service / action we are calling
        $TransactionRequest->Services = new SOAP\Services();
        $TransactionRequest->Services->Service = new SOAP\Service('sepadirectdebit', 'Pay', 1);

        // Add parameters for this service
        $TransactionRequest->Services->Service->RequestParameter = new SOAP\RequestParameter('customeraccountname', 'ABNAMRO');
        $TransactionRequest->Services->Service->RequestParameter = new SOAP\RequestParameter('CustomerIBAN', 'NL91ABNA0417164300');
/*
        // Specify which service / action we are calling
        $TransactionRequest->Services->Service = new SOAP\Service('sepadirectdebit', 'ExtraInfo', 1);

        // Add parameters for this service
        $TransactionRequest->Services->Service->RequestParameter = new SOAP\RequestParameter('MandateReference', 'Basis lidmaatschap');
        $TransactionRequest->Services->Service->RequestParameter = new SOAP\RequestParameter('MandateDate', Date('d-m-Y'));
        $TransactionRequest->Services->Service->RequestParameter = new SOAP\RequestParameter('CustomerName', 'Voor Achternaam');
*/
        // Optionally pass the client ip-address for logging
        $TransactionRequest->ClientIP = new SOAP\IPAddress('123.123.123.123');

        dd($TransactionRequest);
        // Send the request to Buckaroo, and retrieve the response
        $response = $req->sendRequest($TransactionRequest, 'transaction');

        // Display the response:
        var_dump($response);
martijngastkemper commented 8 years ago

Use $TransactionRequest->Services->Service[] instead of $TransactionRequest->Services->Service when you add a service to the transaction request.