Code Monkey home page Code Monkey logo

Comments (10)

asbjornu avatar asbjornu commented on August 22, 2024

Hi and thanks for reaching out! Sorry for the lack of documentation. The SDK is still in an early stage and documentation will come, there's just a few more pressing issues being dealt with. Just check back in a few weeks and documentation on how to use the SDK should be in place for sure.

from swedbank-pay-sdk-php.

gren83 avatar gren83 commented on August 22, 2024

Hi @asbjornu,
Thanks for your response. Then I will check back here in a few weeks.
If someone happens to have a PHP-script that shows how to initialize the SDK before that it would be great! Maybe it can be posted here in that case.

from swedbank-pay-sdk-php.

olegisk avatar olegisk commented on August 22, 2024

@gren83 You can check tests/ directory. There're good examples of the code.

from swedbank-pay-sdk-php.

gren83 avatar gren83 commented on August 22, 2024

@olegisk Thanks for the response. I tried to run tests/ConsumerTest.php but I can't seem to get it to work when calling it from the web. I think I probably need to have some require_once at the top of the file but I can't get it right it seems.

from swedbank-pay-sdk-php.

aait avatar aait commented on August 22, 2024

@gren83 How do you run tests? I should run using follow commands:

composer install
 vendor/bin/phpunit --configuration=./tests/phpunit.xml --bootstrap=./tests/bootstrap.php ./tests/ --coverage-clover=coverage.xml

from swedbank-pay-sdk-php.

mattiashallstrom avatar mattiashallstrom commented on August 22, 2024

It's unfortunate to see that this SDK still has no documentation and also are missing functionality that are available in swedbankpay.

from swedbank-pay-sdk-php.

aait avatar aait commented on August 22, 2024

@mattiashallstrom Which functionality are missing?
Regarding documentation you can check /tests/ directory. There are tests whick you can use as example.

from swedbank-pay-sdk-php.

mattiashallstrom avatar mattiashallstrom commented on August 22, 2024

@aait the thing I remember at the moment is a way to set paymentpurchase to generate recurrencetoken: "PaymentPurchase->setGenerateRecurrenceToken(true)".

Also I would had prefered more work on the actual part that we users use to use the SDK.
Your code is beautifully created and structured, but harder for a user to implement. I have read the test cases and have done a full implementation. I might miss some parts, but I would prefer not to have to all below just to do a paymentpurchase:

`$payeeInfo = new PaymentPayeeInfo();
$payeeInfo->setPayeeId($this->payee_id)
->setPayeeReference($payeeReference)
->setPayeeName('Ballou')
->setOrderReference($invoiceId);

    $price = new PriceItem();
    $price->setType('Creditcard')
        ->setAmount(round($amountInclVat * 100))
        ->setVatAmount(round($amountVat * 100));

    $prices = new PricesCollection();
    $prices->addItem($price);

    $creditCard = new PaymentPurchaseCreditcard();
    $creditCard->setNo3DSecure(false)
        ->setMailOrderTelephoneOrder(false)
        ->setRejectCardNot3DSecureEnrolled(false)
        ->setRejectCreditCards(false)
        ->setRejectDebitCards(false)
        ->setRejectConsumerCards(false)
        ->setRejectCorporateCards(false)
        ->setRejectAuthenticationStatusA(false)
        ->setRejectAuthenticationStatusU(false);

    $payment = new PaymentPurchase();
    $payment->setOperation('Purchase')
        ->setIntent('AutoCapture')
        ->setCurrency('SEK')
        ->setGenerateRecurrenceToken(true)
        ->setDescription('Faktura #' . $invoiceId)
        ->setUserAgent('Mozilla/5.0...')
        ->setLanguage('sv-SE')
        ->setPayerReference($customer['userid'])
        ->setUrls($url)
        ->setPayeeInfo($payeeInfo)
        ->setPrices($prices)
        ->setCardholder([
        	'firstname' => $customer['firstname'],
        	'lastname' => $customer['lastname'],
        	'email' => $customer['email']
        ]);

    $paymentObject = new PaymentPurchaseObject();
    $paymentObject->setPayment($payment);
    $paymentObject->setCreditCard($creditCard);

    $this->purchaseRequest = new Purchase($paymentObject);
    $this->purchaseRequest->setClient($this->client);`

Easy to fill in when you know what objects to use, but hard for a new user.
So I would prefer some simplicity (it could absolutely be me missing things in documentation/test)

from swedbank-pay-sdk-php.

aait avatar aait commented on August 22, 2024

@mattiashallstrom Hello, we have updated classes there #60

from swedbank-pay-sdk-php.

mattiashallstrom avatar mattiashallstrom commented on August 22, 2024

Looks great!

from swedbank-pay-sdk-php.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.