Create an account


Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 20,169
» Latest member: crabber45
» Forum threads: 21,768
» Forum posts: 22,652

Full Statistics

Online Users
There are currently 494 online users.
» 0 Member(s) | 489 Guest(s)
Applebot, Baidu, Bing, DuckDuckGo, Google

 
  News - Review: Puzzle & Dragons Gold – Sadly, Not Everything That Glitters Is Gold
Posted by: xSicKxBot - 01-23-2020, 07:45 PM - Forum: Nintendo Discussion - No Replies

Review: Puzzle & Dragons Gold – Sadly, Not Everything That Glitters Is Gold


The Puzzle & Dragons series has been a juggernaut in the mobile gaming space for close to a decade now, due in no small part to its distinctly satisfying blend of RPG elements with match-3 puzzle action. Even today, the series still routinely pulls grosses well into the billions, which has naturally led to a whole slew of spinoffs and other multimedia elements popping up to grow the franchise’s reach. Most notably for Nintendo fans, this expansive reach led to the creation of the excellent Puzzle & Dragons Z + Puzzle & Dragons: Super Mario Bros. Edition for the 3DS a few years ago, showing off what the series could look like as a more fleshed-out and traditional affair.

Now, it seems that GungHo wanted to repeat its past success via the release of Puzzle & Dragons Gold, a brand new entry in the series that was designed from the ground up with the Switch in mind. It’s the sort of thing that could’ve been a slam dunk, but unfortunately, Puzzle & Dragons Gold just isn’t all that good. What we’ve been given is not a sprawling and addicting RPG to keep you hooked for hours on end, but rather a stripped-down and disappointing take on the beloved gameplay that made the original release such a hit.


The story of Puzzle & Dragons Gold is kept to almost a complete minimum, while borrowing heavily from the anime series that has sprung up in the wake of the franchise’s success. The narrative mostly focuses around the similar tales of either Taiga or Ryuji, two hopeful, competitive Puzzle & Dragons players that are looking to win big in a sweeping competition that bears more than a passing resemblance to the Pokémon league. The storyline essentially just assumes that you’re intimately familiar with the anime, and if you happen not to be, very little effort is put into giving you any context to character relationships or conflicts. This is about as surface-level and shallow a story as we’ve ever seen in an ‘RPG’ before, and it’s no exaggeration to say that about three hours is all it will take to see all that this paltry single-player offering has to give.

What’s perhaps the most disappointing and baffling thing about this single player is how cheap it feels. There’s no overworld to roam around, no NPCs to talk to, no dungeons to explore, and any sense of RPG level progression has almost entirely been removed. Your experience will consist of going through a handful of battles with premade teams, mashing ‘A’ through some confusing and poorly written cutscenes, then reaching the quick end and wondering why you wasted your time. It’s generous to even call this mode a tutorial because you have virtually no control over your odds of winning given that you can’t pick a team that could be more effective against whichever foe you happen to be fighting. It may be that Puzzle & Dragons Gold was always pitched as a “multiplayer-first” sort of take on the series, but the utterly pathetic attempt at a single-player experience is an insult to the series’ legacy.


The core gameplay in battles has been kept relatively intact, consisting of two phases for each turn. Phase one allows you to pick which skills to trigger from the dragons on your team and phase two begins after all skills for both you and your opponent have taken effect. This latter phase is where the real action happens, as you have ten seconds to make as many matches as possible on a simple 6×6 grid filled with myriad colours of orbs. The catch here is that you can only move one orb around for the entire turn, dragging it to and fro in an attempt to rearrange all the other orbs into lines of three or more before you finally put it down and lock in your ‘attack’. Puzzle & Dragons Gold doesn’t do a very good job of explaining the mechanics of these fights to you, but a little trial and error is all it takes to see the interesting pace and flow of a battle.

Win or lose, you’re sure to gain at least a little bit of progress towards your overall character level, and hitting different level milestones will net you rainbow orbs to pitch into the gacha. No, Puzzle & Dragons Gold mercifully does not have any microtransactions, but you’re still extremely limited in terms of team compositions when the only path to progression is gated by a seemingly endless, randomized loot box grab.

Even if you do get the pulls that you want, there’s no such thing as training or building up your dragons here; the extent of ‘training’ them is the simple act of unlocking two new skills for them by using them in battle enough. Even this, however, is limited to the scant twenty Leader dragons that you use to anchor any team you arrange for multiplayer use. The other 500+ ‘follower’ dragons you could potentially use to pad out the remaining five spots on your team amount to little more than glorified pictures that come with fixed skills and stats. Mixing them around for your multiplayer teams is a little bit of fun at first, but with there being no real progression possible for them, it’s tough to stay very invested in team compositions or overall gameplay.


One notable area where Puzzle & Dragons Gold doesn’t disappoint, however, is in the surprisingly high-quality of its visuals. Although only those twenty Leader dragons get HD models that show up in the arena, each is excessively detailed and well-animated. Powerful attacks shake the screen with showy and bombastic flair that injects some much-needed excitement into the otherwise ho-hum experience, making for a game that often looks fantastic on the Switch’s portable screen. In many ways, it feels bizarre that Puzzle & Dragons Gold looks this good, as virtually every other aspect of the experience is an incredible letdown.

Conclusion


