Skip to content

Change amount dynamically problem #48

@digitalideafi

Description

@digitalideafi

Hi, in a php file I create a checkout service with let's say 10€, then I mount the SumUpCard using javascript call (in the same page) with parameters "amount: 50", "currency: EUR" and "locale: it-IT". In the widget, the submit button text is "Pay 10€" but if I make the payment I will pay 50€.
Why the button text do not change? I tried to use showAmount=false but nothing changed.

PHP

$sumup = new SumUp(array(
        'app_id'     	=> "XXXXX,
        'app_secret' => "YYYYY
        'grant_type' => 'client_credentials',
        'scopes'	=> array('payments', 'transactions.history', 'user.app-settings', 'user.profile_readonly'),
));
$returnURL         = "my return url";
$accessToken 	= $sumup->getAccessToken();
$value 			= $accessToken->getValue();
$ckoutsService = $sumup->getCheckoutService();
 $response 	= $ckoutsService ->create(10, "EUR", $value, '[email protected]', "some text",
          null, $returnURL, "M4FGYHE4", $returnURL);
$checkoutId     = $response->getBody()->id;

JS

currSumUpCARDPren = SumUpCard.mount({
	id: 'sumup-card',
	checkoutId: <?php echo $checkoutId ?>,
	locale: "it-IT",
	currency: "EUR",
	amount: 50,
	showAmount: false,
        onLoad: function() { },
        onResponse: function(type, body) {...}
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions