Comments (10)
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.
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.
@gren83 You can check tests/ directory. There're good examples of the code.
from swedbank-pay-sdk-php.
@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.
@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.
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.
@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.
@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.
@mattiashallstrom Hello, we have updated classes there #60
from swedbank-pay-sdk-php.
Looks great!
from swedbank-pay-sdk-php.
Related Issues (8)
- Fix deprecated warning in PHP 8
- Stable release? HOT 8
- Apple pay payment support?
- Undefined index: version - Exception is thrown in v4.0.0-beta.2
- Path to composer.lock HOT 4
- Feature Request: Direct bank transfer payments via Trustly HOT 8
- AbstractSimpleDataObject implements ArrayAccess but doesn't follow it's signatures HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swedbank-pay-sdk-php.