When one takes a step back to look at all that Puzzle & Dragons Gold has to offer, it’s rather difficult to say exactly who it’s for. Longtime fans of the series will no doubt decry the laundry list of cutbacks that the core gameplay suffers from, while newcomers will be paying cash to get a massive misrepresentation of what the series is actually all about. Sure, multiplayer proves to be mildly amusing for a time, but it lacks the kind of depth or longevity that previous releases in the series have had in spades, and the less said about the single-player content, the better. Puzzle & Dragons Gold feels in many ways like a free demo of a much better game that you could potentially buy, except no such game exists because this is it. Don’t waste your time or money on this poor approximation; go download Puzzle & Dragons for free on your phone for a much more enjoyable experience and save your money for much more worthwhile releases for the Switch.



https://www.sickgaming.net/blog/2020/01/...s-is-gold/

Print this item

  [Oracle Blog] Java Magazine New Edition: Java Present and Future
Posted by: xSicKxBot - 01-23-2020, 12:07 PM - Forum: Java Language, JVM, and the JRE - No Replies

Java Magazine New Edition: Java Present and Future

There is a lot happening in Java, and in this issue we do our best to make the state of Java as clear as possible. We begin with a survey (page 15) of Java developers. The survey covers JDK, tools in use, processes, and finally a profile of Java developers.


We follow that up with a look at Java 11 (page 39), which was released in September: what’s in this release that you need to know about—such as changes to lambda syntax, a new HTTP client, and the updated WebSocket interface. The Java 11 release was the first in several years not to include JavaFX, which has been spun out from the JDK. This means that JavaFX can evolve on its own timeline, which is discussed (page 62) by Johan Vos, one of its principal developers.


We also examine upcoming technology from the Valhalla project (page 56), which promises to make it far easier and faster to access primitive data types. This performance enhancement will be particularly welcome when accessing objects in arrays, as Ben Evans explains in his deep look inside the JVM.


Finally, the product management team for Java explains recent changes (page 52) to the licensing model. In addition, we have a deep dive into the
decorator design pattern (page 67), our quiz (page 78), and our book review (page 8), as well as our calendar of upcoming developer conferences and




https://blogs.oracle.com/java/java-magaz...and-future

Print this item

  News - Pokémon GO 2020 Global Events Revealed, Safari Zones To Be Held In US And UK
Posted by: xSicKxBot - 01-23-2020, 12:06 PM - Forum: Nintendo Discussion - No Replies

Pokémon GO 2020 Global Events Revealed, Safari Zones To Be Held In US And UK

Pokemon Go Safari Zone 2020

Pokémon GO developer Niantic has announced a handful of large-scale community events set to take place throughout the first half of the year.

Four events have been detailed so far, all taking place between February and May of 2020. The majority of these are Pokémon GO Safari Zone events, which have traditionally allowed attendees to snag region-exclusive Pokémon not usually available in their area. Here’s the full list so far:

  • Taiwan Lantern Festival in Taichung – February 6-9
  • Pokémon GO Safari Zone St. Louis – March 27-29 (Tickets will go live starting January 24 at 8:00 AM CT)
  • Pokémon GO Safari Zone Liverpool – April 17-19 (More information about tickets will be announced soon)
  • Pokémon GO Safari Zone Philadelphia – May 8-10 (More information about tickets will be announced soon)

Niantic has also revealed that similar events held across 2019, including Pokémon GO Fest Chicago, helped to drive an estimated $249 million in tourism revenue for the cities in which they appeared. These events have regularly attracted tens of thousands of Pokémon fans, many of whom travelled across the globe to take part.

Do you happen to live near any of these events? Will you try to attend? Let us know in the comments below.



https://www.sickgaming.net/blog/2020/01/...%ef%bb%bf/

Print this item

  News - Pokémon Clone Temtem Is So Successful Its Servers Are Crumbling Under Demand
Posted by: xSicKxBot - 01-23-2020, 12:06 PM - Forum: Nintendo Discussion - No Replies

Pokémon Clone Temtem Is So Successful Its Servers Are Crumbling Under Demand


Crema Games has just released its monster-collecting MMO Temtem on Steam early access, and it’s proven to be so successful that players have had trouble getting online with the game. Thankfully, it would seem that things are now settling down after some updates, but people are still having trouble getting the game up and running smoothly – but then, isn’t that why ‘early access’ is much fun?

As you can see from the game’s launch trailer above, it’s all very “Pocket Monster”, complete with an anime-style aesthetic, catchy theme tune and a cast of cute beasts to collect. The key difference is that this is an MMO, which could take the whole ‘gotta catch ’em all’ concept to an entirely new level.


Funded by Kickstarter to the tune of $573,939 (the initial goal was $70,000), Temtem is published by Humble Bundle. It’s coming to Switch in the fullness of time, as well as PS4 and Xbox One.

Will you be picking this one up on Switch, or have you already downloaded the Steam version? Let us know with a comment.



https://www.sickgaming.net/blog/2020/01/...er-demand/

Print this item

  Xbox Wire - Xbox Insider Release Notes – Beta Ring (2002.200107-2102)
Posted by: xSicKxBot - 01-23-2020, 12:06 PM - Forum: Xbox Discussion - No Replies

Xbox Insider Release Notes – Beta Ring (2002.200107-2102)

