|
|
|
|
@ -5,14 +5,19 @@ import { callApi } from 'helpers' |
|
|
|
|
import type { SubscriptionResponse } from 'requests/getSubscriptions' |
|
|
|
|
|
|
|
|
|
type Props = { |
|
|
|
|
action: 'one_payment' | 'create_subscription', |
|
|
|
|
item: SubscriptionResponse, |
|
|
|
|
product_name: string, |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
export const getBrazilPaymentUrl = async ({ item, product_name }: Props) => { |
|
|
|
|
export const getBrazilPaymentUrl = async ({ |
|
|
|
|
action, |
|
|
|
|
item, |
|
|
|
|
product_name, |
|
|
|
|
}: Props) => { |
|
|
|
|
const config = { |
|
|
|
|
body: { |
|
|
|
|
action: 'create_subscription', |
|
|
|
|
action, |
|
|
|
|
data: { |
|
|
|
|
item: { ...item, product_name }, |
|
|
|
|
url_return: `${window.location.origin}${PAGES.thanksForSubscribe}`, |
|
|
|
|
|