Scandal
Well-known member
Hello all!
I'm building my first purchasable item for the xF2 payment system. I have one question and one issue.
A.
I have insert on the xf_purchasable table the info of this new purchasable item. Let's say that the purchasable_type_id is "sc_account_recovery".
I have this template code:
while PHP code is:
The problem:
When I click the button "Order Using X" I'm getting this on my browser console:
Any idea?
Of course I have place the relative class on my /src/addons/Scandals/MyAddonId/Purchasable/ folder.
B. As I can see, xF2 purchase system is based on the logged in user. Here I'm trying to build an account recovery process by guests.
Is there any way to use the purchase system by a guest?
Let's say that I'm verifying some information via a guest page that ends up with a $user entity (= the final verified's user info like $user->user_id etc). Then I need to use the purchase system like the user $user is logged in (but in reality he is not logged in).
Any idea or advices how to achieve it?
I'm building my first purchasable item for the xF2 payment system. I have one question and one issue.
A.
I have insert on the xf_purchasable table the info of this new purchasable item. Let's say that the purchasable_type_id is "sc_account_recovery".
I have this template code:
HTML:
<xf:form action="{{ link('purchase', {'purchasable_type_id': 'sc_account_recovery'}) }}" ajax="true" data-xf-init="payment-provider-container" class="block">
<xf:foreach loop="$profiles" key="$profileId" value="$profile">
<xf:if is="$profile">
<xf:button type="submit" name="payment_profile_id" value="{$profileId}" class="button--fullWidth" style="margin:0 auto;">
Order Using {$profile.title}
</xf:button>
</xf:if>
</xf:foreach>
<div class="js-paymentProviderReply-sc_account_recovery"></div>
</xf:form>
PHP:
$paymentRepo = $this->repository('XF:Payment');
$profiles = $paymentRepo->findPaymentProfilesForList()->fetch();
$viewparams = ['profiles' => $profiles];
return $this->view('', 'mytemplate', $viewparams);
When I click the button "Order Using X" I'm getting this on my browser console:
Any idea?
Of course I have place the relative class on my /src/addons/Scandals/MyAddonId/Purchasable/ folder.
B. As I can see, xF2 purchase system is based on the logged in user. Here I'm trying to build an account recovery process by guests.
Is there any way to use the purchase system by a guest?
Let's say that I'm verifying some information via a guest page that ends up with a $user entity (= the final verified's user info like $user->user_id etc). Then I need to use the purchase system like the user $user is logged in (but in reality he is not logged in).
Any idea or advices how to achieve it?