Hey Beta ring users! Today’s Xbox Insider Release Notes highlight the latest fixes, known issues, and features coming to your console. Starting at 2:00 p.m. PT today, users will receive the latest 2002 Xbox One system update (build: 19H1_RELEASE_XBOX_DEV_2002\18363.9100.200107-2102). Keep reading for more details.

System Update Details:


  • OS version released: 19H1_RELEASE_XBOX_DEV_2002\18363.9100.200107-2102
  • Available: 2:00 p.m. PT – January 13, 2020
  • Mandatory: 3:00 a.m. PT – January 14, 2019


System Update

System Update

Fixes for Beta


We’ve heard your feedback, and we’re happy to announce the following fixes have been implemented for this 2002 build:

Home


  • Users should no longer see seeing a “Something went wrong” error message with code 0x80070002 on console boot.
  • Fixed an issue where some users were reporting the dashboard would fail to load or crash when exiting a game/app.

System


  • Various updates to properly reflect local languages across the console.

Xbox Insider Release Notes

Xbox Insider Release Notes

Known Issues for Beta


We understand some issues have been listed in previous Xbox Insider Release Notes. These issues aren’t being ignored, but it will take Xbox engineers more time to find a solution. We appreciate your patience at this time!

Audio


  • Users who have Dolby Atmos enabled and console display settings set to 120hz with 36 bits per pixel (12-bit) are experiencing loss of Dolby Atmos audio in some situations.
    • Workaround: Disable 120hz or set Video Fidelity to 30 bits per pixel (10-bit) or lower.

Messaging


  • Users are unable to send a voice message while in Parties.
    • Workaround: Send the message while not currently in party chat.

Profile Color


  • Sometimes users may encounter the incorrect Profile color when powering on the console.

Are you not seeing your issue listed above? Make sure to use Report a problem to keep us informed of your issue. We may not be able to respond to everyone, but the data we’ll gather is crucial to finding a resolution.

Learn more about feedback and how each ring is differentiated in the following links:

For more information regarding the Xbox Insider Program follow us on Twitter and join the community subreddit for support and updates. Keep an eye on future Xbox Insider Release Notes for more information regarding your Xbox One Update Preview ring!



https://www.sickgaming.net/blog/2020/01/...0107-2102/

Print this item

  News - Play Now For Free – Half-Life Series
Posted by: xSicKxBot - 01-23-2020, 12:06 PM - Forum: Lounge - No Replies

Play Now For Free – Half-Life Series

Half-Life: Alyx is coming in March, and we are celebrating early by making all games in the Half-Life Series FREE to play for Steam users, from now until the day it launches!

If you already have Steam installed, you can click the following links to start playing now!
Half-Life
Half-Life 2
Half-Life 2: Episode One
Half-Life 2: Episode Two

If you don’t have Steam, you can download it here.

Half-Life: Alyx is set before the events of Half-Life 2 and the episodes, but the games share characters and story elements. The Half-Life: Alyx team believes that the best way to enjoy the new game is to play through the old ones, especially Half-Life 2 and the episodes, so we want to make that as easy as possible.





https://www.sickgaming.net/blog/2020/01/...fe-series/

Print this item

  News - YouTube TV comes to PS4, replacing PlayStation’s own doomed TV service PS Vue
Posted by: xSicKxBot - 01-23-2020, 12:06 PM - Forum: Lounge - No Replies

YouTube TV comes to PS4, replacing PlayStation’s own doomed TV service PS Vue

YouTube has announced that its live TV service YouTube TV has officially launched on PlayStation 4, a debut that heralds the end of Sony’s own ambitions in the live TV streaming space.

The launch comes just one week before Sony’s ill-fated PlayStation Vue goes offline for good on January 30, 2020. The service got its start in 2015, but Sony says a highly competitive industry and expansive complications with licensing deals ultimately made Vue a losing battle.

“Unfortunately, the highly competitive Pay TV industry, with expensive content and network deals, has been slower to change than we expected,” said a previous statement from Sony Interactive Entertainment deputy president John Kodera. “Because of this, we have decided to remain focused on our core gaming business.”

Sony had reportedly been on the hunt for a buyer prior to announcing PlayStation Vue’s shutdown in late 2019, but instead opted to shutter the service altogether after a little under 5 years of support.



https://www.sickgaming.net/blog/2020/01/...ce-ps-vue/

Print this item

  News - Watch The Trailer For New Toy Story Short Film
Posted by: xSicKxBot - 01-23-2020, 12:06 PM - Forum: Lounge - No Replies

Watch The Trailer For New Toy Story Short Film

Disney+ continues to deliver new original content on a weekly basis, from new episodes of The Mandalorian and The Clone Wars to short films featuring characters from the world of Toy Story. And the streaming service has revealed an upcoming short about what happened to Bo Peep prior to the events of Toy Story 4.

Titled Lamp Life, the original short will come to Disney+ on January 31, as Peep tells Woody the tale of how she ended up in the small town with the infamous antique store. Check out the trailer for the short below.

This isn't the first Toy Story short film on Disney+. The streaming service's original series Forky Asks A Question features the titular character, voiced by Tony Hale, asking other characters from the Toy Story universe questions about life, food, and emotions. Of course, all of these episodes get sidetracked when Forky can't comprehend the answers he's been given.

Additionally, there are other Toy Story shorts on the service as well, called Toy Story Toons. These were shown during theatrical releases of Disney movies, then later aired on the Disney channel.

For more on Disney+, check out everything coming to the service this January.


