Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P58824
Gr4vy proof of concept
Active
Public
Actions
Authored by
jgleeson
on Mar 19 2024, 9:57 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Referenced Files
F42773307: Gr4vy proof of concept
Mar 19 2024, 9:57 PM
2024-03-19 21:57:13 (UTC+0)
Subscribers
None
<?php
require __DIR__ . '/vendor/autoload.php';
$
privateKeyLocation = __DIR__ . "/private_key.pem";
$
config = new Gr4vy\Gr4vyConfig("partners",
$
privateKeyLocation, true, "sandbox");
$
checkoutSession =
$
config->newCheckoutSession();
$
token =
$
config->getEmbedToken([
"amount" => 20,
"currency" => "GBP",
],
$
checkoutSession["id"]);
?>
<!DOCTYPE html>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"UTF-8"
>
<
title
>
Embed POC
</
title
>
<
script
src
=
"https://cdn.partners.gr4vy.app/embed.latest.js"
></
script
>
</
head
>
<
body
>
<
form
action
=
"/checkout"
id
=
"payment-form"
>
<
div
class
=
"container"
></
div
>
<
input
type
=
"submit"
/>
</
form
>
<
script
>
gr4vy
.
setup
({
gr4vyId
:
"partners"
,
element
:
".container"
,
form
:
"#payment-form"
,
amount
:
20
,
currency
:
"GBP"
,
country
:
"GB"
,
token
:
'<?php echo
$
token; ?>'
,
environment
:
"sandbox"
});
</
script
>
</
body
>
</
html
>
Event Timeline
jgleeson
created this paste.
Mar 19 2024, 9:57 PM
2024-03-19 21:57:13 (UTC+0)
jgleeson
updated the paste's language from
php
to
html
.
jgleeson
updated the paste's language from
html
to
php
.
jgleeson
updated the paste's language from
php
to
html
.
Log In to Comment