Update v1.2.7.1* - Replacement of old Payment Handler

Good day everyone.

This post covers the v1.2.7.1* migration, which took place on the 5th of November 2022. Read through this post very carefully, mistakes can be fatal for your group (as in parcel not registering any new purchases).

Summary about the Migration
We have officially migrated to our new payment gateway (https://payments.parcelroblox.com). The old payment handler (https://api.parcelroblox.com) remains intact until the 30th of November 2022, after that date, it will go offline and any requests will fail.

For default Hubs:
You don’t have to do anything. All updates were already pushed to your Hub over our loader.

For custom Hubs:
Please follow the steps below in order to keep your Hub fully operational in the future.

Note: This guide is only for custom hubs that have been downloaded before the 16th of November 2022. All newer versions on our Sharepoint contain the new domain by default.

  1. Open the APICalls script in Roblox Studio.
    pg-tut-1

  2. Delete all the code that is located in the red box. (Line 1 to 36)

  3. Copy the code below and paste it at the very top of your APICalls script.

local apiCaller = {}

local http = game:GetService("HttpService")
local endpoint = "https://api.parcelroblox.com/api/"
local payments_endpoint = "https://payments.parcelroblox.com/external/"
local parcelSettings = require(game.ServerScriptService.ParcelSettings)
local secretKey = parcelSettings.SecretKey;


function apiCaller.getProfile(userId: string, option: string) 
	local res = http:RequestAsync({
		Url = endpoint.. "user/check/".. userId .. "?option=".. option,
		Method = "GET",
	})
	
	local data = http:JSONDecode(res.Body)
	
	if res.StatusMessage == "OK" then
		return {robloxId = data.details.robloxID, discordId = data.details.discordID, isVerified = data.details.verified, username = data.details.discordTag};
	end
end

function apiCaller.addWhitelist(userId: string, productId: string)
	local res = http:RequestAsync({
		Url = payments_endpoint.."hub/order/complete",
		Method = "POST",
		Headers = {
			["Content-Type"] = "application/json", 
			["hub-secret-key"] = secretKey,
		},
		Body = http:JSONEncode({robloxID = userId, productID = tostring(productId)})
	})
	
	local data = http:JSONDecode(res.Body)
	
	return {status = res.StatusCode, message = data.message}
end

Congrats, you have successfully updated your custom hub to the new domain.
If you have questions or encounter problems, feel free to contact our Customer Support.

That’s actually awesome!