https://www.gamespot.com/articles/watch-...0-6472976/

Print this item

  [Tut] Python Regex Split
Posted by: xSicKxBot - 01-23-2020, 05:01 AM - Forum: Python - No Replies

Python Regex Split

Why have regular expressions survived seven decades of technological disruption? Because coders who understand regular expressions have a massive advantage when working with textual data. They can write in a single line of code what takes others dozens!

This article is all about the re.split(pattern, string) method of Python’s re library.

Let’s answer the following question:

How Does re.split() Work in Python?


The re.split(pattern, string, maxsplit=0, flags=0) method returns a list of strings by matching all occurrences of the pattern in the string and dividing the string along those.

Here’s a minimal example:

>>> import re
>>> string = 'Learn Python with\t Finxter!'
>>> re.split('\s+', string)
['Learn', 'Python', 'with', 'Finxter!']

The string contains four words that are separated by whitespace characters (in particular: the empty space ‘ ‘ and the tabular character ‘\t’). You use the regular expression ‘\s+’ to match all occurrences of a positive number of subsequent whitespaces. The matched substrings serve as delimiters. The result is the string divided along those delimiters.

But that’s not all! Let’s have a look at the formal definition of the split method.

Specification

re.split(pattern, string, maxsplit=0, flags=0)

The method has four arguments—two of which are optional.

  • pattern: the regular expression pattern you want to use as a delimiter.
  • string: the text you want to break up into a list of strings.
  • maxsplit (optional argument): the maximum number of split operations (= the size of the returned list). Per default, the maxsplit argument is 0, which means that it’s ignored.
  • flags (optional argument): a more advanced modifier that allows you to customize the behavior of the function. Per default the regex module does not consider any flags. Want to know how to use those flags? Check out this detailed article on the Finxter blog.

The first and second arguments are required. The third and fourth arguments are optional.

You’ll learn about those arguments in more detail later.

Return Value:

The regex split method returns a list of substrings obtained by using the regex as a delimiter.

Regex Split Minimal Example


Let’s study some more examples—from simple to more complex.

The easiest use is with only two arguments: the delimiter regex and the string to be split.

>>> import re
>>> string = 'fgffffgfgPythonfgisfffawesomefgffg'
>>> re.split('[fg]+', string)
['', 'Python', 'is', 'awesome', '']

You use an arbitrary number of ‘f’ or ‘g’ characters as regular expression delimiters. How do you accomplish this? By combining the character class regex [A] and the one-or-more regex A+ into the following regex: [fg]+. The strings in between are added to the return list.

How to Use the maxsplit Argument?


What if you don’t want to split the whole string but only a limited number of times. Here’s an example:

>>> string = 'a-bird-in-the-hand-is-worth-two-in-the-bush'
>>> re.split('-', string, maxsplit=5)
['a', 'bird', 'in', 'the', 'hand', 'is-worth-two-in-the-bush']
>>> re.split('-', string, maxsplit=2)
['a', 'bird', 'in-the-hand-is-worth-two-in-the-bush']

We use the simple delimiter regex ‘-‘ to divide the string into substrings. In the first method call, we set maxsplit=5 to obtain six list elements. In the second method call, we set maxsplit=3 to obtain three list elements. Can you see the pattern?

You can also use positional arguments to save some characters:

 >>> re.split('-', string, 2)
['a', 'bird', 'in-the-hand-is-worth-two-in-the-bush']

But as many coders don’t know about the maxsplit argument, you probably should use the keyword argument for readability.

How to Use the Optional Flag Argument?


As you’ve seen in the specification, the re.split() method comes with an optional fourth ‘flag’ argument:

re.split(pattern, string, maxsplit=0, flags=0)

What’s the purpose of the flags argument?

Flags allow you to control the regular expression engine. Because regular expressions are so powerful, they are a useful way of switching on and off certain features (for example, whether to ignore capitalization when matching your regex).


Syntax Meaning
re.ASCII If you don’t use this flag, the special Python regex symbols w, W, b, B, d, D, s and S will match Unicode characters. If you use this flag, those special symbols will match only ASCII characters — as the name suggests.
re.A Same as re.ASCII
re.DEBUG If you use this flag, Python will print some useful information to the shell that helps you debugging your regex.
re.IGNORECASE If you use this flag, the regex engine will perform case-insensitive matching. So if you’re searching for [A-Z], it will also match [a-z].
re.I Same as re.IGNORECASE
re.LOCALE Don’t use this flag — ever. It’s depreciated—the idea was to perform case-insensitive matching depending on your current locale. But it isn’t reliable.
re.L Same as re.LOCALE
re.MULTILINE This flag switches on the following feature: the start-of-the-string regex ‘^’ matches at the beginning of each line (rather than only at the beginning of the string). The same holds for the end-of-the-string regex ‘$’ that now matches also at the end of each line in a multi-line string.
re.M Same as re.MULTILINE
re.DOTALL Without using this flag, the dot regex ‘.’ matches all characters except the newline character ‘n’. Switch on this flag to really match all characters including the newline character.
re.S Same as re.DOTALL
re.VERBOSE To improve the readability of complicated regular expressions, you may want to allow comments and (multi-line) formatting of the regex itself. This is possible with this flag: all whitespace characters and lines that start with the character ‘#’ are ignored in the regex.
re.X Same as re.VERBOSE

Here’s how you’d use it in a practical example:

