adjustment for string methods

This commit is contained in:
David Bomba 2021-07-04 16:37:31 +10:00
parent 7dbe870ce0
commit 39db18f532

View File

@ -37,9 +37,13 @@ trait SubscriptionHooker
nlog("method name must be a string"); nlog("method name must be a string");
nlog($subscription->webhook_configuration['post_purchase_rest_method']); nlog($subscription->webhook_configuration['post_purchase_rest_method']);
nlog($subscription->webhook_configuration['post_purchase_url']);
$post_purchase_rest_method = (string)$subscription->webhook_configuration['post_purchase_rest_method'];
$post_purchase_url = (string)$subscription->webhook_configuration['post_purchase_url'];
try { try {
$response = $client->{$subscription->webhook_configuration['post_purchase_rest_method']}($subscription->webhook_configuration['post_purchase_url'],[ $response = $client->{$post_purchase_rest_method}($post_purchase_url,[
RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false RequestOptions::JSON => ['body' => $body], RequestOptions::ALLOW_REDIRECTS => false
]); ]);