Comments (4)
Dear PeraDev7
You can do it this way with TransactionPending as a step after the create() and before calling the payment page url:
$transaction = $this->client->getTransactionService()->create($this->spaceId, $transactionPayload);
$transactionPending = new \Wallee\Sdk\Model\TransactionPending([
"id" => $transaction->getId(), // id of created transaction
"version" => 1
]);
$transactionPending->setSuccessUrl("https://yourshop.com/order/success.php?transaction_id="
. $transaction->getId());
$transactionPending->setFailedUrl("https://yourshop.com/order/failed.php?transaction_id="
. $transaction->getId());
$this->client->getTransactionService()->update($this->spaceId, $transactionPending); // update created transaction
$redirectionUrl =
$this->client->getTransactionPaymentPageService()->paymentPageUrl($this->spaceId, $transaction->getId());
Best regards
from php-sdk.
Dear PeraDev7
If you just want the existing data of a transaction on the success page, I recommend you to pass the transaction ID to the success page and read from there the transaction:
// e.g. Success URL: www.your-shop.com/order/successful?transaction_id=5
$transactionId = htmlspecialchars($_GET['transaction_id']);
$transaction = $apiClient->getTransactionService()->read($spaceId, $transaction->getId());
// with e.g. $transaction->getBillingAddress()->getFamilyName(); you can get then the data out of it
But it can take longer till the transition between authorize to fulfill is done (for example in deferred mode for credit cards).
This information will be transmitted via Webhooks to your shop system.
The URL you define for your Webhooks needs to have a script behind, that is fetching each incoming request (Webhook) from the wallee portal.
Workaround to get transaction updates by Webhooks:
-
First, the client uses a URL with the destination address where he wants to receive the webhooks (to test you can use Webhook.site): https://app-wallee.com/s/your-space/webhook/url/list
-
Then the client creates a listener with the type "Transaction" and with the statuses at which the webhooks should be sent: https://app-wallee.com/s/your-space/webhook/listener/list
-
At the defined target URL of the customer, the customer can intercept the webhooks. There is the entity ID (transaction ID included).
-
To get the transaction status and other transaction information, the customer must call the following method with the entity and space ID: https://app-wallee.com/api/client/transaction-service--read
Does this answer your questions?
Best regards
from php-sdk.
Thank you
I wanted to opt for inserting the transaction ID in the success url, but from what I see it is not possible, because the ID is accessible only after creating the transaction, right?
$transactionPayload->setSuccessUrl($urlSuccess);
$transactionPayload->setLineItems(array($lineItem));
$transactionPayload->setAutoConfirmationEnabled(true);
$transaction = $client->getTransactionService()->create($spaceId, $transactionPayload);
$redirectionUrl = $client->getTransactionPaymentPageService()->paymentPageUrl($spaceId, $transaction->getId());
Am i wrong? I'm stucked here. How can i get the ID before? Thanks
from php-sdk.
Thank you!
from php-sdk.
Related Issues (9)
- sample code does not work HOT 11
- Error after callApi (result of buildPaymentPageUrl) HOT 1
- Example to send amount to a terminal and wait response HOT 4
- Can't redirect clients to my website after payment complete and can't choose payment methods at my application HOT 1
- can't get response code HOT 3
- Test issue, please ignore
- Transaction Details HOT 2
- Feedback for release 3.1.4 HOT 1
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 php-sdk.