>>> import re
>>> re.split('[xy]+', text, flags=re.I)
['the', 'russians', 'are', 'coming']

Although your regex is lowercase, we ignore the capitalization by using the flag re.I which is short for re.IGNORECASE. If we wouldn’t do it, the result would be quite different:

>>> re.split('[xy]+', text)
['theXXXYYYrussiansXX', 'are', 'Y', 'coming']

As the character class [xy] only contains lowerspace characters ‘x’ and ‘y’, their uppercase variants appear in the returned list rather than being used as delimiters.

What’s the Difference Between re.split() and string.split() Methods in Python?


The method re.split() is much more powerful. The re.split(pattern, string) method can split a string along all occurrences of a matched pattern. The pattern can be arbitrarily complicated. This is in contrast to the string.split(delimiter) method which also splits a string into substrings along the delimiter. However, the delimiter must be a normal string.

An example where the more powerful re.split() method is superior is in splitting a text along any whitespace characters:

import re text = ''' Ha! let me see her: out, alas! he's cold: Her blood is settled, and her joints are stiff; Life and these lips have long been separated: Death lies on her like an untimely Frost Upon the sweetest flower of all the field. ''' print(re.split('\s+', text)) '''
['', 'Ha!', 'let', 'me', 'see', 'her:', 'out,', 'alas!', "he's", 'cold:', 'Her', 'blood', 'is', 'settled,', 'and', 'her', 'joints', 'are', 'stiff;', 'Life', 'and', 'these', 'lips', 'have', 'long', 'been', 'separated:', 'Death', 'lies', 'on', 'her', 'like', 'an', 'untimely', 'Frost', 'Upon', 'the', 'sweetest', 'flower', 'of', 'all', 'the', 'field.', ''] '''

The re.split() method divides the string along any positive number of whitespace characters. You couldn’t achieve such a result with string.split(delimiter) because the delimiter must be a constant-sized string.

Related Re Methods


There are five important regular expression methods which you should master:

  • The re.findall(pattern, string) method returns a list of string matches. Read more in our blog tutorial.
  • The re.search(pattern, string) method returns a match object of the first match. Read more in our blog tutorial.
  • The re.match(pattern, string) method returns a match object if the regex matches at the beginning of the string. Read more in our blog tutorial.
  • The re.fullmatch(pattern, string) method returns a match object if the regex matches the whole string. Read more in our blog tutorial.
  • The re.compile(pattern) method prepares the regular expression pattern—and returns a regex object which you can use multiple times in your code. Read more in our blog tutorial.

These five methods are 80% of what you need to know to get started with Python’s regular expression functionality.

Where to Go From Here?


You’ve learned about the re.split(pattern, string) method that divides the string along the matched pattern occurrences and returns a list of substrings.

Learning Python is hard. But if you cheat, it isn’t as hard as it has to be:

Download 8 Free Python Cheat Sheets now!



https://www.sickgaming.net/blog/2020/01/...gex-split/

Print this item

  [Tut] Shipping API Integration in PHP with Australia Post Example
Posted by: xSicKxBot - 01-23-2020, 05:01 AM - Forum: PHP Development - No Replies

Shipping API Integration in PHP with Australia Post Example

Last modified on January 22nd, 2020 by Vincy.

In an eCommerce website, we use the shipping API to calculate shipping cost. We calculate based on the items added to the shopping cart.

Integrating Shipping API with an eCommerce website will optimize the logistics cost. It takes care of the shipping needs in an effective way.

Shipping API integration helps eCommerce website by charging the right amount for shipping. Imagine when we add a random fixed cost to each checkout. What will happen is that, we will either overcharge the customer or end up in direct loss.

Australia Post Shipping API Integration in PHP

In this article, we will see how to integrate Australia Post shipping API in a PHP application. You can use this code in a shopping cart checkout page to calculate shipping rates.

I have created code to request the Australia Post API to calculate the shipping rates. This rate is for the products on domestic shipping.

What is inside?


  1. What is Shipping API?
  2. Utilities of third-party shipping API
  3. Existing shipping API available
  4. About Australia Post API
  5. About this example
  6. File Structure
  7. Australia Post shipping API integration steps
  8. Web interface to get data to calculate shipping rates
  9. PHP code with Australia Post shipping API request-response handlers
  10. Australia Post shipping API integration output

What is Shipping API?


Shipping API – a digital intermediate as like as other APIs. It resolves eCommerce website shipping needs.

Integratable extern responds to the queries generated by the application.

With the available services and capabilities, it help build the eCommerce website’s shipping needs.

This ready-made solution will smoothen the customer’s buying experience with your online store.

Capabilities of Shipping APIs


For each eCommerce website, the motive to integrate Shipping API differs. This variation depends on the utilities required by the shopping cart.

In general, the capabilities of Shipping APIs are,

  1. Verifying shipping zone
  2. Multi-carrier support
  3. Tracking the order traces during shipment.

With these capability limit, the Shipping APIs provides ultimate services. And, they are huge in number. For example,

  1. Ensuring the shipping destination and thereby calculate the success probability of the delivery.
  2. Request a quote for the carrier or shipment.
  3. Receiving notification about tracking updates.

The Australia Post shipping API provides services like,

  • Postage assessment calculation
  • Postal code search
  • SecurePay online payments and more.

Existing shipping API available


