Skip to content

Commit bcd83c3

Browse files
Fix documentation URLs and update checkout redirects (#10)
* Fix documentation URLs and update checkout redirects * Confirmation URL in step 1 example
1 parent 69d6b4f commit bcd83c3

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

examples/step1_checkout_create.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

33
/*
4-
* This file provides an example about how to complete the step 2 of Aplazame's
4+
* This file provides an example about how to complete the step 01 of Aplazame's
55
* integration as described in:
6-
* https://aplazame.com/en/docs/api/3-steps-to-checkout/#2-checkout
6+
* https://aplazame.com/integraciones/api/
77
*
88
* It contains three steps:
99
*
@@ -32,7 +32,7 @@
3232

3333

3434
/**
35-
* Create checkout payload as described in https://aplazame.com/en/docs/api/checkout-parameters/
35+
* Create checkout payload as described in https://aplazame.com/integraciones/api/checkout-creation/
3636
*
3737
* @return object
3838
*/
@@ -41,11 +41,12 @@ function createCheckoutPayload() {
4141
* Merchant model
4242
*/
4343
$merchant = new stdClass();
44-
$merchant->notification_url = '/step3_checkout_confirm.php'; // url where you will receive Aplazame webhook events as described in https://aplazame.com/en/docs/api/confirm-api/#implement-the-confirmation-endpoint
45-
$merchant->cancel_url = '/cancel'; // url that the customer is sent to if there is an error in the checkout.
46-
$merchant->success_url = '/success'; // url that the customer is sent to after confirming their order.
47-
$merchant->checkout_url = '/checkout'; // url that the customer is sent to if the customer chooses to back to the e-commerce, by default is /.
48-
44+
$merchant->notification_url = 'https://merchant.com/order/step3_checkout_confirm.php'; // url where you will receive Aplazame webhook events as described in https://aplazame.com/integraciones/api/checkout-confirmation/
45+
$merchant->success_url = "/success"; // url that the customer is sent to after confirming their order.
46+
$merchant->pending_url = "/pending"; // url that the customer is sent to if the order status is pending.
47+
$merchant->error_url = "/error"; // url that the customer is sent to if there is an error in the checkout.
48+
$merchant->dismiss_url = "/checkout"; // url that the customer is sent to if the customer chooses to back to the e-commerce, by default is /.
49+
$merchant->ko_url = "/ko"; // url that the customer is sent to if Aplazame refuses the order.
4950

5051
/*
5152
* Article model
@@ -68,7 +69,6 @@ function createCheckoutPayload() {
6869
*/
6970
$articles = array( $article, );
7071

71-
7272
/*
7373
* Order model
7474
*/
@@ -111,7 +111,6 @@ function createCheckoutPayload() {
111111
$customer->last_login = Aplazame\Serializer\Date::fromDateTime(new DateTime('2020-08-27 19:57:56')); // A datetime of the customer last login.
112112
$customer->address = $customerAddress; // Customer address.
113113

114-
115114
/*
116115
* Billing address model
117116
*/
@@ -126,7 +125,6 @@ function createCheckoutPayload() {
126125
$billingAddress->phone = '601765432'; // Billing phone number.
127126
$billingAddress->address_addition = 'Cerca del Gran Puente'; // Billing address addition.
128127

129-
130128
/*
131129
* Shipping info model
132130
*/
@@ -145,7 +143,6 @@ function createCheckoutPayload() {
145143
$shippingInfo->tax_rate = Aplazame\Serializer\Decimal::fromFloat(21.00); // Shipping tax rate. (21.00%)
146144
$shippingInfo->discount = Aplazame\Serializer\Decimal::fromFloat(1.00); // The discount amount of the shipping. (1.00 €)
147145

148-
149146
/*
150147
* Checkout model
151148
*/
@@ -164,7 +161,7 @@ function createCheckoutPayload() {
164161
* Send the checkout payload generated by createCheckoutPayload to Aplazame and returns the Aplazame Checkout ID
165162
*
166163
* @param \Aplazame\Api\Client $aplazameApiClient A configured client with the api key and environment
167-
* @param array|object $payload Checkout Parameters as described in https://aplazame.com/en/docs/api/checkout-parameters/
164+
* @param array|object $payload Checkout Parameters as described in https://aplazame.com/integraciones/api/checkout-creation/
168165
*
169166
* @return string Aplazame checkout ID
170167
*

examples/step3_checkout_confirm.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

33
/*
4-
* This file provides an example about how to complete the step 3 of Aplazame's integration as described in:
5-
* https://aplazame.com/en/docs/api/3-steps-to-checkout/#3-confirm
4+
* This file provides an example about how to complete the step 03 of Aplazame's integration as described in:
5+
* https://aplazame.com/integraciones/api/
66
*
77
* This file is split in two main sections:
88
*
@@ -102,7 +102,7 @@ function setOrderPaymentStatusAsPending($order_id)
102102
}
103103

104104
/*
105-
* This section is a more specific Aplazame flow as described in https://aplazame.com/en/docs/api/confirm-api/
105+
* This section is a more specific Aplazame flow as described in https://aplazame.com/integraciones/api/checkout-confirmation/
106106
*
107107
* Feel free to adjust to the specific requirements of your checkout process. The following snippet is provided as a quick start.
108108
*/

0 commit comments

Comments
 (0)