Skip to content

Commit

Permalink
Merge pull request #21 from mediaopt/feature/35058-partner-attributio…
Browse files Browse the repository at this point in the history
…n-id

#35058 using partner attribution id
  • Loading branch information
JonYeb authored Oct 27, 2023
2 parents 0fd4223 + 9be4fec commit 4aaa9c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "paypal-commercetools-client",
"version": "0.0.45",
"version": "0.0.46",
"private": false,
"type": "module",
"license": "MIT",
Expand Down
3 changes: 3 additions & 0 deletions src/app/useSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ export const SettingsProvider: FC<
options={{
...options,
intent: settings.payPalIntent.toString().toLowerCase(),
dataPartnerAttributionId: settings.partnerAttributionId
? (settings.partnerAttributionId as string)
: undefined,
}}
>
{children}
Expand Down
9 changes: 8 additions & 1 deletion src/components/HostedFields/HostedFieldsMask.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,21 @@ const SubmitPayment = () => {

export const HostedFieldsMask: React.FC<HostedFieldsProps> = ({ options }) => {
const { handleCreateOrder } = usePayment();
const { settings } = useSettings();
const { clientToken } = usePayment();
return (

return !settings ? (
<></>
) : (
<PayPalScriptProvider
options={{
clientId: options.clientId,
dataClientToken: clientToken,
components: options.components,
vault: options.vault,
dataPartnerAttributionId: settings.partnerAttributionId
? (settings.partnerAttributionId as string)
: undefined,
}}
>
<PayPalHostedFieldsProvider
Expand Down

0 comments on commit 4aaa9c8

Please sign in to comment.