Postal carrier APIs like DHL, USPS, Australia Post provides services for the eCommerce website. It offers services like calculating shipping rates, tracking shipped parcel and more.

There are numerous third-party shipping APIs available.  For example Postmen, EasyPost, Shippo and more.

The third-party shipping API has a RESTful interface that connects postal service APIs. It creates a channel to read the API to access its functionalities.

About Australia Post API


Australia Post API suite has the following list APIs. All these APIs help to fulfil the transactional needs of your eCommerce website.

  1. Postage assessment calculator – To get the cost for shipping a document or parcel.
  2. Shipping and tracking – To get service on product dispatch and tracking.
  3. SecurePay online payments – Payment solutions for an eCommerce website via SecurePay integration.
  4. Delivery choices API – gives the delivery choices to the user to choose location, speed, day, date, time.

For accessing the API, it requires the corresponding API key. As per the Australia Post API access requirements it asks to register with the API  to get the key.

Australia Post provides an interface to explore the APIs. You may generate live API requests via this explorer to see how it works.

About this example


In this example, it uses the Postage assessment calculator API  or PAC of the Australia Post API suite.

This API provides services to calculate the shipping cost. This cost varies based on the parcel weight, dimension, and more parameters.

This API includes various endpoints returning resources data based on the access requests.

I am creating a request for calculating the shipping cost for a domestic parcel. This request needs the corresponding API key. In the next section, we will see how to get the API key for accessing the PAC API.

For this calculation, the API requires the parcel dimension, height, width. And also, it needs the shipping zone’s origin and destination postal codes. These are all common considering any eCommerce website.

I get the parameters from the user via an HTML form and send it with the API request.

This example uses PHP CURL to access the Australia Post Postage assessment calculator API.

File Structure


The below screenshot shows the Australia Post shipping rate calculation example files.

Shipping API AusPost Files Structure

Australia Post shipping API integration steps


The steps to integrate Australia Post in an eCommerce website are,

  1. Choose API from the Australia Post API suite.
  2. Create a new account to get the API key.
  3. Choose the postage service and set the endpoint.
  4. Set the API key as the HTTP header AUTH-KEY.
  5. Generate the PAC API request with the header set in step 4.

How to get the Australia Post PAC API key


There are many APIs provided by the Australia Post in API suite. The first step is to choose the API based on the need of your eCommerce website.

As discussed in the last section, I choose PAC API for calculating the shipping cost.

The PAC API access requirements state that it need the API key. This key is for authenticating the service request generated from the application.

Aus Post PAC API Registration

On submitting valid information, it will send the API key to the registered email address. You can use this API then, to access the PAC API services.

Getting API Key from Auspost

Web interface to enter details to calculate shipping rates


This is the code to show a form to collect the product and shipping details.

It has the fields to collect the width, height, weight, and length of the parcel. The form will show the units of these parameters to the user.

 Also, it collects the shipping address. This is the shipping destination address. The zip code is a mandatory field among the shipping address fields.

The shipping origin and destination postal codes are mandatory to calculate the rates.

In this example, the postal code of the shipping origin is configurable. You can also move it to the HTML form to let the user enter the data.

index.php

<HTML> <HEAD> <TITLE>Shipping API</TITLE> <link href="./assets/css/phppot-style.css" type="text/css" rel="stylesheet" /> <link href="./assets/css/shipping-api.css" type="text/css" rel="stylesheet" /> <script src="./vendor/jquery/jquery-3.3.1.js" type="text/javascript"></script> </HEAD> <BODY> <div class="phppot-container"> <div class="australian-api"> <div class="page-heading">Australian Shipping API</div> <form name="australian-api" id="australian-api" action="" method="post" on‌submit="return formValidation()"> <div class="sub-heading">Product Details</div> <div class="row"> <div class="inline-block"> <div class="form-label"> Length<span class="units-style">(cm)</span><span class="required error" id="length-info"></span> </div> <input class="input-box-110" type="text" name="length" id="length" value="<?php if(! empty($_POST["length"])){ echo $_POST["length"];}?>"> </div> <div class="inline-block input-right-margin"> <div class="form-label"> Width<span class="units-style">(cm)</span><span class="required error" id="width-info"></span> </div> <input class="input-box-110" type="text" name="width" id="width" value="<?php if(! empty($_POST["width"])){ echo $_POST["width"];}?>"> </div> <div class="inline-block"> <div class="form-label"> Height<span class="units-style">(cm)</span><span class="required error" id="height-info"></span> </div> <input class="input-box-110" type="text" name="height" id="height" value="<?php if(! empty($_POST["height"])){ echo $_POST["height"];}?>"> </div> <div class="inline-block input-right-margin"> <div class="form-label"> Weight<span class="units-style">(kg)</span><span class="required error" id="weight-info"></span> </div> <input class="input-box-110" type="text" name="weight" id="weight" value="<?php if(! empty($_POST["weight"])){ echo $_POST["weight"];}?>"> </div> </div> <div class="row"> <div class="inline-block"> <div class="form-label"> Quantity<span class="required error" id="quantity-info"></span> </div> <input class="input-box-110" type="number" name="quantity" id="quantity" value="<?php if(! empty($_POST["quantity"])){ echo $_POST["quantity"];}else{echo 1;}?>"> </div> </div> <div class="sub-heading">Shipping Address</div> <div class="row"> <div class="inline-block input-right-margin"> <div class="form-label">Address1</div> <input class="input-box-330" type="text" name="address1" id="address1" value="<?php if(! empty($_POST["address1"])){ echo $_POST["address1"];}?>"> </div> <div class="inline-block"> <div class="form-label">Address2</div> <input class="input-box-330" type="text" name="address2" id="address2" value="<?php if(! empty($_POST["address2"])){ echo $_POST["address2"];}?>"> </div> </div> <div class="row"> <div class="inline-block input-right-margin"> <div class="form-label">Country</div> <input class="input-box-330" type="text" name="country" id="country" value="<?php if(! empty($_POST["country"])){ echo $_POST["country"];}?>"> </div> <div class="inline-block"> <div class="form-label">State</div> <input class="input-box-330" type="text" name="state" id="state" value="<?php if(! empty($_POST["state"])){ echo $_POST["state"];}?>"> </div> </div> <div class="row"> <div class="inline-block input-right-margin"> <div class="form-label">City</div> <input class="input-box-330" type="text" name="city" id="city" value="<?php if(! empty($_POST["city"])){ echo $_POST["city"];}?>"> </div> <div class="inline-block"> <div class="form-label"> Zip Code<span class="required error" id="to-postcode-info"></span> </div> <input class="input-box-330" type="text" name="to-postcode" id="to-postcode" value="<?php if(! empty($_POST["to-postcode"])){ echo $_POST["to-postcode"];}?>"> </div> </div> <div class="row"> <div id="inline-block"> <input type="submit" class="submit-button" name="submit-btn" id="submit-btn" value="Get Quote"><span><img src="img/loader.gif" class="loader-ic" id="loader-icon"></span> </div> </div> </form> <?php if (! empty($shippingPrice)) { ?><div> <div class="sub-heading">Shipping Details</div> <div class="row"> <label class="shipping-result">Address1:</label> <?php echo $address1;?></div> <div class="row"> <label class="shipping-result">Address2:</label> <?php echo $address2;?></div> <div class="row"> <label class="shipping-result">Country:</label> <?php echo $country;?></div> <div class="row"> <label class="shipping-result">State:</label> <?php echo $state;?></div> <div class="row"> <label class="shipping-result">City:</label> <?php echo $city;?></div> <div class="row"> <label class="shipping-result">Quantity:</label> <?php echo $quantity;?></div> <div class="row"> <label class="shipping-result">Shipping price:</label> $<?php echo $quantity * $shippingPrice;?></div> </div> <?php }else if(!empty($errorMsg)){?> <div class="error-message"><?php echo $errorMsg;?></div> <?php }?> </div> </div> <script src="./assets/js/shipping.js"></script> </BODY> </HTML> 

CSS created to present the payment form


This CSS includes basic styles to show the shipping form to the user. It has exclusive styles related to this example.

Apart from that, this example contains a generic CSS phppot-styles.css. It contains common template styles with a list of selectors. You can find this generic CSS in the downloadable source.

assets/css/shipping-api.css

.australian-api { background: #fff; border-radius: 4px; padding: 10px; width: 85%; margin: 20px 40px; } .page-heading { font-size: 2em; font-weight: bold; } .sub-heading { font-size: 1.2em; font-weight: bold; margin: 20px 0px; } .inline-block { display: inline-block; } .row { margin: 15px 0px; } .form-label { margin-bottom: 5px; text-align: left; } input.input-box-330 { width: 250px; } input.input-box-110 { width: 120px; margin-right: 5px; } .australian-api .error { color: #ee0000; padding: 0px; background: none; border: #ee0000; } .australian-api .error-field { border: 1px solid #d96557; } .australian-api .error:before { content: '*'; padding: 0 3px; color: #D8000C; } input.submit-button { background-color: #ffb932; border-color: #ffc87a #e2a348 #da9d0a; text-align: center; cursor: pointer; color: #000; width: 100px; } .input-right-margin { margin-right: 30px; } .shipping-result { font-weight: bold; color: #737171; padding: 15px 0px; } .error-message { color: #D8000C; } .units-style { font-size: 0.8em; color: #666; margin-left: 2px; } .loader-ic { display: none; } 

jQuery script to validate the shipping details


The shipping.js file contains the form validation function. It validates the mandatory fields and makes sure that they are not empty.

It returns boolean based on which the form-post carried forward to PHP. While returning false, it highlights what’s wrong with the entered data.

After successful validation, PHP will validate the shipping attributes sent via the form.

assets/js/shipping.js

function formValidation() { var valid = true; $("#length").removeClass("error-field"); $("#width").removeClass("error-field"); $("#height").removeClass("error-field"); $("#weight").removeClass("error-field"); $("#quantity").removeClass("error-field"); $("#to-postcode").removeClass("error-field"); var Length = $("#length").val(); var Width = $("#width").val(); var Height = $("#height").val(); var Weight = $("#weight").val(); var Quantity = $("#quantity").val(); var toPostcode = $("#to-postcode").val(); if (Length.trim() == "") { $("#length-info").html("").css("color", "#ee0000").show(); $("#length").addClass("error-field"); valid = false; } if (Width.trim() == "") { $("#width-info").css("color", "#ee0000").show(); $("#width").addClass("error-field"); valid = false; } if (Height.trim() == "") { $("#height-info").css("color", "#ee0000").show(); $("#height").addClass("error-field"); valid = false; } if (Weight.trim() == "") { $("#weight-info").css("color", "#ee0000").show(); $("#weight").addClass("error-field"); valid = false; } if (Quantity.trim() == "" || Quantity < 1) { $("#quantity-info").css("color", "#ee0000").show(); $("#quantity").addClass("error-field"); valid = false; } if (toPostcode.trim() == "") { $("#to-postcode-info").css("color", "#ee0000").show(); $("#to-postcode").addClass("error-field"); valid = false; } if (valid == false) { $('.error-field').first().focus(); valid = false; } if (valid == true) { $("#submit-btn").hide(); $("#loader-icon").show(); } return valid; } 

PHP code with Australia Post shipping API request-response handlers


This is the configuration file of this example code. It has the constants defined for keeping the API key and shipping origin.

Common/Config.php

<?php namespace Phppot; class Config { const AUSTRALIAN_POST_API_KEY = 'REPLACE_WITH_THE_API_KEY'; const SHIPPING_ORIGION = '1000'; } ?> 

This is an exclusive service class for executing curl script. The execute() function is receiving URL, API KEY as its parameters.

It initiates curl object and set the URL. It sets the header with the API key to call the Australia Post live URL.

The rawBody will receive the API response in JSON format. You can use this as a sample to build an eCommerce website backed by a shopping cart with shipping API integration.

lib/CurlService.php

<?php namespace Phppot; class CurlService { public function execute($url, $apiKey, $ch = null) { if (is_null($ch)) { $ch = curl_init(); } curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'AUTH-KEY: ' . $apiKey )); return $rawBody = curl_exec($ch); } } ?> 

The AusPost.php PHP class handles the operation for preparing the API request.

The getShipmentPrice() function set the API key and form data to the PHP variables. It prepares the query parameters with these variables.

The class constructor instantiates the curlService created for this example.

Using the curl instance, it hits the Australia Post live PAC API URL. The API will validate the shipping criteria passed with the query parameters.

The request and response can be of either JSON or XML.

lib/AusPost.php

<?php namespace Phppot; class AusPost { private $curlService; private $api_url = 'https://digitalapi.auspost.com.au/postage/parcel/domestic/calculate?'; public function __construct() { require_once __DIR__ . '/CurlService.php'; $this->curlService = new CurlService(); } public function getShipmentPrice() { require_once __DIR__ . '/../Common/Config.php'; $con = new Config(); $apiKey = $con::AUSTRALIAN_POST_API_KEY; $fromPostcode = $con::SHIPPING_ORIGION; $toPostcode = $_POST["to-postcode"]; $length = $_POST["length"]; $width = $_POST["width"]; $height = $_POST["height"]; $weight = $_POST["weight"]; $queryParams = array( "from_postcode" => $fromPostcode, "to_postcode" => $toPostcode, "length" => $length, "width" => $width, "height" => $height, "weight" => $weight, "service_code" => "AUS_PARCEL_REGULAR" ); // here use $curlService and execute $url = $this->api_url . http_build_query($queryParams); $result = $this->curlService->execute($url, $apiKey); $shippingResult = json_decode($result); return $shippingResult; } } ?> 

index.php (PHP Code)

<?php namespace Phppot; if (! empty($_POST["submit-btn"])) { require_once __DIR__ . '/lib/AusPost.php'; $shippingApi = new AusPost(); $result = $shippingApi->getShipmentPrice(); if (isset($result->postage_result)) { $shippingPrice = $result->postage_result->total_cost; } else { $errorMsg = $result->error->errorMessage; } $quantity = $_POST["quantity"]; $address1 = $_POST["address1"]; $address2 = $_POST["address2"]; $state = $_POST["state"]; $country = $_POST["country"]; $city = $_POST["city"]; } ?> 

Australia Post shipping API integration output


The output screenshot below shows the payment and shipping form. It is to get the shipping details from the user.

It also has the fields to collect parameters like height, width and the dimension of the products.

You can also integrate this form into your shopping cart checkout page to calculate rates. For a shopping cart, it requires only the shipping address.

Because, the height, width, height will be a part of a product entity. And the quantity can be read from the cart session or database. The below form is generic and with little customization can be used for any eCommerce website.

Shipping API Australia Post User Interface

Download

↑ Back to Top



https://www.sickgaming.net/blog/2020/01/...t-example/

Print this item

 
Latest Threads
(Indie Deal) Directive 80...
Last Post: xSicKxBot
32 minutes ago
News - New Fallout Game I...
Last Post: xSicKxBot
32 minutes ago
Black Ops (BO1, T5) DLC's...
Last Post: crabber45
5 hours ago
Thank you
Last Post: cschir10
5 hours ago
News - Xbox Kills Obsidia...
Last Post: xSicKxBot
Yesterday, 10:52 PM
Black Ops 2 GSC Studio | ...
Last Post: Cellulose
Yesterday, 06:50 PM
Black Ops 2 (BO2,T6) 1.19...
Last Post: Cellulose
Yesterday, 06:48 PM
Black Ops 2 Jiggy v4.3 PC...
Last Post: Cellulose
Yesterday, 06:47 PM
Redacted T6 Nightly Offli...
Last Post: xavier_aeee
Yesterday, 09:25 AM
News - Love And Deepspace...
Last Post: xSicKxBot
Yesterday, 06:30 AM

Forum software by © MyBB Theme © iAndrew 2016